-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
146 lines (145 loc) · 3.54 KB
/
Copy patheslint.config.mjs
File metadata and controls
146 lines (145 loc) · 3.54 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
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
import js from '@eslint/js';
import css from '@eslint/css';
// import importResolver from 'eslint-import-resolver-node';
import importPlugin from 'eslint-plugin-import';
import '@underscript/eslint-config';
import { defineConfig } from '@eslint/config-helpers';
import globals from 'globals';
export default defineConfig([
{
files: ['**/*.js'],
plugins: {
importPlugin,
js,
},
extends: [
// '@underscript',
js.configs.recommended,
importPlugin.flatConfigs.recommended,
],
ignores: [
'/public/resources/modules/3rdparty/*',
'./scripts/*',
],
languageOptions: {
ecmaVersion: 2025,
globals: {
...globals.browser,
...globals.es2021,
},
sourceType: 'module',
},
rules: {
'import/no-mutable-exports': 'warn',
'import/extensions': ['error', 'ignorePackages'],
'import/no-unresolved': ['error', {
ignore: [
'^http',
],
}],
camelcase: ['warn', {
ignoreGlobals: true,
}],
'lines-between-class-members': ['error', 'always', {
exceptAfterSingleLine: true,
}],
'max-len': ['error', {
code: 120,
ignoreComments: true,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
tabWidth: 2,
}],
'no-bitwise': 'off',
'no-console': ['error', {
allow: ['dir', 'error'],
}],
'no-continue': 'off',
'no-mixed-operators': 'off',
// Allow modification of properties
'no-param-reassign': ['error', {
props: false,
}],
// Allow for loops to use unary (++/--)
'no-plusplus': ['warn', {
allowForLoopAfterthoughts: true,
}],
'no-restricted-globals': ['error', ''],
'no-shadow': ['error', {
ignoreOnInitialization: true,
}],
// Allow short circuits: test && action
'no-unused-expressions': ['error', {
allowShortCircuit: true,
}],
// Allow function arguments to be unused
'no-unused-vars': ['error', {
args: 'none',
}],
// Allow functions to be defined after references (functions are top-level)
'no-use-before-define': ['error', 'nofunc'],
'object-curly-newline': ['error', {
multiline: true,
consistent: true,
}],
'operator-linebreak': ['error', 'after'],
'prefer-arrow-callback': ['error', {
allowNamedFunctions: true,
}],
// Deconstruction not required when assigning to object properties (declared_var = object.key)
'prefer-destructuring': ['error', {
AssignmentExpression: {
array: true,
object: false,
},
}],
quotes: ['error', 'single', {
allowTemplateLiterals: true,
avoidEscape: true,
}],
semi: 'error',
'no-underscore-dangle': ['error', {
allow: [
'_oldValue',
'_tippy',
],
}],
},
},
{
files: ['./eslint.config.js'],
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.node,
},
},
},
{
files: ['./public/service-worker.js'],
languageOptions: {
globals: {
...globals.serviceworker,
workbox: 'readonly',
},
},
},
{
files: ['**/*.css'],
plugins: {
css,
},
language: 'css/css',
// extends: ['css/recommended'],
rules: {},
},
{
files: ['./scripts/*.js'],
languageOptions: {
globals: {
...globals.node,
},
},
},
]);