-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy patheslint.config.js
More file actions
116 lines (115 loc) · 3.82 KB
/
eslint.config.js
File metadata and controls
116 lines (115 loc) · 3.82 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
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
import css from "@eslint/css";
import { defineConfig } from "eslint/config";
import globals from "globals";
import { flatConfigs as importX } from "eslint-plugin-import-x";
import js from "@eslint/js";
import json from "@eslint/json";
import markdown from "@eslint/markdown";
import packageJson from "eslint-plugin-package-json";
import stylistic from "@stylistic/eslint-plugin";
import tseslint from "typescript-eslint";
export default defineConfig([
{
ignores: [
"fixtures/**",
"modules/*",
"modules_temp/*",
"website/data/modules*.json",
"website/fonts/*",
"website/result.html",
"website/result.md",
"website/test/3rd-Party-Modules.md"
]
},
{
files: ["**/*.css"],
languageOptions: { tolerant: true },
plugins: { css },
language: "css/css",
extends: ["css/recommended"],
rules: {
"css/no-important": "off",
"css/no-invalid-properties": "off",
"css/use-baseline": ["error", { available: "newly" }]
}
},
{
files: ["**/*.js"],
languageOptions: {
ecmaVersion: "latest",
globals: {
...globals.browser
}
},
plugins: { js, stylistic },
extends: [importX.recommended, "js/all", stylistic.configs.customize({ indent: "tab", quotes: "double", semi: true, commaDangle: "never" })],
rules: {
"@stylistic/array-element-newline": ["error", "consistent"],
"@stylistic/dot-location": ["error", "property"],
"@stylistic/function-call-argument-newline": ["error", "consistent"],
"@stylistic/implicit-arrow-linebreak": "off",
"@stylistic/indent": ["error", 2],
"@stylistic/multiline-ternary": "off",
"@stylistic/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
"@stylistic/padded-blocks": ["error", "never"],
"@stylistic/quote-props": ["error", "as-needed"],
camelcase: "off",
complexity: "off",
"default-case": "off",
"func-style": "off",
"id-length": ["error", { exceptions: ["a", "b"] }],
"import-x/no-unresolved": ["error", { ignore: ["eslint/config", "logger"] }],
"init-declarations": "off",
"max-depth": ["warn", 5],
"max-lines": ["warn", 500],
"max-lines-per-function": ["warn", 150],
"max-params": ["warn", 5],
"max-statements": ["warn", 60],
"no-await-in-loop": "off",
"no-console": "off",
"no-inline-comments": "off",
"no-magic-numbers": "off",
"no-param-reassign": "off",
"no-ternary": "off",
"no-use-before-define": "off",
"one-var": "off",
"prefer-destructuring": "off",
"prefer-named-capture-group": "off",
"require-atomic-updates": "off",
"sort-keys": "off"
}
},
{
files: ["**/*.ts"],
languageOptions: {
ecmaVersion: "latest",
globals: {
...globals.node
},
parser: tseslint.parser,
parserOptions: {
projectService: true
}
},
plugins: {
"@typescript-eslint": tseslint.plugin,
"@stylistic": stylistic
},
rules: {
...tseslint.configs.recommended.rules,
...tseslint.configs.stylistic.rules,
"@typescript-eslint/no-explicit-any": "warn"
}
},
{
files: ["pipeline/workers/**/*.js"],
rules: {
"max-lines": ["warn", 900],
"max-lines-per-function": ["warn", 200],
"max-depth": ["warn", 6]
}
},
{ files: ["**/*.json"], ignores: ["package.json", "package-lock.json"], plugins: { json }, extends: ["json/recommended"], language: "json/json" },
{ files: ["package.json"], plugins: { packageJson }, extends: ["packageJson/recommended"], rules: { "package-json/sort-collections": "off", "package-json/require-files": "off", "package-json/require-sideEffects": "off" } },
{ files: ["**/*.md"], plugins: { markdown }, language: "markdown/gfm", extends: ["markdown/recommended"] }
]);