|
1 | 1 | import { defineConfig } from "eslint/config"; |
2 | 2 | import pluginCompat from "eslint-plugin-compat"; |
3 | 3 | import pluginJsDoc from "eslint-plugin-jsdoc"; |
4 | | -import pluginMocha from "eslint-plugin-mocha"; |
5 | 4 | import { createConfig, legacyPlugin } from "@mutsuntsai/eslint"; |
6 | 5 |
|
7 | 6 | export default defineConfig([ |
8 | 7 | ...createConfig({ |
9 | | - ignores: ["{build,coverage}/**", "lib/**/*.js", "lib/optimizer/**/*.mjs", "src/app/gen/**"], |
10 | | - import: ["**/*.{ts,vue}", "eslint.config.mjs"], |
11 | | - project: [ |
12 | | - "src/app", |
13 | | - "src/client", |
14 | | - "src/core", |
15 | | - "src/other/donate", |
16 | | - "src/other/service", |
17 | | - "test", |
18 | | - "e2e", |
19 | | - "tools", |
20 | | - ], |
| 8 | + ignores: ["{build,coverage}/**", "lib/{lzma,optimizer}/**/*.js"], |
| 9 | + import: { |
| 10 | + files: ["**/*.{ts,vue}", "eslint.config.js"], |
| 11 | + project: [ |
| 12 | + "src/app", |
| 13 | + "src/client", |
| 14 | + "src/core", |
| 15 | + "src/other/donate", |
| 16 | + "src/other/service", |
| 17 | + "test", |
| 18 | + "e2e", |
| 19 | + "tools", |
| 20 | + ], |
| 21 | + }, |
21 | 22 | globals: { |
22 | | - cjs: ["gulpfile.js", "gulp/**"], |
23 | | - esm: ["test/mocha.env.mjs", "lib/**/*.mjs", "eslint.config.mjs"], |
| 23 | + esm: ["test/mocha.env.js", "lib/**/*.js", "eslint.config.js", "gulpfile.js", "gulp/**"], |
24 | 24 | browser: ["src/**"], |
25 | 25 | }, |
26 | 26 | html: { |
27 | | - "@typescript-eslint/no-magic-numbers": "off", |
28 | | - "@typescript-eslint/no-this-alias": "off", |
29 | | - "@typescript-eslint/no-unused-vars": "off", |
30 | 27 | "max-lines-per-function": "off", |
31 | 28 | "no-invalid-this": "off", |
| 29 | + "no-unused-vars": "off", |
32 | 30 | "no-var": "off", |
33 | 31 | "vars-on-top": "off", |
34 | 32 | }, |
| 33 | + mocha: ["test/**"], |
| 34 | + playwright: ["e2e/**"], |
| 35 | + package: order => order.toSpliced(order.indexOf("version") + 1, 0, "app_version"), |
35 | 36 | }), |
36 | 37 |
|
37 | 38 | ///////////////////////////////////////////////////////////////////////////////////////////////////// |
@@ -95,39 +96,6 @@ export default defineConfig([ |
95 | 96 | }, |
96 | 97 | }, |
97 | 98 |
|
98 | | - ///////////////////////////////////////////////////////////////////////////////////////////////////// |
99 | | - // Tests |
100 | | - ///////////////////////////////////////////////////////////////////////////////////////////////////// |
101 | | - |
102 | | - { |
103 | | - ...pluginMocha.configs.recommended, |
104 | | - files: ["test/**"], |
105 | | - }, |
106 | | - { |
107 | | - name: "General Tests", |
108 | | - files: ["{test,e2e,tools}/**"], |
109 | | - rules: { |
110 | | - "@typescript-eslint/explicit-function-return-type": ["warn", { |
111 | | - allowFunctionsWithoutTypeParameters: true, |
112 | | - }], |
113 | | - "@typescript-eslint/no-invalid-this": "off", |
114 | | - "@typescript-eslint/no-magic-numbers": "off", |
115 | | - "@typescript-eslint/no-unused-expressions": "off", |
116 | | - "max-classes-per-file": "off", |
117 | | - "max-lines-per-function": "off", |
118 | | - "prefer-arrow-callback": "off", |
119 | | - }, |
120 | | - }, |
121 | | - { |
122 | | - name: "Mocha", |
123 | | - files: ["test/**"], |
124 | | - rules: { |
125 | | - "mocha/prefer-arrow-callback": "warn", |
126 | | - "mocha/no-exports": "off", |
127 | | - "mocha/no-pending-tests": "off", |
128 | | - }, |
129 | | - }, |
130 | | - |
131 | 99 | ///////////////////////////////////////////////////////////////////////////////////////////////////// |
132 | 100 | // Specific scopes |
133 | 101 | ///////////////////////////////////////////////////////////////////////////////////////////////////// |
|
0 commit comments