-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
61 lines (58 loc) · 1.49 KB
/
eslint.config.js
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
/*!
* All the code that follow is
* Copyright (c) 2015 - 2024 Richard Huang <[email protected]>.
* All Rights Reserved. Not for reuse without permission.
*/
const { FlatCompat } = require('@eslint/eslintrc');
const hermes = require('hermes-eslint');
const js = require('@eslint/js');
const compat = new FlatCompat({ baseDirectory: __dirname });
module.exports = [
// Order Matters™!
js.configs.recommended,
{
languageOptions: {
parser: hermes,
},
},
...compat.config({
env: {
browser: true,
'jest/globals': true,
node: true,
},
extends: [
'airbnb',
'airbnb/hooks',
'plugin:@docusaurus/recommended',
'plugin:react/jsx-runtime',
],
ignorePatterns: [
'build/',
'.docusaurus/',
],
overrides: [
{
files: ['**/*.js?'],
},
],
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 2020,
},
rules: {
// Better React debugging.
'prefer-arrow-callback': 'off',
'import/no-extraneous-dependencies': ['error', { optionalDependencies: true }],
'import/no-named-as-default': 0,
'import/no-named-as-default-member': 0,
'import/no-unresolved': ['error', { ignore: ['^[@#].+$'] }],
'react/jsx-props-no-spreading': 'off',
'react/require-default-props': 'off',
},
settings: {
'import/core-modules': ['@docusaurus/theme-common', '@docusaurus/utils'],
react: { version: 'detect' },
},
}),
];