-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patheslint.config.mjs
98 lines (95 loc) · 3.24 KB
/
eslint.config.mjs
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
89
90
91
92
93
94
95
96
97
98
import eslint from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import sonarjs from "eslint-plugin-sonarjs";
import pluginVue from 'eslint-plugin-vue';
import vueParser from "vue-eslint-parser";
import eslintConfigPrettier from "eslint-config-prettier";
export default [
{
files: ["src/**/*.{vue,ts}"],
},
{
ignores: ["**/*js", "functions"]
},
eslint.configs.all,
...tseslint.configs.strict,
...pluginVue.configs['flat/strongly-recommended'],
sonarjs.configs.recommended,
{
plugins: {
'typescript-eslint': tseslint.plugin,
},
languageOptions: {
globals: globals.browser,
parserOptions: {
parser: tseslint.parser,
project: './tsconfig.json',
extraFileExtensions: ['.vue'],
sourceType: 'module',
},
},
},
{
rules: {
indent: ["error", 2],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^__",
varsIgnorePattern: "^__",
},
],
"@typescript-eslint/no-explicit-any": "error",
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
"capitalized-comments": "off",
"no-unreachable": "error",
"one-var": "off",
"no-undefined": "off",
"sort-keys": "off",
"sort-vars": "off",
"sort-imports": "off",
"no-magic-numbers": "off",
"vue/no-unused-vars": "error",
"vue/no-reserved-component-names": "error",
"vue/multi-word-component-names": "off",
"sonarjs/cognitive-complexity": "error",
"sonarjs/elseif-without-else": "error",
"sonarjs/max-switch-cases": "error",
"sonarjs/no-all-duplicated-branches": "error",
"sonarjs/no-collapsible-if": "error",
"sonarjs/no-collection-size-mischeck": "error",
"sonarjs/no-duplicate-string": "error",
"sonarjs/no-duplicated-branches": "error",
"sonarjs/no-element-overwrite": "error",
"sonarjs/no-empty-collection": "error",
"sonarjs/no-extra-arguments": "error",
"sonarjs/no-gratuitous-expressions": "error",
"sonarjs/no-identical-conditions": "error",
"sonarjs/no-identical-expressions": "error",
"sonarjs/no-identical-functions": "error",
"sonarjs/no-ignored-return": "error",
"sonarjs/no-inverted-boolean-check": "error",
"sonarjs/no-nested-switch": "error",
"sonarjs/no-nested-template-literals": "error",
"sonarjs/no-one-iteration-loop": "error",
"sonarjs/no-redundant-boolean": "error",
"sonarjs/no-redundant-jump": "error",
"sonarjs/no-same-line-conditional": "error",
"sonarjs/no-small-switch": "error",
"sonarjs/no-unused-collection": "error",
"sonarjs/no-use-of-empty-return-value": "error",
"sonarjs/no-useless-catch": "error",
"sonarjs/non-existent-operator": "error",
"sonarjs/prefer-immediate-return": "error",
"sonarjs/prefer-object-literal": "error",
"sonarjs/prefer-single-boolean-return": "error",
"sonarjs/prefer-while": "error",
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
},
eslintConfigPrettier,
];