Skip to content

Commit

Permalink
[Tests] eslint-import-resolver-typescript@1.0.2 doesn't resolve .js
Browse files Browse the repository at this point in the history
  • Loading branch information
jablko committed Sep 21, 2021
1 parent 47e9c89 commit 6e6e932
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/src/rules/no-extraneous-dependencies.js
Expand Up @@ -383,29 +383,23 @@ describe('TypeScript', () => {
// Type-only imports were added in TypeScript ESTree 2.23.0
.filter((parser) => parser !== require.resolve('typescript-eslint-parser'))
.forEach((parser) => {
const parserConfig = {
parser,
settings: {
'import/parsers': { [parser]: ['.ts'] },
'import/resolver': { 'eslint-import-resolver-typescript': true },
},
};

ruleTester.run('no-extraneous-dependencies', rule, {
valid: [
test(Object.assign({
test({
code: 'import type T from "a";',
options: [{ packageDir: packageDirWithTypescriptDevDependencies, devDependencies: false }],
}, parserConfig)),
parser,
}),
],
invalid: [
test(Object.assign({
test({
code: 'import T from "a";',
options: [{ packageDir: packageDirWithTypescriptDevDependencies, devDependencies: false }],
errors: [{
message: "'a' should be listed in the project's dependencies, not devDependencies.",
}],
}, parserConfig)),
parser,
}),
],
});
});
Expand Down

0 comments on commit 6e6e932

Please sign in to comment.