-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
eslint.config.mjs
90 lines (87 loc) · 3.2 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
import noJquery from 'eslint-plugin-no-jquery';
import ts_eslint from 'typescript-eslint';
import eslint from "@eslint/js";
import globals from "globals";
import google_eslint from "eslint-config-google";
import jest_eslint from "eslint-plugin-jest"
import stylistic from "@stylistic/eslint-plugin";
import { FlatCompat } from "@eslint/eslintrc";
const compat = new FlatCompat();
export default ts_eslint.config(
eslint.configs.recommended,
...ts_eslint.configs.recommended,
google_eslint,
...compat.extends( // old eslintrc style configs, converted to new style by the compat object
"plugin:no-jquery/all",
"plugin:wc/recommended",
"plugin:lit/recommended",
),
{
plugins: {
"no-jquery": noJquery,
"@stylistic": stylistic,
},
languageOptions: {
globals: {
...globals.browser,
...globals.es2020,
...globals.jest,
d3: "readonly",
dodona: "readonly"
},
},
rules: {
"arrow-parens": ["error", "as-needed"],
"comma-dangle": ["error", {
"arrays": "only-multiline",
"objects": "only-multiline",
"imports": "only-multiline",
"exports": "only-multiline",
"functions": "never"
}],
"indent": "off",
"max-len": "off",
"no-invalid-this": "warn",
"no-param-reassign": ["error", { "props": false }],
"object-curly-spacing": ["error", "always"],
"quotes": ["error", "double", { "allowTemplateLiterals": true }],
"require-jsdoc": "off",
"valid-jsdoc": "off",
"space-before-function-paren": [
"error",
{ "anonymous": "always", "named": "never", "asyncArrow": "always" }
],
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-function-return-type": [
"error",
{ "allowExpressions": true }
],
"@typescript-eslint/no-parameter-properties": "off",
"@stylistic/indent": [
"error",
4,
{
"ignoredNodes": [
"FunctionExpression > .params[decorators.length > 0]",
"FunctionExpression > .params > :matches(Decorator, :not(:first-child))",
"ClassBody.body > PropertyDefinition[decorators.length > 0] > .key",
"TSTypeParameterInstantiation",
"PropertyDefinition"
]
}
],
"@typescript-eslint/no-unused-vars": "warn",
"no-unused-vars": "warn",
},
},{
ignores: [
"app/assets/config/manifest.js",
"app/assets/javascripts/i18n/translations.js",
"app/assets/javascripts/types/index.d.ts",
"app/assets/javascripts/inputServiceWorker.js",
]
}, {
files: ['test/**'],
...jest_eslint.configs['flat/recommended'],
}
);