@voiceflow/eslint-config 7.3.2 → 7.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/index.js +2 -1
- package/src/presets/common.js +1 -0
- package/src/presets/nest.js +10 -0
- package/src/presets/typescript.js +2 -0
- package/src/presets/utility.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voiceflow/eslint-config",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.4",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"src"
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"lint:eslint": "yarn g:eslint",
|
|
11
11
|
"lint:fix": "yarn g:run-p -c \"lint:eslint --fix\" \"lint:prettier --write\"",
|
|
12
12
|
"lint:prettier": "yarn g:prettier --check",
|
|
13
|
+
"test": "yarn test:dependencies",
|
|
13
14
|
"test:dependencies": "yarn g:depcruise"
|
|
14
15
|
},
|
|
15
16
|
"dependencies": {
|
|
@@ -36,5 +37,5 @@
|
|
|
36
37
|
"volta": {
|
|
37
38
|
"extends": "../../package.json"
|
|
38
39
|
},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "820ec7568fff4fe6d8a1671c0c14048d722dd73c"
|
|
40
41
|
}
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const base = require('./base');
|
|
2
2
|
const typescript = require('./presets/typescript');
|
|
3
|
+
const nest = require('./presets/nest');
|
|
3
4
|
const utility = require('./presets/utility');
|
|
4
5
|
|
|
5
6
|
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
6
|
-
module.exports = [...base, typescript, utility];
|
|
7
|
+
module.exports = [...base, typescript, nest, utility];
|
package/src/presets/common.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
files: ['**/*.controller.ts', '**/*.decorator.ts', '**/*.factory.ts', '**/*.module.ts', '**/*.service.ts'],
|
|
3
|
+
|
|
4
|
+
rules: {
|
|
5
|
+
// NestJS imports can be considered "unused" by this rule, but NestJS uses them for dependency injection.
|
|
6
|
+
// We can enforce no type imports to ensure that NestJS can inject correctly.
|
|
7
|
+
// See: https://github.com/typescript-eslint/typescript-eslint/issues/2559#issuecomment-692780580
|
|
8
|
+
'@typescript-eslint/consistent-type-imports': ['off'],
|
|
9
|
+
},
|
|
10
|
+
};
|
|
@@ -29,11 +29,13 @@ module.exports = {
|
|
|
29
29
|
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
|
|
30
30
|
|
|
31
31
|
// off
|
|
32
|
+
'no-undef': 'off',
|
|
32
33
|
'no-shadow': 'off',
|
|
33
34
|
'no-redeclare': 'off',
|
|
34
35
|
'no-unused-vars': 'off',
|
|
35
36
|
'no-use-before-define': 'off',
|
|
36
37
|
'no-useless-constructor': 'off',
|
|
38
|
+
'no-empty-function': ['error', { allow: ['constructors'] }],
|
|
37
39
|
|
|
38
40
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
39
41
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
package/src/presets/utility.js
CHANGED