-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy patheslint.config.mjs
More file actions
88 lines (87 loc) · 2.23 KB
/
Copy patheslint.config.mjs
File metadata and controls
88 lines (87 loc) · 2.23 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
import js from "@eslint/js";
import { defineConfig } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import eslintConfigPrettier from "eslint-config-prettier";
import turbo from "eslint-config-turbo/flat";
import importPlugin from "eslint-plugin-import";
import globals from "globals";
import tseslint from "typescript-eslint";
/** @type import("eslint").Linter.Config[] */
export default defineConfig([
js.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
importPlugin.flatConfigs.recommended,
turbo,
...nextVitals.map(({ plugins = {}, ...config }) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { import: _, ...rest } = plugins;
return {
...config,
plugins: rest,
files: ["apps/web/**/*.{js,jsx,ts,tsx}"],
};
}),
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
settings: {
next: {
rootDir: "apps/web/",
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
},
},
},
rules: {
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"import/order": [
"error",
{
"newlines-between": "never",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
"no-restricted-syntax": [
"error",
{
selector:
"CallExpression[callee.object.name='z'][callee.property.name='object']",
message: "Avoid using z.object, use z.strictObject instead.",
},
],
},
},
{
files: ["**/eslint.config.mjs"],
extends: [tseslint.configs.disableTypeChecked],
},
{
files: ["apps/web/env/*.mjs"],
languageOptions: {
globals: globals.node,
},
},
{
ignores: [
"**/dist",
"**/coverage",
"**/.next",
"**/node_modules",
"**/packages/prisma/generated/**",
"**/next-env.d.ts",
],
},
eslintConfigPrettier,
]);