-
Notifications
You must be signed in to change notification settings - Fork 405
Expand file tree
/
Copy patheslint.config.js
More file actions
110 lines (107 loc) · 2.55 KB
/
eslint.config.js
File metadata and controls
110 lines (107 loc) · 2.55 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
import path from "node:path";
import { fileURLToPath } from "node:url";
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import mocha from "eslint-plugin-mocha";
import chaiExpect from "eslint-plugin-chai-expect";
// Mimic CommonJS variables in ESM
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Initialize FlatCompat with the current directory
const compat = new FlatCompat({
baseDirectory: __dirname,
resolvePluginsRelativeTo: __dirname,
recommendedConfig: js.configs.recommended, // Optional, for "eslint:recommended"
});
export default [
{
ignores: [
"node_modules/**/*.*",
"examples/**/*.*",
"testcases/**/*.*",
"public/testem/*.js",
"**/.eslintrc.js",
"eslint.config.js",
"tests/fixtures/tape/public/bundle.js",
"tests/fixtures/firefox/custom_user.js",
],
},
{
plugins: { "chai-expect": chaiExpect, mocha },
rules: {
"chai-expect/missing-assertion": 2,
"chai-expect/no-inner-compare": 2,
"mocha/no-exclusive-tests": 2,
},
},
...compat.config({
root: true,
parserOptions: {
ecmaVersion: 6,
},
extends: "eslint:recommended",
env: {
browser: false,
node: true,
es6: true,
mocha: true,
},
globals: {},
rules: {
"no-cond-assign": [2, "except-parens"],
"no-console": 0,
"no-empty": 2,
curly: 2,
eqeqeq: 2,
"guard-for-in": 0,
"no-caller": 2,
"no-eq-null": 2,
"no-eval": 2,
"no-new": 0,
"no-unused-expressions": [
2,
{
allowShortCircuit: true,
allowTernary: true,
},
],
"wrap-iife": 0,
yoda: 2,
semi: 2,
strict: [2, "global"],
"no-undef": 2,
"no-unused-vars": 2,
"no-use-before-define": [2, "nofunc"],
camelcase: 0,
"eol-last": 2,
indent: [
2,
2,
{
SwitchCase: 1,
VariableDeclarator: { var: 2, let: 2, const: 3 },
},
],
"keyword-spacing": 2,
"linebreak-style": [2, "unix"],
"new-cap": [
2,
{
properties: false,
},
],
"no-plusplus": 0,
"no-trailing-spaces": 2,
"no-unneeded-ternary": 2,
"space-before-blocks": 2,
"space-in-parens": 2,
"space-infix-ops": 2,
"space-unary-ops": 2,
"space-before-function-paren": [
"error",
{ anonymous: "never", named: "never" },
],
quotes: [2, "single"],
},
}),
];