Skip to content

Commit

Permalink
fix: import/no-extraneous-dependencies supports all expected TS files (
Browse files Browse the repository at this point in the history
  • Loading branch information
iamturns committed Feb 6, 2021
1 parent 262c2fd commit 199e4fc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,14 @@ module.exports = {
...baseImportsRules['import/no-extraneous-dependencies'][1],
devDependencies: baseImportsRules[
'import/no-extraneous-dependencies'
][1].devDependencies.map((glob) => glob.replace('js,jsx', 'js,jsx,ts,tsx')),
][1].devDependencies.reduce((result, devDep) => {
const toAppend = [devDep];
const devDepWithTs = devDep.replace(/\bjs(x?)\b/g, 'ts$1');
if (devDepWithTs !== devDep) {
toAppend.push(devDepWithTs);
}
return [...result, ...toAppend];
}, []),
},
],
},
Expand Down

0 comments on commit 199e4fc

Please sign in to comment.