-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.mjs
More file actions
84 lines (77 loc) · 2.29 KB
/
eslint.config.mjs
File metadata and controls
84 lines (77 loc) · 2.29 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
import globals from "globals";
import tseslint from "typescript-eslint";
import js from "@eslint/js";
import { includeIgnoreFile } from "@eslint/compat";
import { defineConfig } from "eslint/config";
import eslintConfigPrettier from "eslint-config-prettier";
import jsxA11y from "eslint-plugin-jsx-a11y";
import pluginReact from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import tailwind from "eslint-plugin-tailwindcss";
import path from "node:path";
import { fileURLToPath } from "node:url";
import ts from "typescript-eslint";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, ".gitignore");
export default defineConfig([
js.configs.recommended,
...ts.configs.recommended,
...tailwind.configs["flat/recommended"],
includeIgnoreFile(gitignorePath),
{
ignores: ["worker-configuration.d.ts", "workers/app.ts", "external"],
},
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
plugins: { js },
extends: ["js/recommended"],
},
tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
reactHooks.configs.flat["recommended-latest"],
jsxA11y.flatConfigs.recommended,
{
settings: {
tailwindcss: {
config: path.join(__dirname, "/app/tailwind.css"),
removeDuplicates: true,
whitelist: [
"twitter-tweet",
"toast-bottom",
"toast-end",
"tabs-fixed",
"card-border",
"tabs-boxed",
"dropdown-open",
"dropdown-content",
],
},
},
},
{
files: ["**/*.{jsx,tsx}"],
rules: {
"react/react-in-jsx-scope": "off",
},
languageOptions: { globals: globals.browser },
},
{
files: ["**/*.{jsx,tsx,js,ts}"],
rules: {
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
// disable tailwind classname order because prettier is doing that
"tailwindcss/classnames-order": "off",
},
},
// Prettier config to disable eslint formatting rules and avoid formatting conflicts.
// THIS MUST ALWAYS BE THE LAST CONFIGURATION.
eslintConfigPrettier,
]);