Closed tobbexiv closed 3 days ago
Thanks for the great project.
I had the following line in my project config:
'import/extensions': [`error`, { ts: `never`, js: `never`, json: `always`, checkTypeImports: true }]
I was wondering why I still got errors for json file imports.
When digging deeper, I found that the pattern definitions on the main object are ignored in case certain other properties like checkTypeImports are set: https://github.com/import-js/eslint-plugin-import/blob/a20d84398a7946f53f2f20a83d6ff028bebbce62/src/rules/extensions.js#L39-L42
That's totally valid handling but not covered by any test case. Moreover, there are two test cases which have the incorrect logic and still succeed: https://github.com/import-js/eslint-plugin-import/blob/a20d84398a7946f53f2f20a83d6ff028bebbce62/tests/src/rules/extensions.js#L701-L718
I would suggest to adjust these test cases to the correct configuration.
I'm a bit confused; what's incorrect in the logic for those two test cases?
I missed that the tests are part of the invalid section. So, you can discard this as mistake on my end.
Thanks for the great project.
I had the following line in my project config:
I was wondering why I still got errors for json file imports.
When digging deeper, I found that the pattern definitions on the main object are ignored in case certain other properties like checkTypeImports are set: https://github.com/import-js/eslint-plugin-import/blob/a20d84398a7946f53f2f20a83d6ff028bebbce62/src/rules/extensions.js#L39-L42
That's totally valid handling but not covered by any test case. Moreover, there are two test cases which have the incorrect logic and still succeed: https://github.com/import-js/eslint-plugin-import/blob/a20d84398a7946f53f2f20a83d6ff028bebbce62/tests/src/rules/extensions.js#L701-L718
I would suggest to adjust these test cases to the correct configuration.