-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
127 lines (124 loc) · 3.48 KB
/
Copy patheslint.config.mjs
File metadata and controls
127 lines (124 loc) · 3.48 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
import js from "@eslint/js";
import tseslint from "typescript-eslint";
const NODE_GLOBALS = {
require: "readonly",
module: "readonly",
exports: "readonly",
__dirname: "readonly",
__filename: "readonly",
console: "readonly",
process: "readonly",
Buffer: "readonly",
setTimeout: "readonly",
clearTimeout: "readonly",
setInterval: "readonly",
clearInterval: "readonly",
setImmediate: "readonly",
URL: "readonly",
};
const BROWSER_GLOBALS = {
window: "readonly",
document: "readonly",
navigator: "readonly",
setTimeout: "readonly",
clearTimeout: "readonly",
requestAnimationFrame: "readonly",
cancelAnimationFrame: "readonly",
IntersectionObserver: "readonly",
ResizeObserver: "readonly",
MutationObserver: "readonly",
};
export default [
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ["packages/core/src/**/*.ts"],
rules: {
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
},
},
{
// Node.js scripts (build, packaging, smoke tests) — CommonJS or ESM
files: [
"scripts/**/*.{js,mjs,cjs}",
"plugins/photoshop/scripts/**/*.{js,mjs,cjs}",
"tests/e2e/**/*.{js,mjs,cjs}",
],
languageOptions: {
globals: NODE_GLOBALS,
sourceType: "module",
},
rules: {
"no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" }],
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-unused-vars": "off",
},
},
{
// Static-site scripts loaded directly into browser
files: ["web/**/*.js"],
languageOptions: {
globals: BROWSER_GLOBALS,
sourceType: "script",
},
rules: {
"no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
"@typescript-eslint/no-unused-vars": "off",
},
},
{
// Vite/Playwright config files — Node ESM
files: ["**/*.config.{js,mjs,cjs,ts}", "**/playwright.config.{ts,js}", "**/vite.config.{ts,js}"],
languageOptions: {
globals: NODE_GLOBALS,
sourceType: "module",
},
},
{
files: ["plugins/photoshop/src/**/*.js"],
languageOptions: {
globals: {
require: "readonly",
module: "readonly",
console: "readonly",
window: "readonly",
document: "readonly",
setTimeout: "readonly",
clearTimeout: "readonly",
requestAnimationFrame: "readonly",
cancelAnimationFrame: "readonly",
btoa: "readonly",
atob: "readonly",
CanvasRenderingContext2D: "readonly",
Uint8Array: "readonly",
Uint8ClampedArray: "readonly",
Uint32Array: "readonly",
Float32Array: "readonly",
Float64Array: "readonly",
// ChromascopeCore is the IIFE exported by the bundled core HTML at runtime.
ChromascopeCore: "readonly",
},
sourceType: "commonjs",
},
rules: {
"no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" }],
"no-redeclare": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-unused-vars": "off",
},
},
{
ignores: [
"**/build/**",
"**/build-lib/**",
"**/dist/**",
"**/node_modules/**",
"**/core/scope-bundle.js",
"**/core/index.html",
"**/target/**",
"**/test-results/**",
"**/*.test.*",
"**/__tests__/**",
],
},
];