-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreact-base.js
More file actions
65 lines (63 loc) · 1.58 KB
/
react-base.js
File metadata and controls
65 lines (63 loc) · 1.58 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
// base used for both React web and React Native
import jsxA11y from 'eslint-plugin-jsx-a11y';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import jestPlugin from 'eslint-plugin-jest';
import testingLibraryPlugin from 'eslint-plugin-testing-library';
import baseConfig from './base.js';
import { react, reactHooks } from './rules/index.js';
export default [
...baseConfig,
{
name: 'eslint-plugin-jsx-a11y/recommended',
...jsxA11y.flatConfigs.recommended,
},
{
name: '@thoughtbot/eslint-config/react-base',
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
jest: jestPlugin,
},
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...jestPlugin.environments.globals.globals,
},
},
settings: {
react: {
version: 'detect',
},
},
rules: {
...react.rules,
...reactHooks.rules,
},
},
{
name: 'eslint-react/recomended',
...reactPlugin.configs.flat.recommended,
},
{
name: 'eslint-react/jsx-runtime',
...reactPlugin.configs.flat['jsx-runtime'],
},
{
name: 'eslint-plugin-react-hooks/recomended',
...reactHooksPlugin.configs.flat.recommended,
},
{
name: 'eslint-plugin-jest/recommended',
...jestPlugin.configs['flat/recommended'],
},
{
name: '@thoughtbot/eslint-config/react-base/base/testing',
files: ['**/__tests__/**/*', '**/*.{spec,test}.*'],
...testingLibraryPlugin.configs['flat/react'],
},
];