-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
54 lines (49 loc) · 1.35 KB
/
eslint.config.mjs
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
// eslint.config.mjs
/*
SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
This file is part of Network Engineering Pro
*/
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import mocha from "eslint-plugin-mocha";
import globals from "globals";
const IGNORED_FILES = [
".*", // Ignores all dotfiles (.prettierrc, .babelrc, etc.)
"**/*.xml", // Exclude non-JS files like bimi-svg-tiny-ps.xml
"**/.vscode/**",
"**/dist/**",
"**/node_modules/**",
"**/assets/license/**",
"**/babel.config.json",
"**/package.json",
"**/package-lock.json",
];
const GLOBALS = {
...globals.browser,
...globals.node, // Include Node.js globals
...globals.mocha,
};
const ESLINT_RULES = {
...eslintConfigPrettier.rules,
"mocha/no-exclusive-tests": "error",
"mocha/no-skipped-tests": "warn",
"mocha/no-hooks-for-single-case": "warn",
"indent": "off", // Turn off the 'indent' rule
"quotes": "off", // Turn off the 'quotes' rule
"semi": "off", // Turn off the 'semi' rule
};
export default [
js.configs.recommended,
{
files: ["**/*.js", "**/*.mjs", "**/*.cjs"],
ignores: IGNORED_FILES,
plugins: { mocha },
languageOptions: {
globals: GLOBALS,
ecmaVersion: "latest", // Auto-upgrade ECMAScript version
sourceType: "module",
},
rules: ESLINT_RULES,
},
eslintConfigPrettier,
];