Skip to content

Commit 53fa239

Browse files
committed
feat: better eslint
1 parent 7ff9baa commit 53fa239

File tree

1 file changed

+33
-50
lines changed

1 file changed

+33
-50
lines changed

eslint.config.js

Lines changed: 33 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,18 @@ import jsLint from "@eslint/js"
22
import stylistic from "@stylistic/eslint-plugin"
33
import globals from "globals"
44
import tsLint from "typescript-eslint"
5-
// const __filename = fileURLToPath(import.meta.url);
6-
// const __dirname = path.dirname(__filename);
7-
// const compat = new FlatCompat({
8-
// baseDirectory: __dirname,
9-
// recommendedConfig: js.configs.recommended,
10-
// allConfig: js.configs.all
11-
// });
125

136
export default [
147
// config parsers
158
{
16-
files: ["src/*.{js,mjs,cjs,ts,mts,jsx,tsx}"]
17-
},
18-
19-
{
20-
files: ["tests/*.{js,mjs,cjs,ts,mts,jsx,tsx}"],
21-
languageOptions: {
22-
globals: {
23-
...globals.browser,
24-
...globals.node,
25-
...globals.mocha,
26-
...globals.jest
27-
}
28-
}
29-
},
30-
// config envs
31-
{
9+
files: ["src/*.{js,mjs,cjs,ts,mts,jsx,tsx}"],
3210
languageOptions: {
3311
globals: {
3412
...globals.browser, ...globals.node
3513
}
3614
}
3715
},
16+
3817
// syntax rules
3918
jsLint.configs.recommended,
4019
...tsLint.configs.recommended,
@@ -47,32 +26,36 @@ export default [
4726
quotes: "double",
4827
semi: false,
4928
commaDangle: "never"
50-
})
51-
// {
52-
// ignores: [
53-
// "**/node_modules/",
54-
// "**/dist/",
55-
// "**/lib_cjs/",
56-
// "**/lib_es/",
57-
// "**/exampless/",
58-
// ],
59-
// },
60-
// ...compat.extends(
61-
// "eslint:recommended",
62-
// "plugin:@typescript-eslint/recommended",
63-
// ), {
64-
// plugins: {
65-
// "@typescript-eslint": typescriptEslint,
66-
// },
29+
}),
30+
{
31+
ignores: [
32+
"**/node_modules/",
33+
"**/coverage/",
34+
"**/dist/",
35+
"**/docs/",
36+
"**/examples/",
37+
"**/lib_cjs/",
38+
"**/lib_es/"
39+
]
40+
},
41+
{
42+
rules: {
43+
// "@typescript-eslint/no-explicit-any": "off"
44+
}
45+
},
46+
{
47+
files: ["tests/*.{js,mjs,cjs,ts,mts,jsx,tsx}"],
48+
languageOptions: {
49+
globals: {
50+
...globals.browser,
51+
...globals.node,
52+
...globals.mocha,
53+
...globals.jest
54+
}
55+
},
6756

68-
// rules: {
69-
// "no-undef": "error",
70-
// "no-var": "error",
71-
// "prefer-const": "error",
72-
// "no-const-assign": "error",
73-
// "one-var": ["error", "never"],
74-
// "sort-imports": "off",
75-
// "no-control-regex": "off",
76-
// },
77-
// }
57+
rules: {
58+
"@typescript-eslint/no-explicit-any": "off"
59+
}
60+
}
7861
]

0 commit comments

Comments
 (0)