-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.eslintrc.js
64 lines (62 loc) · 2.14 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
/** @type {import("eslint").Linter.Config} */
module.exports = {
env: {
es6: true,
},
extends: ['react-app', 'plugin:storybook/recommended'],
plugins: ['no-only-tests', 'simple-import-sort', 'unused-imports'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
},
overrides: [
{
files: [
'pages/**.tsx',
'pages/**/*.tsx',
'./tailwind.config.js',
'src/components/**/*.stories.tsx',
],
rules: {
'import/no-default-export': 'off',
},
},
],
rules: {
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
allowDirectConstAssertionInArrowFunctions: true,
},
],
'@typescript-eslint/no-useless-constructor': 'error',
// this gets inlined into a package eslint, so it means: use current package's package.info or the one at the project root
'import/no-extraneous-dependencies': [
'error',
{ packageDir: ['./', __dirname] },
],
// this rule can't find automatically mistakes and needs to be guided
'import/no-internal-modules': ['error', { forbid: ['**/utils/*'] }],
'import/no-useless-path-segments': ['error', { noUselessIndex: true }],
'no-console': 'error',
'no-debugger': 'error',
'no-only-tests/no-only-tests': 'error',
'no-with': 'error',
'one-var': ['error', { initialized: 'never' }],
'prefer-const': ['error', { destructuring: 'all' }],
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'unused-imports/no-unused-imports-ts': 'error',
'storybook/no-redundant-story-name': 'off',
'storybook/prefer-pascal-case': 'off',
// Extracted from typestrict, because of @typescript-eslint react-app - typestrict conflict
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
},
};