-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheslint.config.js
More file actions
87 lines (84 loc) · 2.26 KB
/
eslint.config.js
File metadata and controls
87 lines (84 loc) · 2.26 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
// ESLint v9+ config for Guardon project
/** @type {import('eslint').Linter.FlatConfig} */
export default [
{
files: ["**/*.{js,cjs,mjs,jsx,ts,tsx}", "!node_modules/**"],
languageOptions: {
ecmaVersion: 2021,
sourceType: "module",
globals: {
// Browser globals
window: "readonly",
document: "readonly",
console: "readonly",
chrome: "readonly",
fetch: "readonly",
URL: "readonly",
FileReader: "readonly",
Blob: "readonly",
navigator: "readonly",
setTimeout: "readonly",
clearTimeout: "readonly",
alert: "readonly",
location: "readonly",
self: "readonly",
localStorage: "readonly",
atob: "readonly",
btoa: "readonly",
Response: "readonly",
WebAssembly: "readonly",
TextEncoder: "readonly",
TextDecoder: "readonly",
// Node / bundler globals used in utils
module: "writable",
require: "readonly",
__dirname: "readonly",
exports: "writable",
define: "readonly",
process: "readonly",
Buffer: "readonly",
YAML_SILENCE_DEPRECATION_WARNINGS: "readonly",
YAML_SILENCE_WARNINGS: "readonly",
// Test globals (Jest)
describe: "readonly",
test: "readonly",
expect: "readonly",
beforeAll: "readonly",
beforeEach: "readonly",
afterAll: "readonly",
afterEach: "readonly",
global: "readonly"
// Project-specific helpers
,form: "readonly",
showToast: "readonly",
editRule: "readonly",
deleteRule: "readonly",
openAPIPreviewBtn: "readonly",
pi: "readonly"
}
},
linterOptions: {
reportUnusedDisableDirectives: true
},
rules: {
"no-unused-vars": "warn",
"no-undef": "error",
"no-console": "warn",
// Keep style rules as warnings so linting doesn't fail the build
// while still surfacing issues in editors.
eqeqeq: "warn",
curly: "warn",
semi: ["warn", "always"],
quotes: ["warn", "double"]
}
},
{
ignores: [
"node_modules/**",
"dist/**",
"coverage/**",
"guardon-v0.4/**",
"src/lib/**"
]
}
];