Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit 199e4fc

Browse files
authored
fix: import/no-extraneous-dependencies supports all expected TS files (#190)
1 parent 262c2fd commit 199e4fc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/shared.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,14 @@ module.exports = {
208208
...baseImportsRules['import/no-extraneous-dependencies'][1],
209209
devDependencies: baseImportsRules[
210210
'import/no-extraneous-dependencies'
211-
][1].devDependencies.map((glob) => glob.replace('js,jsx', 'js,jsx,ts,tsx')),
211+
][1].devDependencies.reduce((result, devDep) => {
212+
const toAppend = [devDep];
213+
const devDepWithTs = devDep.replace(/\bjs(x?)\b/g, 'ts$1');
214+
if (devDepWithTs !== devDep) {
215+
toAppend.push(devDepWithTs);
216+
}
217+
return [...result, ...toAppend];
218+
}, []),
212219
},
213220
],
214221
},

0 commit comments

Comments
 (0)