-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
111 lines (108 loc) · 2.84 KB
/
Copy patheslint.config.js
File metadata and controls
111 lines (108 loc) · 2.84 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
/**
* Eslint config.
*
* Jam-build, a web application practical reference.
* Copyright (c) 2025 Alex Grant <info@localnerve.com> (https://www.localnerve.com), LocalNerve LLC
*
* This file is part of Jam-build.
* Jam-build is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
* Jam-build is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License along with Jam-build.
* If not, see <https://www.gnu.org/licenses/>.
* Additional terms under GNU AGPL version 3 section 7:
* a) The reasonable legal notice of original copyright and author attribution must be preserved
* by including the string: "Copyright (c) 2025 Alex Grant <info@localnerve.com> (https://www.localnerve.com), LocalNerve LLC"
* in this material, copies, or source code of derived works.
*/
import js from '@eslint/js';
import compat from "eslint-plugin-compat";
import playwright from 'eslint-plugin-playwright';
import globals from 'globals';
const commonRules = {
...js.configs.recommended.rules,
'no-console': 'warn',
'no-param-reassign': 'error',
'space-before-function-paren': ['error', {
'anonymous': 'always',
'named': 'always',
'asyncArrow': 'always'
}],
indent: [2, 2, {
SwitchCase: 1,
MemberExpression: 1
}],
quotes: [2, 'single'],
'dot-notation': [2, { allowKeywords: true }],
'linebreak-style': [
'error',
'unix'
],
semi: [
'error',
'always'
]
};
const compatConfig = compat.configs["flat/recommended"];
compatConfig.rules = { ...compatConfig.rules, ...commonRules };
export default [{
name: 'global',
ignores: [
'**/tmp/**',
'node_modules/**',
'dist/**',
'overrides/**',
'docs/**',
'coverage/**',
'test-results/**'
]
}, {
name: 'app-client',
files: ['src/application/client/**/*.js'],
...compatConfig
}, {
name: 'app-sw',
files: [
'src/application/client/sw/**'
],
languageOptions: {
globals: {
...globals.serviceworker
}
},
rules: {
...commonRules
}
}, {
name: 'node-build-and-app',
files: [
'src/build/**',
'src/application/server/**/*.js'
],
languageOptions: {
globals: {
...globals.node
}
},
rules: {
...commonRules
}
}, {
name: 'test',
...playwright.configs['flat/recommended'],
files: [
'src/test/**/*.test.js'
],
languageOptions: {
globals: {
...globals.node
}
},
rules: {
...playwright.configs['flat/recommended'].rules,
...commonRules
}
}];