-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
59 lines (57 loc) · 2.1 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
// Disable all rules related to code formatting. Prettier handles formatting.
// Prettier related configs should come last in the 'extends' Array.
'plugin:import/recommended',
// We could move the import/* settings below to a lerna package, and use it here:
// 'plugin:typescript-eslint-import/recommended',
'plugin:prettier/recommended',
'prettier/@typescript-eslint',
],
rules: {
'no-param-reassign': ['error'],
// The code base was migrated from JavaScript recently. Let's chill a bit.
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-empty-interface': 'warn',
// This is not working well with JSX
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-use-before-define': 'off',
// eslint-plugin-import
// We can't alphabetize imports within groups, yet
// https://github.com/benmosher/eslint-plugin-import/pull/1105
'import/no-extraneous-dependencies': [
'error',
{
// Allow imports from devDependencies
devDependencies: [
// In test files
'**/*.test.{ts,tsx}',
'**/*/__tests__/**/*.{ts,tsx}',
// In test utilities files
'**/*/utils/test/*.{ts,tsx}',
// In configuration or setup files
'**/*.{config,setup}.{js,ts}',
],
},
],
// It seems eslint-import-resolver-typescript isn't properly handling the
// 'paths' defined in packages/api/tsconfig.json, so we need to ignore any
// custom path we define there.
'import/no-unresolved': ['error', { ignore: ['^@olimat/(api|web)']}],
'import/order': ['error'],
},
settings: {
'import/extensions': ['.ts', '.tsx'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
// https://www.npmjs.com/package/eslint-import-resolver-typescript#configuration
'import/resolver': {
typescript: {},
},
},
};