Skip to content

Commit 9530fc0

Browse files
committed
chore: improve the linting quality
1 parent a1a073b commit 9530fc0

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

eslint.config.mjs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,44 @@ import tseslint from "typescript-eslint";
44
const opts = tseslint.config(
55
eslint.configs.recommended,
66
// ...tseslint.configs.recommended,
7-
...tseslint.configs.strict,
8-
...tseslint.configs.stylistic,
7+
// ...tseslint.configs.strict,
8+
// ...tseslint.configs.stylistic,
9+
...tseslint.configs.strictTypeChecked,
10+
...tseslint.configs.stylisticTypeChecked,
11+
...tseslint.configs.recommendedTypeChecked,
12+
{
13+
languageOptions: {
14+
parserOptions: {
15+
project: './tsconfig.json',
16+
// projectService: true,
17+
tsconfigRootDir: import.meta.dirname,
18+
},
19+
},
20+
},
921
{
1022
ignores: [
1123
"babel.config.cjs",
24+
"prettier.config.js",
1225
"jest.config.js",
26+
"setup.*.js",
27+
"to-esm.js",
28+
"vitest.*.ts",
1329
"**/dist/",
30+
"dist/**",
1431
"**/pubdir/",
1532
"**/node_modules/",
1633
"**/scripts/",
1734
"**/examples/",
1835
"scripts/",
36+
"coverage/",
1937
"smoke/react/",
2038
"src/missingTypes/lib.deno.d.ts",
2139
],
2240
},
41+
{
42+
files: ['**/*.js'],
43+
extends: [tseslint.configs.disableTypeChecked],
44+
},
2345
{
2446
rules: {
2547
"no-console": ["warn"],
@@ -28,6 +50,7 @@ const opts = tseslint.config(
2850
{
2951
rules: {
3052
"no-restricted-globals": ["error", "URL", "TextDecoder", "TextEncoder"],
53+
"@typescript-eslint/prefer-readonly": ["error"],
3154
},
3255
},
3356
);

tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,19 @@
113113
"skipLibCheck": true /* Skip type checking all .d.ts files. */
114114
},
115115
"include": ["src/**/*", "tests/**/*"],
116+
"exclude": [
117+
"babel.config.cjs",
118+
"jest.config.js",
119+
"dist/",
120+
"**/pubdir/",
121+
"node_modules/",
122+
"**/scripts/",
123+
"**/examples/",
124+
"scripts/",
125+
"coverage/",
126+
"smoke/react/",
127+
"src/missingTypes/lib.deno.d.ts"
128+
],
116129
"typeRoots": ["ts-types", "node_modules/@types"],
117130
"ts-node": {
118131
"compilerOptions": {

0 commit comments

Comments
 (0)