Description
Context:
I have a typescript project for a node application using ESM (ecmascript modules)
Because node requires that file extensions be specified for relative imports when using esm, typescript files must import relative modules with the ".js" extension. Using a typescript resolver enables linting to resolve these modules well, but when trying to enforce file extensions using the import/extensions rule, the linter expects the file extensions to be ".ts".
I would like a way to configure the rule to assert that extension rather be ".js"
Repro :
applying linting rules
npx eslint .
in the following gist
https://gist.github.com/pwhissell/165232e5fdd62641efa771f000f1e651
Current output:
1:31 error Missing file extension "ts" for "./other.js" import/extensions 2:33 error Missing file extension "ts" for "./another" import/extensions
Expected:
2:33 error Missing file extension "js" for "./another" import/extensions
Example usage:
rules: { import/extensions: ["error", {"ts", "ignorePackages", "js"}] #<-- this would tell the linter that modules defined in ts files should always be imported with the .js extension }