forked from me4502/gatsby-plugin-react-helmet-async
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
107 lines (95 loc) · 2.48 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
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
const ERROR = 2
const WARN = 1
const OFF = 0
/**
* Not using `gatsby-plugin-eslint`, as it's outdated and doesn't really
* accomplish anything that hasn't been taken care of already. Feel free to look
* into it for yourself: https://www.gatsbyjs.org/packages/gatsby-plugin-eslint/
*
* @see https://eslint.org/docs/user-guide/configuring/
* @type {eslint.BaseConfig}
*/
module.exports = {
/**
* @type {eslint.BaseConfig.env}
*/
env: {
browser: true,
es2020: true,
node: true,
},
/**
* @see https://github.com/standard/eslint-config-standard-react
* @see https://github.com/standard/eslint-config-standard-with-typescript
* @see https://github.com/benmosher/eslint-plugin-import
*/
extends: [
'standard-react',
'standard-with-typescript',
'plugin:import/errors',
'plugin:import/warnings',
'prettier',
],
globals: {
__PATH_PREFIX__: true,
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
/**
* @see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser
*/
parser: '@typescript-eslint/parser',
/**
* @type {eslint.BaseConfig.parserOptions}
*/
parserOptions: {
ecmaFeatures: {
impliedStrict: true,
jsx: true,
},
ecmaVersion: 2020,
project: './tsconfig.json',
sourceType: 'module',
},
/**
* @see https://github.com/yannickcr/eslint-plugin-react
*/
plugins: ['react'],
rules: {
'comma-dangle': [WARN, 'always-multiline'],
'no-cond-assign': [ERROR, 'always'],
'quote-props': [WARN, 'consistent-as-needed'],
},
/**
* @type {eslint.BaseConfig.settings}
*/
settings: {
react: {
version: 'detect',
},
},
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/typescript',
],
/**
* @see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin
*/
plugins: ['@typescript-eslint'],
/**
* @see https://github.com/yannickcr/eslint-plugin-react
*/
rules: {
'react/prop-types': OFF,
'@typescript-eslint/consistent-type-definitions': [ERROR, 'type'],
'@typescript-eslint/explicit-function-return-type': ERROR,
'@typescript-eslint/require-await': OFF,
'@typescript-eslint/strict-boolean-expressions': OFF,
},
},
],
}