-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy patheslint.config.mjs
More file actions
128 lines (125 loc) · 3.48 KB
/
eslint.config.mjs
File metadata and controls
128 lines (125 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
128
// eslint.config.mjs
// ESLint v10 flat configuration for DOSee - MS-DOS Emulator for the Web
// https://eslint.org/docs/latest/use/configure/configuration-files-new
/// <reference types="@eslint/js" />
import globals from "globals";
import js from "@eslint/js";
import prettierConfig from "eslint-config-prettier";
export default [
// Global ignores - files that should not be linted
{
ignores: [
"build/**",
"src/emulator/**",
"workbox-config.js",
"tmp/**",
"*.min.js",
"*.bundle.js",
"node_modules/**",
],
},
// Base recommended rules from ESLint
js.configs.recommended,
{
files: ["src/**/*.js"],
languageOptions: {
ecmaVersion: 2023, // Explicit version for clarity
sourceType: "module", // ES modules (default in modern JS)
parserOptions: {
ecmaFeatures: {
impliedStrict: true,
jsx: false, // Not using JSX
},
},
globals: {
...globals.browser,
// DOSee application globals
BrowserFS: "readonly",
DOSee: "readonly",
DoseeLoader: "readonly",
Emulator: "readonly",
FileSaver: "readonly",
// Writable globals
FS: "writable",
Module: "writable",
// Service Worker globals (for sw.js)
self: "readonly",
caches: "readonly",
clients: "readonly",
importScripts: "readonly",
},
},
linterOptions: {
noInlineConfig: false,
reportUnusedDisableDirectives: "error",
},
rules: {
"no-useless-assignment": "error",
"require-atomic-updates": "error",
"accessor-pairs": "warn",
"symbol-description": "warn",
"no-eval": "error",
"no-empty-function": "warn",
"no-empty": "warn",
"no-else-return": "warn",
"no-bitwise": "warn",
"no-var": "warn",
"no-undefined": "warn",
"no-undef-init": "warn",
"no-useless-constructor": "warn",
"no-useless-concat": "warn",
"no-useless-computed-key": "warn",
"no-unneeded-ternary": "warn",
"prefer-template": "warn",
"prefer-spread": "warn",
"prefer-rest-params": "warn",
"prefer-const": "warn",
"prefer-arrow-callback": "warn",
"operator-assignment": "warn",
"no-throw-literal": "warn",
"no-script-url": "warn",
"no-return-assign": "warn",
"no-proto": "warn",
"no-param-reassign": "warn",
"no-octal-escape": "warn",
"no-object-constructor": "warn",
"no-new-wrappers": "warn",
"no-new-func": "warn",
"no-new": "warn",
"no-nested-ternary": "warn",
"no-negated-condition": "warn",
"no-multi-assign": "warn",
"no-magic-numbers": [
"warn",
{
ignore: [-1, 0, 1, 2],
ignoreArrayIndexes: true,
ignoreDefaultValues: true,
ignoreClassFieldInitialValues: true,
enforceConst: true,
},
],
"no-loop-func": "warn",
"no-lonely-if": "warn",
"no-implied-eval": "warn",
"no-implicit-globals": "warn",
"no-implicit-coercion": "warn",
"default-case-last": "warn",
"dot-notation": "warn",
eqeqeq: "warn",
"no-extend-native": "error",
},
},
{
files: ["puppeteer-runner.mjs"],
languageOptions: {
ecmaVersion: 2023,
sourceType: "module",
globals: {
...globals.node,
},
},
},
// Prettier compatibility - should be last to override formatting rules
prettierConfig,
];