-
-
Notifications
You must be signed in to change notification settings - Fork 10k
Expand file tree
/
Copy patheslint.config.ts
More file actions
110 lines (103 loc) · 2.77 KB
/
Copy patheslint.config.ts
File metadata and controls
110 lines (103 loc) · 2.77 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
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';
// @ts-expect-error: no types provided
import header from 'eslint-plugin-header';
import importPlugin from 'eslint-plugin-import';
import vitest from '@vitest/eslint-plugin';
// @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,
vitest.configs.recommended,
jsxA11y.flatConfigs.recommended,
regexp.configs['flat/recommended'],
prettier,
docusaurus.configs.flat.all,
// TODO replace by maintained plugin?
// See https://github.com/facebook/docusaurus/pull/11803
// This adapts the legacy plugin to flat config
{
plugins: {
header: {
meta: {
name: 'eslint-plugin-header',
version: 'whatever',
namespace: 'header',
},
rules: header.rules,
},
},
},
]);
const ignores = globalIgnores([
'.claude',
'.codex',
'**/dist/**',
'**/lib/**',
'**/build/**',
'**/.docusaurus/**',
'**/__fixtures__/**',
'__mocks__',
'node_modules',
'.yarn',
'.history',
'coverage',
'examples/',
'packages/lqip-loader/lib/*',
'packages/docusaurus/lib/*',
'packages/docusaurus-*/lib/*',
'packages/eslint-plugin/lib/',
'packages/stylelint-copyright/lib/',
'packages/create-docusaurus/lib/*',
'packages/create-docusaurus/templates/facebook',
'website/i18n',
'website/_dogfooding/_swizzle_theme_tests',
'website/_dogfooding/_asset-tests/badSyntax.js',
'packages/docusaurus-plugin-ideal-image/src/theme/IdealImageLegacy',
]);
export default defineConfig(plugins, rules, ignores, {
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.commonjs,
JSX: true,
},
parserOptions: {
// projectService: true,
},
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
react: {
version: '19',
},
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
});