forked from tim-soft/react-spring-lightbox
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
80 lines (79 loc) · 2.02 KB
/
.eslintrc.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* eslint-disable sort-keys */
/**
* Configure ESLint
*
* https://eslint.org/docs/user-guide/configuring
*/
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
extends: [
'plugin:react/recommended',
'plugin:import/warnings',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'prettier/@typescript-eslint',
],
globals: {
document: true,
window: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
},
plugins: [
'prettier',
'jsx-a11y',
'react',
'react-hooks',
'import',
'sort-destructure-keys',
'@typescript-eslint',
],
root: true,
rules: {
// Enforce React Hooks rules
// https://www.npmjs.com/package/eslint-plugin-react-hooks
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'sort-destructure-keys/sort-destructure-keys': [
'error',
{ caseSensitive: false },
],
'sort-keys': ['error', 'asc', { caseSensitive: false, natural: false }],
'sort-vars': [
'error',
{
ignoreCase: true,
},
],
'react/jsx-sort-props': ['error', { ignoreCase: true }],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/member-ordering': [
'error',
{
default: {
order: 'alphabetically',
},
classes: {
order: 'as-written',
},
},
],
},
settings: {
'import/resolver': {
node: true,
'eslint-import-resolver-typescript': true,
},
react: {
version: 'detect',
},
},
};