forked from readmeio/rdme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
50 lines (47 loc) · 1.61 KB
/
.eslintrc
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
{
"extends": [
"@readme/eslint-config",
"@readme/eslint-config/typescript"
],
"root": true,
"parserOptions": {
"ecmaVersion": 2020
},
"overrides": [
{
"files": ["bin/set-version-output", "config/*.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
],
"rules": {
"@typescript-eslint/ban-types": ["error", {
"types": {
// We specify `{}` in `CommandOptions` generics when those commands don't have their own
// options and it's cleaner for us to do that than `Record<string, unknown>`.
"{}": false
}
}],
/**
* Because our command classes have a `run` method that might not always call `this` we need to
* explicitly exclude `run` from this rule.
*/
"class-methods-use-this": ["error", { "exceptMethods": ["run"] }],
/**
* This is a small rule to prevent us from using console.log() statements in our commands.
*
* We've had troubles in the past where our test coverage required us to use Jest mocks for
* console.log() calls, hurting our ability to write resilient tests and easily debug issues.
*
* We should be returning Promise-wrapped values in our main command functions
* so we can write robust tests and take advantage of `bin/rdme`,
* which we use for printing function outputs and returning correct exit codes.
*
* Furthermore, we should also be using our custom loggers (see src/lib/logger.js)
* instead of using console.info() or console.warn() statements.
*/
"no-console": "warn",
"no-restricted-syntax": "off"
}
}