-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.js
75 lines (70 loc) · 1.97 KB
/
node.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
require("@rushstack/eslint-config/patch/modern-module-resolution")
const { ignorePatterns, parserOptions, plugins } = require("../options")
const {
linesAroundComment,
preferArrowFunctions,
tsNamingConvention,
simpleImportSort
} = require("../rules")
const {
anyInTypes,
barrels,
javascript,
markdown,
typeDefinitions,
typescript
} = require("../overrides")
const { when } = require("../utils")
/**
* NodeJS ESLint profile.
*
* @remarks
* This profile is intended for use within NodeJS applications.
* Rules may not be appropriate for browser applications.
*
* @public
*/
module.exports = {
/* Environment linter should expect. */
env: {
node: true
},
/* List of patterns to ignore. */
ignorePatterns,
/* Default parser options for TypeScript. */
parserOptions,
/* Third-party plugins to load. */
plugins,
/* Main rule definitions used across all matched files. */
rules: {
"@rushstack/no-new-null": "off",
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/naming-convention": ["warn", tsNamingConvention],
"@typescript-eslint/no-floating-promises": when("test"),
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/typedef": "off",
"arrow-body-style": ["error", "as-needed"],
"block-spacing": "error",
"import/order": "off",
"lines-around-comment": ["error", linesAroundComment],
"no-console": when("production"),
"no-debugger": when("production"),
"no-return-await": "off",
"no-unused-vars": "off",
"object-curly-spacing": ["error", "always"],
"prefer-arrow/prefer-arrow-functions": ["error", preferArrowFunctions],
"simple-import-sort/exports": "error",
"simple-import-sort/imports": ["error", simpleImportSort],
"tsdoc/syntax": "error"
},
/* Pattern specific overrides. */
overrides: [
anyInTypes,
barrels,
javascript,
markdown,
typeDefinitions,
typescript
]
}