|
1
|
const path = require("path") |
|
2
|
|
|
3
|
module.exports = { |
|
4
|
root: true, |
|
5
|
parser: "@babel/eslint-parser", |
|
6
|
parserOptions: { |
|
7
|
requireConfigFile: false, |
|
8
|
ecmaFeatures: { |
|
9
|
experimentalDecorators: true, |
|
10
|
}, |
|
11
|
project: true, |
|
12
|
}, |
|
13
|
plugins: ["prettier"], |
|
14
|
extends: [ |
|
15
|
"eslint:recommended", |
|
16
|
"plugin:prettier/recommended", |
|
17
|
], |
|
18
|
rules: { |
|
19
|
curly: ["error", "all"], |
|
20
|
"new-cap": "off", |
|
21
|
"require-jsdoc": "off", |
|
22
|
"no-unused-expressions": "off", |
|
23
|
"no-unused-vars": "off", |
|
24
|
camelcase: "off", |
|
25
|
"no-invalid-this": "off", |
|
26
|
"max-len": [ |
|
27
|
"error", |
|
28
|
{ |
|
29
|
code: 80, |
|
30
|
ignoreStrings: true, |
|
31
|
ignoreRegExpLiterals: true, |
|
32
|
ignoreComments: true, |
|
33
|
ignoreTrailingComments: true, |
|
34
|
ignoreUrls: true, |
|
35
|
ignoreTemplateLiterals: true, |
|
36
|
}, |
|
37
|
], |
|
38
|
semi: ["error", "never"], |
|
39
|
quotes: [ |
|
40
|
"error", |
|
41
|
"double", |
|
42
|
{ |
|
43
|
allowTemplateLiterals: true, |
|
44
|
}, |
|
45
|
], |
|
46
|
"comma-dangle": [ |
|
47
|
"error", |
|
48
|
{ |
|
49
|
arrays: "always-multiline", |
|
50
|
objects: "always-multiline", |
|
51
|
imports: "always-multiline", |
|
52
|
exports: "always-multiline", |
|
53
|
functions: "never", |
|
54
|
}, |
|
55
|
], |
|
56
|
"object-curly-spacing": ["error", "always"], |
|
57
|
"arrow-parens": ["error", "always"], |
|
58
|
"linebreak-style": 0, |
|
59
|
"no-confusing-arrow": [ |
|
60
|
"error", |
|
61
|
{ |
|
62
|
allowParens: false, |
|
63
|
}, |
|
64
|
], |
|
65
|
"space-before-function-paren": [ |
|
66
|
"error", |
|
67
|
{ |
|
68
|
anonymous: "always", |
|
69
|
named: "never", |
|
70
|
asyncArrow: "always", |
|
71
|
}, |
|
72
|
], |
|
73
|
"space-infix-ops": "error", |
|
74
|
"eol-last": ["error", "always"], |
|
75
|
"no-case-declarations": "off" |
|
76
|
}, |
|
77
|
env: { |
|
78
|
es6: true, |
|
79
|
node: true, |
|
80
|
}, |
|
81
|
ignorePatterns: [ |
|
82
|
".eslintrc.js", |
|
83
|
"dist", |
|
84
|
"generated" |
|
85
|
], |
|
86
|
overrides: [ |
|
87
|
{ |
|
88
|
files: ["*.ts", "*.js"], |
|
89
|
plugins: ["@typescript-eslint/eslint-plugin"], |
|
90
|
extends: [ |
|
91
|
"plugin:@typescript-eslint/recommended", |
|
92
|
], |
|
93
|
parser: "@typescript-eslint/parser", |
|
94
|
parserOptions: { |
|
95
|
project: [ |
|
96
|
"./tsconfig.json", |
|
97
|
"./packages/docs-generator/tsconfig.json", |
|
98
|
"./packages/react-docs-generator/tsconfig.json", |
|
99
|
"./packages/release-banner/tsconfig.json", |
|
100
|
"./packages/scripts/tsconfig.json", |
|
101
|
"./packages/typedoc-generate-references/tsconfig.json", |
|
102
|
"./packages/typedoc-plugin-custom/tsconfig.json", |
|
103
|
"./packages/typedoc-markdown-medusa-plugin/tsconfig.json", |
|
104
|
"./packages/types/tsconfig.json", |
|
105
|
"./packages/utils/tsconfig.json", |
|
106
|
"./packages/workflows-diagrams-generator/tsconfig.json" |
|
107
|
] |
|
108
|
}, |
|
109
|
rules: { |
|
110
|
"valid-jsdoc": "off", |
|
111
|
"@typescript-eslint/no-non-null-assertion": "off", |
|
112
|
"@typescript-eslint/no-floating-promises": "error", |
|
113
|
"@typescript-eslint/await-thenable": "error", |
|
114
|
"@typescript-eslint/promise-function-async": "error", |
|
115
|
"@typescript-eslint/keyword-spacing": "error", |
|
116
|
"@typescript-eslint/space-before-function-paren": [ |
|
117
|
"error", |
|
118
|
{ |
|
119
|
anonymous: "always", |
|
120
|
named: "never", |
|
121
|
asyncArrow: "always", |
|
122
|
}, |
|
123
|
], |
|
124
|
"@typescript-eslint/space-infix-ops": "error", |
|
125
|
}, |
|
126
|
} |
|
127
|
], |
|
128
|
} |