forked from zaproxy/zaproxy-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
90 lines (82 loc) · 2.5 KB
/
Copy patheslint.config.mjs
File metadata and controls
90 lines (82 loc) · 2.5 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
89
90
import { defineConfig } from "eslint/config";
import importPlugin from "eslint-plugin-import";
import globals from "globals";
export default defineConfig([
{
ignores: ["dist/**", "node_modules/**", ".github/**"],
},
{
files: ["src/**/*.js"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.browser,
__dirname: "readonly",
require: "readonly",
process: "readonly",
ENV: "readonly",
module: "readonly",
ga: "readonly",
},
},
plugins: {
import: importPlugin,
},
rules: {
// Possible Errors
"no-control-regex": "error",
"no-console": "warn",
"no-debugger": "error",
"no-dupe-args": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty-character-class": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "warn",
"no-proto": "error",
"no-unexpected-multiline": "error",
"no-unreachable": "error",
"valid-typeof": "error",
// Best Practices
"no-fallthrough": "error",
"no-redeclare": "error",
// Stylistic Issues
"comma-spacing": "error",
"eol-last": "error",
eqeqeq: ["error", "smart"],
indent: ["error", 2, { SwitchCase: 1 }],
"keyword-spacing": "error",
"max-len": ["warn", 160, 2],
"new-parens": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multiple-empty-lines": ["error", { max: 2 }],
"no-trailing-spaces": "error",
"object-curly-spacing": ["error", "never"],
quotes: ["error", "double", { avoidEscape: true }],
semi: "error",
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["error", "never"],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"space-unary-ops": "error",
// ECMAScript 6
"arrow-parens": ["error", "always"],
"arrow-spacing": ["error", { before: true, after: true }],
"no-confusing-arrow": "error",
"prefer-const": "error",
// JSX
"jsx-quotes": ["error", "prefer-double"],
// Import
"import/no-unresolved": ["warn", { commonjs: true, amd: true }],
"import/export": "error",
// Strict Mode
strict: ["error", "global"],
// Variables
"no-undef": "error",
"no-unused-vars": ["error", { args: "none" }],
},
},
]);