-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheslint.config.js
More file actions
91 lines (89 loc) · 2.61 KB
/
eslint.config.js
File metadata and controls
91 lines (89 loc) · 2.61 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
const { defineConfig, globalIgnores } = require("eslint/config");
const globals = require("globals");
const importPlugin = require("eslint-plugin-import");
const js = require("@eslint/js");
// const jsdoc = require("eslint-plugin-jsdoc");
const pluginJest = require("eslint-plugin-jest");
const prettier = require("eslint-plugin-prettier/recommended");
const tseslint = require("typescript-eslint");
module.exports = defineConfig([
// List of recommended rules used as a baseline
js.configs.recommended, // Applies "eslint:recommended"
prettier,
{
files: ["**/*.{cjs,js,mjs}"],
languageOptions: {
ecmaVersion: 2022,
globals: {
...globals.browser,
...globals.commonjs,
...globals.jest,
...globals.node
},
sourceType: "commonjs"
},
rules: {
"linebreak-style": ["error", "unix"], // Enforce LF line endings only. This is usually covered by prettier, but prettier is currently disabled here
"no-unused-vars": "off",
"prettier/prettier": "off", // Too many problems to resolve
// "prettier/prettier": [
// "error",
// {
// arrowParens: "avoid",
// endOfLine: "auto",
// printWidth: 100,
// semi: true,
// singleQuote: true,
// trailingComma: "es5"
// }
// ]
}
},
{
// update this to match your test files
files: ["*.test.js", "*.test.jsx"],
plugins: { jest: pluginJest },
languageOptions: {
globals: pluginJest.environments.globals.globals,
},
rules: {
"jest/expect-expect": "off",
"jest/no-conditional-expect": "off",
"jest/no-done-callback": "off",
"jest/no-standalone-expect": "off",
"jest/no-try-expect": "off",
"no-unused-vars": "off"
}
},
{
extends: [
tseslint.configs.recommended,
importPlugin.flatConfigs.recommended
// jsdoc.configs["flat/recommended"] // Too many problems to resolve
],
files: ["**/*.ts", "**/*.tsx"],
rules: {
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"prettier/prettier": "off" // Too many problems to resolve
},
},
// Overrides
globalIgnores([
"jsdoc/",
"doc/",
"coverage/",
"dist/",
"node_modules/",
"examples/**/node_modules/",
"test/resources/auth.js",
"**/*v*.js",
"!test/**/*.js",
"!examples/**/*.js",
"lib/*.js",
"scripts/typedoc/"
])
]);