-
Notifications
You must be signed in to change notification settings - Fork 6
/
.eslintrc.cjs
104 lines (100 loc) · 2.64 KB
/
.eslintrc.cjs
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
/* eslint-env node */
const { defineConfig } = require("eslint-define-config");
/** @type EslintConfig */
const config = defineConfig({
root: true,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
impliedStrict: true,
},
env: {
browser: true,
},
plugins: [],
extends: ["eslint:recommended"],
overrides: [],
rules: {
eqeqeq: "warn",
"use-isnan": ["error", { enforceForIndexOf: true }],
"no-unused-expressions": [
"warn",
{ allowShortCircuit: true, allowTernary: true },
],
"no-mixed-operators": ["warn", { allowSamePrecedence: false }],
"no-unneeded-ternary": ["warn", { defaultAssignment: false }],
"prefer-regex-literals": ["warn", { disallowRedundantWrapping: true }],
"wrap-iife": ["warn", "inside", { functionPrototypeMethods: true }],
"comma-dangle": [
"warn",
{
arrays: "always-multiline",
objects: "always-multiline",
imports: "ignore",
exports: "ignore",
functions: "ignore",
},
],
"no-extra-parens": [
"warn",
"all",
{
enforceForSequenceExpressions: false,
returnAssign: false,
enforceForArrowConditionals: false,
conditionalAssign: false,
nestedBinaryExpressions: false,
enforceForNewInMemberExpressions: false,
enforceForFunctionPrototypeMethods: false,
},
],
"comma-style": "error",
"new-parens": "error",
"no-const-assign": "error",
"no-label-var": "error",
"no-use-before-define": [
"error",
{
functions: false,
classes: true,
variables: true,
allowNamedExports: true,
},
],
"arrow-parens": ["warn", "as-needed"],
"no-throw-literal": "warn",
"arrow-spacing": "warn",
"comma-spacing": "warn",
"dot-location": ["warn", "property"],
"dot-notation": "warn",
"no-cond-assign": "warn",
"no-constant-condition": "warn",
"no-else-return": "warn",
"no-eval": "warn",
"no-extra-bind": "warn",
"no-extra-label": "warn",
"no-fallthrough": "warn",
"no-implied-eval": "warn",
"no-lone-blocks": "warn",
"no-lonely-if": "warn",
"no-loop-func": "warn",
"no-negated-condition": "warn",
"no-self-compare": "warn",
"no-sparse-arrays": "warn",
"no-unmodified-loop-condition": "warn",
"no-unreachable-loop": "warn",
"no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"no-useless-computed-key": "warn",
"no-useless-concat": "warn",
"no-useless-constructor": "warn",
"no-useless-escape": "warn",
"no-var": "warn",
"no-with": "warn",
"operator-assignment": "warn",
"prefer-const": "warn",
"prefer-exponentiation-operator": "warn",
"no-mixed-spaces-and-tabs": ["warn", "smart-tabs"],
},
ignorePatterns: ["dist", "**/*.d.ts", "node_modules"],
});
module.exports = config;