forked from VandyHacks/vaken
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
55 lines (55 loc) · 1.66 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
// common eslint parser for ALL files that we use
// if you're looking for a client (especially React) or server lint rule
// go to the configs in their respective directories
module.exports = {
extends: [
'airbnb', // Airbnb style guide
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript', // Required for typescript
'plugin:promise/recommended',
'prettier',
'prettier/@typescript-eslint', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
plugins: ['@typescript-eslint', 'prettier', 'promise', 'jest'],
settings: {
'import/resolver': {
typescript: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.json'],
},
webpack: {
extensions: ['.svg', '.graphql'],
},
},
},
parserOptions: {
tsConfigRootDir: __dirname,
project: `${__dirname}/tsconfig.json`,
},
rules: {
'no-void': 0,
'no-underscore-dangle': 0,
'no-return-assign': [2, 'except-parens'],
'@typescript-eslint/explicit-function-return-type': [
2,
{ allowExpressions: true, allowTypedFunctionExpressions: true },
],
'prettier/prettier': 'error',
'no-param-reassign': [2, { props: true, ignorePropertyModificationsFor: ['draft'] }],
'import/no-extraneous-dependencies': [
2,
{ devDependencies: ['**/*.test.tsx', '**/*.test.ts'] },
],
'import/prefer-default-export': [0],
},
root: true,
overrides: [
{
files: ['**/*.test.js'],
env: { 'jest/globals': true },
},
],
};