eslint-plugin-import-x icon indicating copy to clipboard operation
eslint-plugin-import-x copied to clipboard

How to configure import-x/extensions to enforce .js

Open bodinsamuel opened this issue 1 year ago • 1 comments

Hi,

I recently switched from eslint-plugin-import to this package, thanks for taking over. Most things are drop-in replacements but I'm struggling with import-x/extensions in Typescript env.

No matter what I'm configuring it's always asking to add .ts extension, while it works with bun and bundler, it's not correct when targeting node. Is there a way to configure it to ask for .js? Or did I misconfigure something?

 'import-x/extensions': [
    'error',
    'always',
      {
          json: 'always',
          js: 'always',
          ts: 'never',
          ignorePackages: true,
     },
 ],

Thanks in advance

bodinsamuel avatar Sep 29 '24 14:09 bodinsamuel