-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy patheslint.config.mjs
More file actions
96 lines (94 loc) · 2.38 KB
/
eslint.config.mjs
File metadata and controls
96 lines (94 loc) · 2.38 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
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import pluginNext from "@next/eslint-plugin-next";
import configPrettier from "eslint-config-prettier";
import pluginImport from "eslint-plugin-import";
import pluginReact from "eslint-plugin-react";
import pluginUnicorn from "eslint-plugin-unicorn";
import globals from "globals";
import ts from "typescript-eslint";
const compat = new FlatCompat();
/** @type {import('eslint').Linter.Config[]} */
export default [
{
ignores: [
"node_modules/**",
"dist/**",
"build/**",
"out/**",
".next/**",
"coverage/**",
"public/**",
"next-env.d.ts",
],
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
js.configs.recommended,
...ts.configs.recommended,
{
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
ignoreRestSiblings: true,
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-empty-object-type": "off",
},
},
configPrettier,
pluginImport.flatConfigs.recommended,
...compat.extends("plugin:import/typescript"),
{
settings: {
"import/resolver": {
typescript: true,
node: true,
alias: {
map: [["@", "./src"]],
extensions: [".js", ".jsx"],
},
},
},
},
pluginReact.configs.flat.recommended,
pluginUnicorn.configs["flat/recommended"],
{
rules: {
"unicorn/prevent-abbreviations": "off",
"unicorn/no-null": "off",
"unicorn/no-nested-ternary": "off",
"unicorn/no-array-reduce": "off",
"unicorn/expiring-todo-comments": "off",
"unicorn/prefer-add-event-listener": "off",
"unicorn/numeric-separators-style": "off",
"unicorn/prefer-ternary": "off",
"unicorn/no-lonely-if": "off",
"unicorn/prefer-code-point": "off",
"unicorn/prefer-blob-reading-methods": "off",
"unicorn/new-for-builtins": "off",
"unicorn/prefer-global-this": "off",
},
},
{
settings: {
react: {
version: "detect",
},
},
rules: {
"react/prop-types": "off",
},
},
...compat.extends("plugin:react-hooks/recommended"),
pluginNext.configs.recommended,
];