Skip to content

Commit 4205f85

Browse files
committed
style: add typescript-eslint
1 parent 9d0c8f3 commit 4205f85

File tree

3 files changed

+772
-13
lines changed

3 files changed

+772
-13
lines changed

eslint.config.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import js from "@eslint/js";
22
import globals from "globals";
33
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
4-
import importPlugin from 'eslint-plugin-import';
4+
import importPlugin from "eslint-plugin-import";
5+
import tseslint from "typescript-eslint";
56

67
export default [
78
js.configs.recommended,
@@ -15,19 +16,29 @@ export default [
1516
...globals.browser,
1617
...globals.node,
1718
...globals.mocha,
18-
}
19+
},
20+
parserOptions: {
21+
projectService: true,
22+
tsconfigRootDir: import.meta.dirname,
23+
},
1924
},
2025
rules: {
2126
"eol-last": "error",
2227
"import/extensions": ["error", "always"],
23-
'import/no-unresolved': 0, // https://github.com/import-js/eslint-plugin-import/issues/3082
28+
"import/no-unresolved": 0, // https://github.com/import-js/eslint-plugin-import/issues/3082
2429
"no-console": "error",
25-
"no-constant-condition": ["error", { "checkLoops": false }],
30+
"no-constant-condition": ["error", { checkLoops: false }],
2631
"no-eval": "error",
2732
"no-implied-eval": "error",
2833
"no-trailing-spaces": "error",
2934
"prefer-const": "error",
30-
"semi": "error"
35+
semi: "error",
3136
},
3237
},
38+
...tseslint.configs.recommendedTypeChecked.map(config => {
39+
return {
40+
files: ["lib/**"],
41+
...config
42+
}
43+
})
3344
];

0 commit comments

Comments
 (0)