-
Notifications
You must be signed in to change notification settings - Fork 837
Expand file tree
/
Copy patheslint.config.mjs
More file actions
88 lines (85 loc) · 2.59 KB
/
eslint.config.mjs
File metadata and controls
88 lines (85 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin'
export default tseslint.config({
plugins: {
'@stylistic': stylistic
},
files: ['**/*.ts'],
extends: [
eslint.configs.recommended,
tseslint.configs.recommended
],
rules: {
"@stylistic/comma-dangle": ["error", "only-multiline"],
"@stylistic/indent": ["error", "tab", { "SwitchCase": 1, "ImportDeclaration": 1 }],
"@stylistic/no-tabs": ["error", { allowIndentationTabs: true }],
"@stylistic/quotes": ["error", "single"],
"@stylistic/semi": ["error", "never"],
"no-lone-blocks": 0,
},
});
/*
export defineConfig([
{
files: ["src/*.ts"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: ['./tsconfig.json'], // enables “typed” rules
},
},
...tseslint.configs.recommendedTypeChecked[0], // base + type‑aware rules
rules: {
"no-unused-vars": "warn",
"no-undef": "warn",
"@typescript-eslint/indent": ["error", "tab"],
"@typescript-eslint/prefer-nullish-coalescing": 0, // "warn", too many items!
"@typescript-eslint/restrict-plus-operands": "warn", // TODO: "error"
"@typescript-eslint/restrict-template-expressions": "warn", // TODO: "error"
"@typescript-eslint/strict-boolean-expressions": "off",
"comma-dangle": ["error", "only-multiline"],
"no-lone-blocks": 0,
"no-tabs": ["error", { allowIndentationTabs: true }],
indent: ["error", "tab", { "SwitchCase": 1, "ImportDeclaration": 1 }],
quotes: ["error", "single"],
semi: ["error", "never"],
},
},
]);
*/
/*
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
"plugin:react/recommended",
"standard-with-typescript",
"plugin:@typescript-eslint/recommended",
],
overrides: [],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.json"],
},
plugins: ["react", "@typescript-eslint"],
ignorePatterns: [".eslintrc.js", "*.mjs", "demos/*", "index.d.ts", "gulpfile.js"],
rules: {
"@typescript-eslint/indent": ["error", "tab"],
"@typescript-eslint/prefer-nullish-coalescing": 0, // "warn", too many items!
"@typescript-eslint/restrict-plus-operands": "warn", // TODO: "error"
"@typescript-eslint/restrict-template-expressions": "warn", // TODO: "error"
"@typescript-eslint/strict-boolean-expressions": 0,
"comma-dangle": ["error", "only-multiline"],
"no-lone-blocks": 0,
"no-tabs": ["error", { allowIndentationTabs: true }],
indent: ["error", "tab", { "SwitchCase": 1, "ImportDeclaration": 1 }],
quotes: ["error", "single"],
semi: ["error", "never"],
},
};
*/