Repository navigation
Expand file tree
/
Copy patheslint.config.mjs
More file actions
60 lines (59 loc) · 1.73 KB
/
Copy patheslint.config.mjs
File metadata and controls
60 lines (59 loc) · 1.73 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
import { defineConfig, globalIgnores } from "eslint/config";
import config from "eslint-config-webpack";
import configs from "eslint-config-webpack/configs.js";
export default defineConfig([
globalIgnores([
"client/**/*",
"dist/**/*",
"examples/**/*",
"lib/options.check.js",
]),
{
extends: [config],
rules: {
// TODO fix me
"prefer-destructuring": "off",
"jsdoc/require-property-description": "off",
},
},
{
files: ["test/**/*"],
extends: [configs["universal-recommended"]],
rules: {
// Test callbacks (it/test/subtest arrow functions) don't need JSDoc.
"jsdoc/require-jsdoc": "off",
// Tests legitimately log diagnostics (retry attempts, etc.).
"no-console": "off",
// node:test callbacks receive `t` (TestContext) as a parameter.
"id-length": "off",
},
},
{
files: ["scripts/node-test-setup.mjs", "scripts/run-tests.mjs"],
rules: {
"n/no-unsupported-features/node-builtins": "off",
},
},
{
// `@changesets/get-github-info` is ESM-only and exposes itself through an
// `exports` map with no `main`, which the import resolver cannot follow.
files: [".changeset/changelog-generator.mjs"],
rules: {
"import/no-unresolved": "off",
},
},
{
// `webpack-dev-middleware/client/ws` and its neighbours are subpaths of
// that package's `exports` map, which the import resolver cannot follow
// either. TypeScript does resolve them, so `lint:types-client` still
// covers the imports.
files: [
"client-src/clients/EventSourceClient.js",
"client-src/clients/WebSocketClient.js",
"client-src/index.js",
],
rules: {
"import/no-unresolved": "off",
},
},
]);