-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy patheslint.config.js
111 lines (109 loc) · 2.66 KB
/
eslint.config.js
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
99
100
101
102
103
104
105
106
107
108
109
110
111
const jsdoc = require("eslint-plugin-jsdoc");
const preferArrow = require("eslint-plugin-prefer-arrow");
const js = require("@eslint/js");
const eslint = require("@eslint/js");
const globals = require("globals");
const pluginVue = require("eslint-plugin-vue");
const eslintConfigPrettier = require("eslint-config-prettier");
const baseConfig = {
files: ["**/*.js", "**/*.vue"], // Specify the files to lint
ignores: ["**/*.d.ts", "__tests__"], // Specify the files to ignore
languageOptions: {
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.node,
},
},
plugins: {
jsdoc,
preferArrow,
},
rules: {
"vue/no-use-v-if-with-v-for": "off",
indent: [
"error",
"tab",
{
SwitchCase: 1,
ignoredNodes: ["ConditionalExpression"],
},
],
"linebreak-style": ["error", "unix"],
semi: ["error", "always"],
"arrow-parens": ["off", "always"],
"brace-style": ["off", "off"],
complexity: "off",
"constructor-super": "error",
"dot-notation": "off",
eqeqeq: ["error", "smart"],
"guard-for-in": "error",
"id-denylist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined",
],
"id-match": "error",
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "off",
"max-classes-per-file": ["error", 25],
"no-array-constructor": "off",
"no-bitwise": "error",
"no-caller": "error",
"no-cond-assign": "error",
"no-console": "off",
"no-debugger": "error",
"no-empty": "error",
"no-empty-function": "off",
"no-eval": "error",
"no-fallthrough": "off",
"no-implied-eval": "off",
"no-invalid-this": "off",
"no-irregular-whitespace": "off",
"no-loss-of-precision": "off",
"no-new-wrappers": "error",
"no-shadow": "off",
"no-throw-literal": "off",
"no-undef-init": "error",
"no-underscore-dangle": "off",
"no-unsafe-finally": "error",
"no-unused-expressions": "off",
"no-unused-labels": "error",
"no-unused-vars": "off",
"no-use-before-define": "off",
"no-var": "error",
"object-shorthand": "off",
"one-var": ["error", "never"],
"padded-blocks": ["off", { blocks: "never" }, { allowSingleLineBlocks: true }],
"prefer-const": "error",
"require-await": "off",
"space-in-parens": ["off", "never"],
"spaced-comment": ["error", "always", { markers: ["/"] }],
"use-isnan": "error",
"valid-typeof": "off",
},
};
module.exports = [
{
...js.configs.recommended,
...baseConfig,
},
{
...eslint.configs.recommended,
...baseConfig,
},
...pluginVue.configs["flat/vue2-recommended"],
{ ...baseConfig },
{ ...eslintConfigPrettier },
];