-
Notifications
You must be signed in to change notification settings - Fork 246
/
Copy patheslint.config.js
73 lines (72 loc) · 2.04 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
64
65
66
67
68
69
70
71
72
73
import eslintPluginReact from "eslint-plugin-react";
import eslintPluginImport from "eslint-plugin-import";
import eslintPluginPrettier from "eslint-plugin-prettier";
import typescriptEslintPlugin from "@typescript-eslint/eslint-plugin";
import typescriptEslintParser from "@typescript-eslint/parser";
import requireZodSchemaTypes from "./eslint/require-zod-schema-types.js";
export default [
{
ignores: [
"node_modules/**",
"dist/**",
".next/**",
"packages/shortest/node_modules/**",
"packages/shortest/dist/**",
],
},
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: typescriptEslintParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.json", "./packages/shortest/tsconfig.json"],
},
},
plugins: {
"@typescript-eslint": typescriptEslintPlugin,
react: eslintPluginReact,
import: eslintPluginImport,
prettier: eslintPluginPrettier,
"zod": {
rules: {
"require-zod-schema-types": requireZodSchemaTypes,
},
},
},
rules: {
"react/react-in-jsx-scope": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_" },
],
"func-style": ["error", "expression", { allowArrowFunctions: true }],
"arrow-body-style": ["error", "as-needed"],
"eqeqeq": ["error", "smart"],
"no-lonely-if": "error",
"no-lone-blocks": "error",
"no-empty": ["error", { allowEmptyCatch: true }],
"no-else-return": "error",
"no-alert": "error",
"logical-assignment-operators": "error",
"prefer-arrow-callback": "error",
"import/order": ["error", { alphabetize: { order: "asc" } }],
"prettier/prettier": [
"error",
{
trailingComma: "all",
},
],
"zod/require-zod-schema-types": "error",
},
settings: {
react: {
version: "detect",
},
},
},
];