-
-
Notifications
You must be signed in to change notification settings - Fork 663
Expand file tree
/
Copy patheslint.config.ts
More file actions
73 lines (66 loc) · 1.71 KB
/
Copy patheslint.config.ts
File metadata and controls
73 lines (66 loc) · 1.71 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
import { defineConfig, globalIgnores } from "eslint/config";
import tseslint from "typescript-eslint";
import globals from "globals";
import js from "@eslint/js";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import importPlugin from "eslint-plugin-import";
// @ts-expect-error: no types provided
import jsxA11y from "eslint-plugin-jsx-a11y";
import docusaurus from "@docusaurus/eslint-plugin";
import regexp from "eslint-plugin-regexp";
import prettier from "eslint-config-prettier/flat";
import rules from "./eslint.rules";
const plugins = defineConfig([
js.configs.recommended,
tseslint.configs.recommended,
react.configs.flat.recommended,
reactHooks.configs.flat.recommended,
importPlugin.flatConfigs.recommended,
jsxA11y.flatConfigs.recommended,
regexp.configs["flat/recommended"],
prettier,
// The published @docusaurus/eslint-plugin doesn't provide a flat config yet
// This adapts its legacy "all" config to flat config
{
plugins: {
"@docusaurus": docusaurus,
},
rules: docusaurus.configs.all.rules,
},
]);
const ignores = globalIgnores([
"**/dist/**",
"**/lib/**",
"**/build/**",
"**/.docusaurus/**",
"node_modules",
".yarn",
".history",
"coverage",
]);
export default defineConfig(plugins, rules, ignores, {
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.browser,
...globals.node,
...globals.commonjs,
JSX: true,
},
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
react: {
version: "19",
},
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
});