-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
80 lines (78 loc) · 2.08 KB
/
Copy patheslint.config.mjs
File metadata and controls
80 lines (78 loc) · 2.08 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
import graphqlPlugin from "@graphql-eslint/eslint-plugin";
import eslintParserTypeScript from "@typescript-eslint/parser";
import coreWebVitals from "eslint-config-next/core-web-vitals";
import typescript from "eslint-config-next/typescript";
import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
const eslintConfig = [
{
ignores: ["node_modules/**", ".next/**", "out/**", "build/**", "next-env.d.ts"],
},
...coreWebVitals,
...typescript,
{
files: ["**/*.{ts,tsx,cts,mts}"],
languageOptions: {
parser: eslintParserTypeScript,
parserOptions: {
project: true,
},
},
},
{
files: ["**/*.{jsx,tsx}"],
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
"better-tailwindcss": eslintPluginBetterTailwindcss,
},
rules: {
// enable all recommended rules to report a warning
...eslintPluginBetterTailwindcss.configs["recommended-warn"].rules,
},
settings: {
"better-tailwindcss": {
// tailwindcss 4: the path to the entry file of the css based tailwind config (eg: `src/global.css`)
entryPoint: "app/globals.css",
},
},
},
{
files: ["**/*.ts", "**/*.tsx"],
processor: graphqlPlugin.processor,
},
{
files: ["**/*.graphql"],
ignores: ["schema.graphql"],
languageOptions: {
parser: graphqlPlugin.parser,
parserOptions: {
graphQLConfig: {
schema: "./schema.graphql",
documents: "./{app,components,hooks,lib,providers}/**/*.{ts,tsx}",
},
},
},
plugins: {
"@graphql-eslint": graphqlPlugin,
},
rules: {
...graphqlPlugin.configs["flat/operations-recommended"].rules,
"@graphql-eslint/alphabetize": [
"error",
{
definitions: true,
selections: ["OperationDefinition", "FragmentDefinition"],
variables: true,
arguments: ["Field", "Directive"],
groups: ["...", "id", "*", "{"],
},
],
},
},
];
export default eslintConfig;