8 Commits

Author SHA1 Message Date
Ofek
5eb5262c64 Various type improvements, mostly in tests (#8144) 2025-09-27 10:17:55 +03:00
Matt Godbolt
9a8673f950 Update tests to use node fs (#7446)
Also don't re-export fs and path through utils
2025-02-25 13:39:26 -06:00
Matt Godbolt
653a214f39 Fix a test that used relied on toMatch matching an array 2024-03-30 13:53:04 -05:00
Matt Godbolt
fd3dd917f5 Vitest (#6219)
Port to vitest. Port everything to typescript. Remove chai, mocha and
chai-as-promised. Adds some docs.
2024-03-08 22:25:09 -06:00
Ofek
a62c5a84b5 Fix #5889: add block-lookahead logic to processAST (#5903)
The code here assumes a top-level AST subtree can be in 3 states:
1. The header line indicates it's system code (e.g. includes `/usr`
etc.)
 2. The header line indicates it's user code (includes `<source>`)
3. The header contains no such info (typically it includes `<invalid
sloc>`)

For the 3rd case this PR looks-ahead inside the current subtree and
decides based on its contents.
This is enough to filter out `<vector>` or `<string>` contents, as
demonstrated in issue #5889 (added a test). This solution holds also for
the case from issue #3849.
2023-12-28 16:10:09 +02:00
Jeremy Rifkin
34292238c1 Identify unused imports during lint (#5130) 2023-06-11 17:35:59 -04:00
Mats Jun Larsen
633eb82d18 Transition to ECMAScript Modules (#4780)
Makes the Compiler Explorer app, and all the tooling ESM compatible.
Things that have been done:

1. The package.json has `type: module` now
2. All relative imports have a .js ending
3. All directory imports are now directory/index.js to comply with ESM
standards
4. Dependency node-graceful is now imported into tree, because the
package is broken under esm
5. Dependency p-queue has been bumped to 7.x with ESM support
6. Dependency profanities has been bumped to 3.x with ESM support
7. Webpack config is now both ESM and CommonJS compatible
8. Non-ESM compatible imports have been rewritten
9. ESLint configuration has been tweaked to not fail on .js imports
10. Mocha is now hacked together and ran with ts-node-esm
11. Webpack is now hacked together and ran with ts-node-esm
12. Webpack config is now ESM compatible, so that it can be used in the
dev server
13. Cypress code still runs commonjs, and has been excluded from the
tsconfig
14. All sinon mock tests have been commented out, because sinon module
mocks do not work with ESModules (because ESModules are immutable)

A lot of tests are now giving warnings/errors to stdout, yet still pass.
Docenizer codegenerator scripts have been updated, but I did not re-run
them, and instead just changed their code.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-02-27 18:06:38 -06:00
Jeremy Rifkin
32333355ec Convert a few llvm tests (#4737) 2023-02-13 22:48:25 -05:00