forked from runtipi/runtipi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
108 lines (108 loc) · 2.92 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
module.exports = {
plugins: ['@typescript-eslint', 'import', 'react', 'jsx-a11y'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'next/core-web-vitals',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
rules: {
'import/no-cycle': 2,
'import/no-named-as-default-member': 0,
'import/no-named-as-default': 0,
'no-console': 1,
'@typescript-eslint/no-floating-promises': 1,
'no-restricted-exports': 0,
'no-redeclare': 0, // already handled by @typescript-eslint/no-redeclare
'react/display-name': 0,
'react/prop-types': 0,
'react/function-component-definition': 0,
'react/require-default-props': 0,
'import/prefer-default-export': 0,
'react/jsx-props-no-spreading': 0,
'react/no-unused-prop-types': 0,
'react/button-has-type': 0,
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'esbuild.js',
'e2e/**',
'**/*.test.{ts,tsx}',
'**/*.spec.{ts,tsx}',
'**/*.factory.{ts,tsx}',
'**/mocks/**',
'**/__mocks__/**',
'**/tests/**',
'**/*.d.ts',
'**/*.workspace.ts',
'**/*.setup.{ts,js}',
'**/*.config.{ts,js}',
],
},
],
'no-underscore-dangle': 0,
'arrow-body-style': 0,
'class-methods-use-this': 0,
'import/extensions': [
'error',
'ignorePackages',
{
'': 'never',
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
overrides: [
{
files: ['*.test.ts', '*.test.tsx'],
plugins: ['jest', 'jest-dom', 'testing-library'],
extends: ['plugin:jest-dom/recommended', 'plugin:testing-library/react'],
},
{
files: ['**/*.json', '*.json5', '*.jsonc'],
plugins: ['jsonc'],
extends: ['plugin:jsonc/recommended-with-json', 'plugin:jsonc/prettier'],
parser: 'jsonc-eslint-parser',
rules: {
// Disable all @typescript-eslint rules as they don't apply here
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/return-await': 'off',
// jsonc rules
'jsonc/sort-keys': 2,
'jsonc/key-name-casing': 1,
},
},
],
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
globals: {
JSX: true,
NodeJS: true,
},
};