|
1 |
| -const { defineConfig } = require("eslint/config"); |
2 |
| -const globals = require("globals"); |
3 |
| -const mocha = require("eslint-plugin-mocha"); |
4 |
| -const security = require("eslint-plugin-security"); |
5 |
| -const prettier = require("eslint-plugin-prettier"); |
| 1 | +import js from "@eslint/js"; |
| 2 | +import globals from "globals"; |
| 3 | +import mochaPlugin from "eslint-plugin-mocha"; |
| 4 | +import securityPlugin from "eslint-plugin-security"; |
| 5 | +import prettierPlugin from "eslint-plugin-prettier"; |
6 | 6 |
|
7 |
| -module.exports = defineConfig([ |
| 7 | +export default [ |
8 | 8 | {
|
9 | 9 | ignores: ["dist/*", "**/.eslintrc.js", "public/*"],
|
10 | 10 | },
|
| 11 | + js.configs.recommended, |
11 | 12 | {
|
12 | 13 | languageOptions: {
|
| 14 | + ecmaVersion: "latest", |
| 15 | + sourceType: "module", |
13 | 16 | globals: {
|
14 |
| - ...globals.commonjs, |
15 | 17 | ...globals.node,
|
16 | 18 | ...globals.mocha,
|
17 |
| - ...globals.es2021, |
18 | 19 | config: "readonly",
|
19 | 20 | logger: "readonly",
|
20 | 21 | },
|
21 |
| - |
22 |
| - ecmaVersion: 13, |
23 |
| - parserOptions: {}, |
24 | 22 | },
|
25 |
| - |
26 | 23 | plugins: {
|
27 |
| - mocha, |
28 |
| - security, |
29 |
| - prettier, |
| 24 | + mocha: mochaPlugin, |
| 25 | + security: securityPlugin, |
| 26 | + prettier: prettierPlugin, |
30 | 27 | },
|
31 |
| - |
32 | 28 | rules: {
|
33 | 29 | // Custom eslint rules
|
34 | 30 | "no-trailing-spaces": "error",
|
35 | 31 | "consistent-return": "error",
|
36 | 32 | "no-console": "error",
|
37 | 33 |
|
38 |
| - // Custom mocha rules |
39 |
| - "mocha/no-skipped-tests": "error", |
| 34 | + // Mocha rules |
40 | 35 | "mocha/no-exclusive-tests": "error",
|
41 | 36 |
|
42 | 37 | // Prettier for formatting
|
43 | 38 | "prettier/prettier": "error",
|
| 39 | + |
| 40 | + "no-unused-vars": "off", |
44 | 41 | },
|
| 42 | + ignores: ["public/*", "dist/*"], |
45 | 43 | },
|
46 |
| -]); |
| 44 | +]; |
0 commit comments