-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.cjs
89 lines (88 loc) · 2.5 KB
/
index.cjs
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
module.exports = {
plugins: ['@typescript-eslint', 'import', 'prefer-arrow'],
env: {
browser: true,
es2021: true,
node: true,
},
ignorePatterns: [
'dist',
'node_modules',
'__ignore__',
'*.codegen.ts',
'*.codegen.js',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:unicorn/recommended',
// Make sure this is always the last configuration in the extends array:
'plugin:prettier/recommended',
],
overrides: [
{
files: ['__test__/**', '*.test.*'],
plugins: ['jest'],
extends: ['plugin:jest/recommended', 'plugin:jest/style'],
},
],
rules: {
'prettier/prettier': 'warn',
'no-console': ['warn'],
'no-fallthrough': 'warn',
'no-warning-comments': ['warn', { terms: ['fixme'], location: 'start' }],
'max-lines': [
'warn',
{ max: 600, skipBlankLines: true, skipComments: true },
],
'max-lines-per-function': [
'warn',
{ max: 70, skipBlankLines: true, skipComments: true },
],
'prefer-arrow-callback': 'warn',
'arrow-body-style': 'warn',
'prefer-arrow/prefer-arrow-functions': 'warn',
'func-style': ['warn', 'expression', { allowArrowFunctions: true }],
'import/no-cycle': 'error',
'import/no-default-export': 'warn',
'no-restricted-imports': [
'error',
{
paths: [
{
name: '.',
message:
'Import from current folder is forbidden, please import from a specific file name.',
},
],
patterns: [
{
group: ['./*/index', '../*/index', '@/*/index'],
message:
'Avoid importing the "index" file directly, please import the file directory instead.',
},
{
group: ['../../../*'],
message:
'Relative path is too long, please use package root "@" instead.',
},
{
group: ['@/../../*'],
message:
'Please import package from "@neuledge" namespace instead.',
},
{
group: ['@neuledge/*/lib', '@neuledge/*/dist'],
message: 'Avoid importing generated folders.',
},
],
},
],
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'unicorn/explicit-length-check': 'off',
'unicorn/prefer-number-properties': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-null': 'off',
},
};