forked from launchdarkly/LaunchDarkly-Docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
95 lines (91 loc) · 2.54 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
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:jsx-a11y/recommended',
'plugin:prettier/recommended',
],
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
env: {
browser: true,
node: true,
es6: true,
},
plugins: ['@typescript-eslint', 'react', 'import', 'react-hooks', 'jsx-a11y'],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
overrides: [
{
files: ['./gatsby-*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
rules: {
'no-duplicate-imports': 'error',
// Forbid unnecessary backticks
// https://github.com/prettier/eslint-config-prettier/blob/master/README.md#forbid-unnecessary-backticks
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
// Disable prop-types as we use TypeScript for type checking
'react/prop-types': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'import/no-unresolved': 'error',
// 'import/named': 'error', disabling because this is handled by tsc
'import/default': 'error',
'import/export': 'error',
'import/no-self-import': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', ['internal', 'parent', 'sibling'], 'index'],
},
],
'import/no-webpack-loader-syntax': 'error',
'import/no-cycle': 'error',
'import/no-useless-path-segments': 'error',
'import/no-unused-modules': 'error',
'import/no-duplicates': 'error',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
ignorePatterns: ['cypress/plugins', 'cypress/support', 'cypress/fixtures'],
globals: {
describe: true,
it: true,
expect: true,
jest: true,
beforeEach: true,
afterEach: true,
beforeAll: true,
afterAll: true,
test: true,
jsdom: true,
cy: true,
chai: true,
before: true,
after: true,
Cypress: true,
context: true,
assert: true,
},
}