AlexSergey / eslint-plugin-file-extension-in-import-ts

18 stars 6 forks source link

Extension replacement does not work #10

Open thefrana opened 3 months ago

thefrana commented 3 months ago

When I have

import foo from "bar.ts"

It replaces the import with

import foo from "bar.ts.js"

I am using the ESLint flat file config with compatibility package.

Also, do you intent to support flat config without compat layer?

Thanks for the package!

AlexSergey commented 2 months ago

@thefrana , Could you provide me reproducable sample with this behavior? It doesnt reproduce in my "example" project.

Regarding ESLint 9, i'm not super familiar with flat config right now but you still can use this module with this settings:

import fileExtensionInImportTs from 'eslint-plugin-file-extension-in-import-ts';

plugins: {
  'file-extension-in-import-ts': fileExtensionInImportTs,
},

rules: {
  'file-extension-in-import-ts/file-extension-in-import-ts': 'error',
}