-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy patheslint.config.js
More file actions
46 lines (44 loc) · 1.57 KB
/
eslint.config.js
File metadata and controls
46 lines (44 loc) · 1.57 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
import pluginJs from "@eslint/js";
import pluginImportAlias from "eslint-plugin-import-alias";
import pluginReact from "eslint-plugin-react";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import globals from "globals";
import tseslint from "typescript-eslint";
import tsconfig from "./tsconfig.json" with { type: "json" };
/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
plugins: {
"import-alias": pluginImportAlias,
"simple-import-sort": simpleImportSort,
},
settings: {
react: {
version: "19",
},
},
rules: {
"import-alias/import-alias": [
"error",
{
relativeDepth: 0,
aliases: Object.entries(tsconfig.compilerOptions.paths).map(
([to, [from]]) => ({
alias: to.replace(/\*$/, ""),
matcher: from.replace(/^\.\//, "^"),
}),
),
},
],
"react/react-in-jsx-scope": "off",
"@typescript-eslint/no-explicit-any": "off", // Would be great to remove all `any` types...
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
},
},
];