-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
58 lines (57 loc) · 1.68 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
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:prettier/recommended',
],
ignorePatterns: [
'src/api/generatedTypes.ts', // Ignore generated types
'react-app-env.d.ts', // Ignore Create React App setup file
'!/.aws', // Do check infra files under the `.aws` folder
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: 'tsconfig.json',
},
plugins: ['react'],
rules: {
'prettier/prettier': [
'error',
{
useTabs: false, // \( ̄▽ ̄)/
tabWidth: 2,
semi: true,
singleQuote: true,
},
],
// We don't use prop types in React, TypeScript interfaces is enough
'react/prop-types': 0,
// allows unused vars when declared in arguments
'@typescript-eslint/no-unused-vars': [
'error',
{ vars: 'all', args: 'none' },
],
// disables case checks for class/interface/type
'@typescript-eslint/class-name-casing': 0,
// disables case checks for properties
'@typescript-eslint/camelcase': 0,
// allows 'any' typehint
'@typescript-eslint/no-explicit-any': 0,
// we rely on this heavily, knowing data will be returned by the API
// TODO: review the code that requires this rule to be turned off for now
'@typescript-eslint/no-non-null-asserted-optional-chain': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
},
settings: {
react: {
// Settings for eslint-plugin-react
pragma: 'React',
version: 'detect',
},
},
};