forked from xpring-eng/eslint-config-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loose.js
53 lines (47 loc) · 1.75 KB
/
loose.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
module.exports = {
extends: ['./index'].map(require.resolve),
rules: {
// enforce a maximum function length
// TODO: Remove this one?
'max-lines-per-function': [
'warn',
{
max: 50,
skipBlankLines: false,
skipComments: false,
IIFEs: false,
},
],
// Warn when modules have too many dependencies (code smell)
// TODO: Remove this one?
'import/max-dependencies': ['warn', { max: 8 }],
// limits the number of parameters that can be used in the function declaration.
// TODO: Definitely remove this one
'max-params': ['warn', { max: 4 }],
// Disallows assigning `any` to variables and properties
'@typescript-eslint/no-unsafe-assignment': 'off',
// Disallows calling (function calls) on an `any` type value.
'@typescript-eslint/no-unsafe-call': 'off',
// Disallows member access on an `any` type value.
'@typescript-eslint/no-unsafe-member-access': 'off',
// Disallows returning an `any` type value from a function.
'@typescript-eslint/no-unsafe-return': 'off',
// This rule aims to standardize the use of type assertion style across the codebase.
'@typescript-eslint/consistent-type-assertions': [
'error',
{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' },
],
},
overrides: [
{
files: ['test/**/*.ts'],
rules: {
// Warn when modules have too many dependencies (code smell)
// Increased the max for test files and test helper files, since tests usually need to import more things
'import/max-dependencies': ['warn', { max: 8 }],
// describe blocks count as a function in Mocha tests, and can be insanely long
'max-lines-per-function': 'off',
},
},
],
}