-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patheslint.config.mjs
More file actions
51 lines (47 loc) · 1.24 KB
/
Copy patheslint.config.mjs
File metadata and controls
51 lines (47 loc) · 1.24 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
import pluginJs from "@eslint/js";
import globals from "globals";
import { defineConfig } from "eslint/config";
export default defineConfig([
pluginJs.configs.recommended,
{
ignores: ["**/node_modules/**", "**/dist/**", "**/build/**", "**/website/**", "**/.cppjs/**", "**/.wrangler/**", "**/cppjs-core-embind-jsi/**"],
},
{
// Define which files this object applies to
files: ["**/*.js", "**/*.mjs", "**/*.cjs"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
// 'env' is replaced by 'globals' in Flat Config
globals: {
...globals.browser,
...globals.es2021,
...globals.node,
},
},
// 3. Custom Rules
rules: {
indent: ["off", 2, {
SwitchCase: 1,
}],
"max-len": ["off", {
code: 125,
tabWidth: 2,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
"import/extensions": "off",
"no-use-before-define": "off",
"no-unused-vars": "off",
},
},
// 4. Override for CommonJS files
// (Replaces the specific override you had for .eslintrc.{js,cjs})
{
files: ["**/*.cjs"],
languageOptions: {
sourceType: "commonjs",
},
},
]);