Skip to content

Commit 6e65ef9

Browse files
committed
chore(eslint): configure NodeNext TS resolver; drop inline suppressions
test: remove unused 'compiler' assignments in skipped watch-mode tests - Add eslint-import-resolver-typescript and resolver settings - Remove per-line import/no-unresolved disables in src/{index,hooks}.ts - Update watch-mode and import-update tests to not assign to undeclared 'compiler'
1 parent 48c5736 commit 6e65ef9

File tree

7 files changed

+409
-15
lines changed

7 files changed

+409
-15
lines changed

.eslintrc.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,16 @@ module.exports = {
33
parserOptions: {
44
project: ["./tsconfig.eslint.json"],
55
tsconfigRootDir: __dirname,
6+
},
7+
settings: {
8+
// Resolve ESM-style .js specifiers to TypeScript source under NodeNext
9+
'import/resolver': {
10+
typescript: {
11+
project: './tsconfig.eslint.json'
12+
},
13+
node: {
14+
extensions: ['.js', '.ts', '.d.ts']
15+
}
16+
}
617
}
718
};

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"webpack-sources": "^2.2.0"
4747
},
4848
"devDependencies": {
49-
"eslint": "8.57.0",
5049
"@commitlint/cli": "^13.1.0",
5150
"@commitlint/config-conventional": "^13.1.0",
5251
"@svgr/webpack": "^5.4.0",
@@ -56,7 +55,9 @@
5655
"@wordpress/dependency-extraction-webpack-plugin": "^3.1.0",
5756
"copy-webpack-plugin": "^6.2.1",
5857
"del": "^6.0.0",
58+
"eslint": "8.57.0",
5959
"eslint-config-shellscape": "^6.0.0",
60+
"eslint-import-resolver-typescript": "^4.4.4",
6061
"file-loader": "^6.2.0",
6162
"husky": "8.0.2",
6263
"lint-staged": "11.1.1",
@@ -72,13 +73,11 @@
7273
"webpack": "^5.75.0",
7374
"webpack-merge": "^5.8.0"
7475
},
75-
7676
"husky": {
7777
"hooks": {
7878
"pre-commit": "lint-staged"
7979
}
8080
},
81-
8281
"lint-staged": {
8382
"*.js": [
8483
"eslint --fix"
@@ -87,6 +86,5 @@
8786
"maintainers": [
8887
"Andrew Powell <andrew@shellscape.org>"
8988
],
90-
9189
"pre-commit": "lint-staged"
9290
}

0 commit comments

Comments
 (0)