-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
90 lines (89 loc) · 2.67 KB
/
eslint.config.mjs
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
import { fixupPluginRules } from "@eslint/compat";
import eslint from "@eslint/js";
import eslintCommentsPlugin from "eslint-plugin-eslint-comments";
import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";
import simpleImportSortPlugin from "eslint-plugin-simple-import-sort";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
...tseslint.configs.strictTypeChecked,
{
plugins: {
"eslint-comments": eslintCommentsPlugin,
"simple-import-sort": simpleImportSortPlugin,
},
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
linterOptions: {
reportUnusedDisableDirectives: "error",
},
rules: {
...eslintCommentsPlugin.configs.recommended.rules,
"@typescript-eslint/consistent-type-exports": [
"error",
{
fixMixedExportsWithInlineTypeSpecifier: true,
},
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
fixStyle: "inline-type-imports",
},
],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unnecessary-type-parameters": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ varsIgnorePattern: "^_", argsIgnorePattern: "^_" },
],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
},
},
{
files: ["**/*.js", "**/*.mjs"],
extends: [tseslint.configs.disableTypeChecked],
languageOptions: {
parserOptions: {
project: false,
},
globals: globals.nodeBuiltin,
},
},
{
files: ["packages/raga-app/src/client/**/*.{ts,tsx}"],
plugins: {
react: reactPlugin,
"react-hooks": fixupPluginRules(reactHooksPlugin),
},
rules: {
...reactPlugin.configs["recommended"].rules,
...reactPlugin.configs["jsx-runtime"].rules,
...reactHooksPlugin.configs.recommended.rules,
// HACKHACK: until we can get Sass CSS modules type-checked
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-argument": "off",
// unnecessary with TypeScript
"react/prop-types": "off",
},
settings: {
react: {
version: "detect",
},
},
},
{
ignores: ["**/node_modules", "**/.vite", "/.yarn", "**/dist", "**/lib", "**/out"],
},
);