Commit Graph

15 Commits

Author SHA1 Message Date
overlookmotel 3068658c30 style(napi/parser): prefer const to let (#16386)
Use `const` where variables are not reassigned instead of `let`. Preparation for enabling ESLint's `prefer-const` rule (running as an Oxlint JS plugin) in our linting setup.
2025-12-02 10:27:27 +00:00
Boshen 523a30a016 style(all): apply oxfmt default options (#16091)
Embrace the defaults!

---------

Co-authored-by: Yuji Sugiura <y.sugiura.0316@gmail.com>
2025-11-25 15:56:24 +09:00
leaysgur a8e5181ab7 chore(infra): dogfooding oxfmt (#14979)
Fixes #14803

- Added `oxfmt` and `oxfmtrc.jsonc`
- Remove `dprint` plugin and useless ignore paths
- Apply `dprint` again
- Apply `oxfmt`
2025-10-28 01:16:46 +00:00
overlookmotel bb040bc2d5 refactor(parser, linter): replace .mjs files with .js (#14045)
Now that `apps/oxlint` and `napi/parser` are both ESM packages (#13723 and #14042), we can use `.js` file extensions for all ESM files, rather than the mix of `.js` and `.mjs` file we had previously.

It's less confusing having to remember what's `.js` and what's `.mjs`, and avoids ugly workarounds like #14038 (`.d.mts`??).
2025-09-23 14:47:40 +00:00
overlookmotel ac3e9e966a refactor(napi/parser): move JS code into src-js directory (#13899)
Pure refactor. Root of `napi/parser` was getting really crowded with tons of files, and I'm about to add a load more for the ESTree walker.

Move JS source files into a `src-js` directory, like in `apps/oxlint`, so that the root of the package is just config files and scripts.
2025-09-19 08:46:42 +00:00
Boshen 4577b71ec8 feat(napi/parser)!: change oxc-parser to ESM (#13432)
closes #13329
2025-09-08 10:53:05 +00:00
overlookmotel 5baa4f1467 refactor(napi/parser): fix lint errors (#13185)
Same as #13184.

#13173 enabled Oxlint for all the repo, but we currently skip `napi` directory.

Fix all errors that Oxlint flags in `napi/parser`.

We currently can't turn on Oxlint for the directory, because `oxlint-disable` comments don't work for type-aware rules, but we should be able to once that's fixed.
2025-08-18 22:14:15 +00:00
Boshen 3cf867cc93 feat(napi/parser): expose module record data for export default interface (#10894)
fixes #10644
2025-05-08 13:04:59 +00:00
Ulrich Stark a9785e347e fix(parser,linter): consider typescript declarations for named exports (#10532)
Only VariableDeclaration, FunctionDeclaration and ClassDeclaration were
considered when collecting named export declarations for the module
record. Now the parser also considers TSTypeAliasDeclaration,
TSInterfaceDeclaration, TSEnumDeclaration, TSImportEqualsDeclaration and
TSModuleDeclaration named export declarations of the module.

Maybe the other `decl.declaration.is_typescript_syntax()` check in
`module_record.rs` also needs to be removed?

Closes #10318
Closes #10556
2025-04-25 14:44:12 +08:00
Ulrich Stark 4f1343b235 fix(parser): fix missing type export in module information (#10516)
Closes #10505

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2025-04-21 17:18:50 +08:00
Boshen c479a58718 feat(napi/parser): expose dynamic import expressions (#8540)
closes #8369
2025-01-16 22:25:22 +08:00
Boshen 00fea9285b feat(napi/parser): expose span positions of import.meta (#7677) 2024-12-05 11:03:52 +00:00
Boshen 1de2842f8e feat(napi/parser): return EcmaScriptModule::hasModuleSyntax (#7647) 2024-12-04 13:00:47 +00:00
Boshen 40792b4440 feat(napi/parser): change parse API to accept mandatory filename and optional lang (#7605) 2024-12-03 12:09:48 +00:00
Boshen 7c62a33a06 feat(napi/parser): return esm info (#7602)
The parser now returns import / export statement information, which can be used for parser plugins.
2024-12-03 11:21:54 +00:00