@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voiceflow/eslint-config",
3
- "version": "7.3.2",
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": "2630533e0ac88531992cfed2551626f6b7c33127"
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];
@@ -104,6 +104,7 @@ module.exports = [
104
104
  'promise/no-return-wrap': 'off',
105
105
  'promise/no-promise-in-callback': 'off',
106
106
  'promise/no-callback-in-promise': 'off',
107
+ 'promise/no-nesting': 'off',
107
108
  },
108
109
  },
109
110
  ];
@@ -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',
@@ -1,4 +1,4 @@
1
- const EXTENSIONS = ['js', 'jsx', 'cjs', 'mjs', 'ts', 'tsx', 'cts', 'mts'].join(',');
1
+ const EXTENSIONS = `{${['js', 'jsx', 'cjs', 'mjs', 'ts', 'tsx', 'cts', 'mts'].join(',')}}`;
2
2
 
3
3
  /** @type {import('eslint').Linter.FlatConfig} */
4
4
  module.exports = {