-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
.eslintrc.cjs
192 lines (184 loc) · 5.48 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
// SPDX-FileCopyrightText: 2022 Johannes Loher
// SPDX-FileCopyrightText: 2022 David Archibald
//
// SPDX-License-Identifier: MIT
module.exports = {
parserOptions: {
ecmaVersion: 13,
extraFileExtensions: [".cjs", ".mjs"],
sourceType: "module",
},
env: {
browser: true,
es6: true,
jquery: true,
},
extends: ["eslint:recommended", "@typhonjs-fvtt/eslint-config-foundry.js/0.8.0"],
plugins: [],
rules: {
"array-bracket-spacing": ["warn", "never"],
"array-callback-return": "warn",
"arrow-spacing": "warn",
"brace-style": "warn",
"comma-dangle": ["warn", "only-multiline"],
"comma-style": "warn",
"computed-property-spacing": "warn",
"constructor-super": "error",
"default-param-last": "warn",
"dot-location": ["warn", "property"],
"eol-last": ["error", "always"],
eqeqeq: ["warn", "smart"],
"func-call-spacing": "warn",
"func-names": ["warn", "never"],
"getter-return": "warn",
indent: ["warn", "tab", { SwitchCase: 1 }],
"lines-between-class-members": "warn",
"new-parens": ["warn", "always"],
"no-alert": "warn",
"no-array-constructor": "warn",
"no-class-assign": "warn",
"no-compare-neg-zero": "warn",
"no-cond-assign": "warn",
"no-const-assign": "error",
"no-constant-condition": "warn",
"no-constructor-return": "warn",
"no-delete-var": "warn",
"no-dupe-args": "warn",
"no-dupe-class-members": "warn",
"no-dupe-keys": "warn",
"no-duplicate-case": "warn",
"no-duplicate-imports": ["warn", { includeExports: true }],
"no-else-return": "warn",
"no-empty": ["warn", { allowEmptyCatch: true }],
"no-empty-character-class": "warn",
"no-empty-pattern": "warn",
"no-func-assign": "warn",
"no-global-assign": "warn",
"no-implicit-coercion": ["warn", { allow: ["!!"] }],
"no-implied-eval": "warn",
"no-import-assign": "warn",
"no-invalid-regexp": "warn",
"no-irregular-whitespace": "warn",
"no-iterator": "warn",
"no-lone-blocks": "warn",
"no-lonely-if": "warn",
"no-misleading-character-class": "warn",
"no-mixed-operators": "warn",
"no-multi-str": "warn",
"no-multiple-empty-lines": ["warn", { max: 1 }],
"no-new-func": "warn",
"no-new-object": "warn",
"no-new-symbol": "warn",
"no-new-wrappers": "warn",
"no-nonoctal-decimal-escape": "warn",
"no-obj-calls": "warn",
"no-octal": "warn",
"no-octal-escape": "warn",
"no-promise-executor-return": "warn",
"no-proto": "warn",
"no-regex-spaces": "warn",
"no-script-url": "warn",
"no-self-assign": "warn",
"no-self-compare": "warn",
"no-setter-return": "warn",
"no-sequences": "warn",
"no-template-curly-in-string": "warn",
"no-this-before-super": "error",
"no-unexpected-multiline": "warn",
"no-unmodified-loop-condition": "warn",
"no-unneeded-ternary": "warn",
"no-unreachable": "warn",
"no-unreachable-loop": "warn",
"no-unsafe-negation": ["warn", { enforceForOrderingRelations: true }],
"no-unsafe-optional-chaining": ["warn", { disallowArithmeticOperators: true }],
"no-unused-expressions": "warn",
"no-useless-backreference": "warn",
"no-useless-call": "warn",
"no-useless-catch": "warn",
"no-useless-computed-key": ["warn", { enforceForClassMembers: true }],
"no-useless-concat": "warn",
"no-useless-constructor": "warn",
"no-useless-rename": "warn",
"no-useless-return": "warn",
"no-var": "warn",
"no-void": "warn",
"no-whitespace-before-property": "warn",
"prefer-numeric-literals": "warn",
"prefer-object-spread": "warn",
"prefer-regex-literals": "warn",
"prefer-spread": "warn",
"rest-spread-spacing": ["warn", "never"],
"semi-spacing": "warn",
"semi-style": ["warn", "last"],
"space-unary-ops": ["warn", { words: true, nonwords: false }],
"switch-colon-spacing": "warn",
"symbol-description": "warn",
"template-curly-spacing": ["warn", "never"],
"unicode-bom": ["warn", "never"],
"use-isnan": ["warn", { enforceForSwitchCase: true, enforceForIndexOf: true }],
"valid-typeof": ["warn", { requireStringLiterals: true }],
"wrap-iife": ["warn", "inside"],
"arrow-parens": ["warn", "always"],
"comma-spacing": "warn",
"dot-notation": "warn",
"key-spacing": "warn",
"keyword-spacing": ["warn", { overrides: { catch: { before: true, after: false } } }],
"max-len": [
"warn",
{
code: 120,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
"no-extra-boolean-cast": ["warn", { enforceForLogicalOperands: true }],
"no-extra-semi": "warn",
"no-multi-spaces": ["warn", { ignoreEOLComments: true }],
"no-throw-literal": "error",
"no-trailing-spaces": "warn",
"no-useless-escape": "warn",
"no-unused-vars": ["warn", { args: "none" }],
"nonblock-statement-body-position": ["warn", "beside"],
"one-var": ["warn", "never"],
"operator-linebreak": [
"warn",
"before",
{
overrides: { "=": "after", "+=": "after", "-=": "after" },
},
],
"prefer-template": "warn",
"quote-props": ["warn", "as-needed", { keywords: false }],
quotes: ["warn", "double", { avoidEscape: true, allowTemplateLiterals: false }],
semi: "warn",
"space-before-blocks": ["warn", "always"],
"space-before-function-paren": [
"warn",
{
anonymous: "always",
named: "never",
asyncArrow: "always",
},
],
"spaced-comment": "warn",
},
globals: {
globalThis: false,
GURPS: false,
JournalTextPageSheet: false,
ProseMirror: false,
Tour: false,
},
overrides: [
{
files: ["./*.js", "./*.cjs", "./*.mjs"],
env: {
node: true,
},
},
],
};