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.
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`??).
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.
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.
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#10318Closes#10556