[import/extensions] Test code: checkTypeImports must not be part of the pattern definition
tobbexiv opened this issue · 2 comments
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:
eslint-plugin-import/src/rules/extensions.js
Lines 39 to 42 in a20d843
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:
eslint-plugin-import/tests/src/rules/extensions.js
Lines 701 to 718 in a20d843
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.