-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.eslintrc.js
58 lines (57 loc) · 2.32 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
/**
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* https://opensource.org/licenses/MIT
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
*/
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts'],
},
},
},
extends: [
'airbnb',
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
plugins: ['jsdoc', 'simple-import-sort'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
camelcase: 'off',
'import/extensions': 'off',
'import/prefer-default-export': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.jsx'] }],
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
'no-use-before-define': 'off',
'import/no-extraneous-dependencies': 'off',
// Airbnb allows arrow functions but not regular functions which doesn't make any sense.
'react/jsx-no-bind': 'off',
// This rule is annoying and sometimes just wrong.
'no-shadow': 'off',
// The properties of object parameters should be allowed to be modified.
'no-param-reassign': ['error', { props: false }],
},
};