-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
68 lines (68 loc) · 1.59 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
import { fixupConfigRules } from "@eslint/compat";
import jest from "eslint-plugin-jest";
export default [
{
settings: {
react: {
version: "detect",
},
},
},
{
files: ["**/*.{js,mjs,cjs,jsx}"],
languageOptions: {
sourceType: "module",
parserOptions: { ecmaFeatures: { jsx: true } },
},
},
{
files: [
"**/*.test.js",
"**/*.config.js",
"__tests__/**",
"test/__mocks__/**",
],
languageOptions: { sourceType: "module" },
},
...fixupConfigRules(pluginReactConfig),
// ######### JEST ##########
{
files: ["__tests__/**", "**/*.test.js", "__mocks__/**"],
...jest.configs["flat/recommended"],
rules: {
...jest.configs["flat/recommended"].rules,
"jest/prefer-expect-assertions": "off",
"jest/no-disabled-tests": "off",
},
},
{
rules: {
// expects in jest.fn() functions are valid and allowed with this rule.
"jest/no-standalone-expect": 0,
// avoid defining prop types in every component.
"react/prop-types": 0,
// ignore unused vars starting with _
"no-unused-vars": [
"error",
{
caughtErrorsIgnorePattern: "^_",
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
},
],
},
},
{
ignores: [
"**/build/*",
"**/dist/*",
"**/vite.config.ts.timestamp-*",
"coverage/*",
"cypress.config.js",
"helpers/*",
"esbuild.config.js",
"tailwind.config.js"
],
},
];