-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.eslintrc.js
76 lines (74 loc) · 1.79 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const baseConfig = {
ignorePatterns: [
'node_modules/*',
'node_modules/**/*.d.ts',
'**/__fixtures__/**/*.ts',
'**/cloudSnapshots/**/*.ts',
],
extends: '@redwoodjs/eslint-config',
plugins: ['import'],
rules: {
'import/extensions': [
'warn',
'always',
{
ignorePackages: true,
},
],
'no-console': [
'error',
{
allow: ['log', 'time', 'timeEnd'],
},
],
'prettier/prettier': 'warn',
'react/react-in-jsx-scope': 'off',
'react/no-unescaped-entities': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-restricted-imports': [
'error',
{
paths: [
{
name: 'api',
message:
'Only type imports are allowed for the api to avoid bundling api code in the cli',
allowTypeImports: true,
},
],
},
],
'no-unused-vars': 'off',
'no-new': 'off',
'react-hooks/exhaustive-deps': 'off',
'react/prop-types': 'off',
},
overrides: [
{
files: ['infrastructure/**/*', 'web/**/*', 'extension/src/webview/**/*'],
rules: {
'import/extensions': 'off',
},
},
],
}
const typescriptAdvancedConfig = {
...baseConfig,
parser: '@typescript-eslint/parser',
parserOptions: {
project: [
'./cli/tsconfig.json',
'./packages/cli/tsconfig.json',
'./packages/sdk/tsconfig.json',
],
},
rules: {
...baseConfig.rules,
'@typescript-eslint/no-floating-promises': 'error',
},
}
module.exports = typescriptAdvancedConfig