-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
92 lines (91 loc) · 3.11 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
import js from "@eslint/js";
import globals from "globals";
import html from "eslint-plugin-html";
export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2020,
globals: {
...globals.browser,
RapidContext: "readonly",
},
},
rules: {
"array-bracket-spacing": ["error", "never"],
"brace-style": ["error", "1tbs"],
"camelcase": ["error", { "properties": "never" }],
"comma-spacing": "error",
"comma-style": "error",
"complexity": ["error", 25],
"consistent-return": "error",
"curly": ["error", "all"],
"eol-last": "error",
"func-call-spacing": "error",
"indent": ["error", 4],
"key-spacing": "error",
"keyword-spacing": "error",
"linebreak-style": ["error", "unix"],
"max-depth": ["error", 4],
"max-len": ["error", { "code": 120 }],
"max-params": ["error", 7],
"new-cap": ["error", { "capIsNew": false }],
"no-array-constructor": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-extend-native": "error",
"no-multi-spaces": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-prototype-builtins": "error",
"no-redeclare": ["error", { "builtinGlobals": false }],
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-unused-vars": ["error", { "args": "none", "caughtErrors": "none" }],
"no-useless-return": "error",
"no-with": "error",
"object-curly-newline": ["error", { "consistent": true }],
"object-curly-spacing": ["error", "always"],
"operator-linebreak": "error",
"prefer-promise-reject-errors": "error",
"quotes": ["error", "double"],
"semi": ["error", "always"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", { "named": "never" }],
"space-infix-ops": "error",
"wrap-iife": ["error", "inside"]
},
},
{
files: ["src/plugin/**/*.{js,cjs}", "test/src/js/**/*.{js,cjs}"],
languageOptions: {
ecmaVersion: 2020,
globals: {
...globals.browser,
$: "readonly",
CryptoJS: "readonly",
MochiKit: "readonly",
RapidContext: "writable",
},
},
},
{
files: ["src/plugin/**/*.mjs", "test/src/js/**/*.mjs"],
languageOptions: {
sourceType: "module",
},
rules: {
"quotes": ["error", "single"]
}
},
{
files: ["src/plugin/**/*.{html,tmpl}"],
plugins: { html },
settings: {
"html/html-extensions": [".html", ".tmpl"]
},
},
];