-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
80 lines (71 loc) · 2.2 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
import js from '@eslint/js';
import flowtype from 'eslint-plugin-ft-flow';
import jest from 'eslint-plugin-jest';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import globals from 'globals';
import hermesParser from 'hermes-eslint';
export default [
js.configs.recommended,
jest.configs['flat/recommended'],
jest.configs['flat/style'],
jsxA11y.flatConfigs.recommended,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
{
plugins: {
'ft-flow': flowtype,
'react-hooks': reactHooks,
},
},
{
rules: {
...flowtype.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
// Variables
'no-unused-vars': [
'error',
{
varsIgnorePattern: 'Fragment',
},
],
// Was disabled by flowtype.configs.recommended.rules
'no-undef': 'error',
'ft-flow/define-flow-type': 'error',
'ft-flow/array-style-simple-type': ['error', 'shorthand'],
'ft-flow/newline-after-flow-annotation': ['error'],
'ft-flow/require-indexer-name': ['error'],
'ft-flow/require-readonly-react-props': ['error'],
'react/button-has-type': ['error'],
'react/no-typos': ['error'],
'react/prop-types': ['off'],
// JSX-specific rules
'react/jsx-no-target-blank': ['off'],
},
languageOptions: {
globals: {
...globals.node,
...globals.browser,
},
parser: hermesParser,
sourceType: 'module',
},
settings: {
react: {
pragma: 'h',
version: '18.3.1', // https://github.com/preactjs/preact/blob/main/compat/src/index.js
flowVersion: '0.251.1',
},
},
},
{
ignores: [
'flow-typed/',
'vendor/',
'public/build/',
'public/storage/',
'storage/',
],
},
];