This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
53 lines (50 loc) · 1.22 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
/* eslint-disable prettier/prettier */
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'plugin:react/recommended',
'standard'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 12,
sourceType: 'module'
},
plugins: [
'react',
'@typescript-eslint',
'react-prefer-function-component',
'prettier'
],
rules: {
// suppress errors for missing 'import React' in files
'react/react-in-jsx-scope': 'off',
// Rule to flag statements that use != and == instead of !== and ===
eqeqeq: 'error',
// close emtpy components
'react/self-closing-comp': ['error', {
component: true,
html: true
}],
// enforces the use of the shorthand syntax
'object-shorthand': ['error', 'always', { avoidQuotes: true }],
// react props per line
'react/jsx-max-props-per-line': ['error',
// { when: 'always' }
{ maximum: { single: 2, multi: 1 } }
],
'react-prefer-function-component/react-prefer-function-component': 'error',
// camelcase
camelcase: ['error', {
properties: 'never',
ignoreImports: true,
ignoreDestructuring: true
}]
}
}