forked from peggyjs/peggy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
63 lines (62 loc) · 1.69 KB
/
eslint.config.js
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
"use strict";
module.exports = [
{
ignores: [
"**/*.d.ts",
"benchmark/**",
"build/**",
"docs/**",
"examples/*.js", // Testing examples
"node_modules/**",
"test/cli/fixtures/bad.js", // Intentionally-invalid
"test/cli/fixtures/imports_peggy.js", // Generated
"test/cli/fixtures/lib.js", // Generated
"test/cli/fixtures/useFrags/fs.js", // Generated
"test/cli/fixtures/useFrags/identifier.js", // Generated
"test/vendor/**",
],
},
{
...require("@peggyjs/eslint-config/flat/js"),
ignores: [
"**/*.min.js",
"lib/parser.js", // Generated
],
},
require("@peggyjs/eslint-config/flat/mjs"),
require("@peggyjs/eslint-config/flat/mocha"),
require("@peggyjs/eslint-config/flat/ts"),
{
...require("@peggyjs/eslint-config/flat/modern"),
// All of these can use modern JS and node constructs
files: ["bin/*.js", "tools/**", "web-test/**", "src/*.mjs"],
},
{
files: ["lib/peg.d.ts"],
rules: {
// Easier than fixing the hand-generated peg.d.ts
"no-unused-vars": "off",
"one-var": "off",
"no-use-before-define": "off",
"init-declarations": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/init-declarations": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/prefer-function-type": "off",
},
},
{
// Check these files for broad browser compatibility.
files: [
"**/*.min.js",
"lib/parser.js",
],
plugins: {
compat: require("eslint-plugin-compat"),
},
rules: {
"compat/compat": "error",
},
},
];