@voiceflow/eslint-config 7.5.1 → 7.6.0

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.5.1",
3
+ "version": "7.6.0",
4
4
  "main": "src/index.js",
5
5
  "files": [
6
6
  "src"
@@ -14,25 +14,25 @@
14
14
  "test:dependencies": "yarn g:depcruise --ignore-known"
15
15
  },
16
16
  "dependencies": {
17
- "@typescript-eslint/eslint-plugin": "7.6.0",
18
- "@typescript-eslint/parser": "7.6.0",
17
+ "@typescript-eslint/eslint-plugin": "8.8.1",
18
+ "@typescript-eslint/parser": "8.8.1",
19
19
  "eslint-config-airbnb-base": "15.0.0",
20
20
  "eslint-config-prettier": "9.1.0",
21
21
  "eslint-formatter-junit": "8.40.0",
22
22
  "eslint-formatter-stylish": "8.40.0",
23
- "eslint-import-resolver-typescript": "3.6.1",
23
+ "eslint-import-resolver-typescript": "3.6.3",
24
24
  "eslint-plugin-eslint-comments": "3.2.0",
25
- "eslint-plugin-import": "2.29.1",
26
- "eslint-plugin-jsdoc": "48.2.3",
27
- "eslint-plugin-no-secrets": "0.8.9",
25
+ "eslint-plugin-import": "2.31.0",
26
+ "eslint-plugin-jsdoc": "50.3.1",
27
+ "eslint-plugin-no-secrets": "1.0.2",
28
28
  "eslint-plugin-prefer-arrow": "1.2.3",
29
- "eslint-plugin-prettier": "5.1.3",
30
- "eslint-plugin-promise": "6.1.1",
31
- "eslint-plugin-simple-import-sort": "12.0.0",
32
- "eslint-plugin-sonarjs": "1.0.4",
33
- "eslint-plugin-unicorn": "52.0.0",
29
+ "eslint-plugin-prettier": "5.2.1",
30
+ "eslint-plugin-promise": "7.1.0",
31
+ "eslint-plugin-simple-import-sort": "12.1.1",
32
+ "eslint-plugin-sonarjs": "2.0.3",
33
+ "eslint-plugin-unicorn": "56.0.0",
34
34
  "eslint-plugin-you-dont-need-lodash-underscore": "6.14.0",
35
- "globals": "15.0.0"
35
+ "globals": "15.10.0"
36
36
  },
37
37
  "engines": {
38
38
  "node": "20"
@@ -40,5 +40,5 @@
40
40
  "volta": {
41
41
  "extends": "../../package.json"
42
42
  },
43
- "gitHead": "853e732b2546d81b52e8791a8ecfe752df5fffe1"
43
+ "gitHead": "d582018fe065bbf6530a0444ed5c156745fd4f83"
44
44
  }
package/src/base.js CHANGED
@@ -2,10 +2,18 @@ const airbnb = require('./presets/airbnb');
2
2
  const common = require('./presets/common');
3
3
  const import_ = require('./presets/import');
4
4
 
5
- /** @type {import('eslint').Linter.FlatConfig[]} */
5
+ /** @type {import('eslint').Linter.Config[]} */
6
6
  module.exports = [
7
7
  {
8
- ignores: ['**/build/**', '**/dist/**', '**/node_modules/**', '**/sonar/**', '**/.yarn/**', '**/.yalc/**'],
8
+ ignores: [
9
+ '**/build/**',
10
+ '**/dist/**',
11
+ '**/node_modules/**',
12
+ '**/sonar/**',
13
+ '**/.yarn/**',
14
+ '**/.yalc/**',
15
+ '**/.turbo/**',
16
+ ],
9
17
  },
10
18
  ...airbnb,
11
19
  ...common,
package/src/index.js CHANGED
@@ -3,5 +3,5 @@ const typescript = require('./presets/typescript');
3
3
  const nest = require('./presets/nest');
4
4
  const utility = require('./presets/utility');
5
5
 
6
- /** @type {import('eslint').Linter.FlatConfig[]} */
6
+ /** @type {import('eslint').Linter.Config[]} */
7
7
  module.exports = [...base, typescript, nest, utility];
@@ -6,5 +6,5 @@ const airbnbStrict = require('eslint-config-airbnb-base/rules/strict');
6
6
  const { env: _nodeEnv, ...airbnbNode } = require('eslint-config-airbnb-base/rules/node');
7
7
  const { env: _es6Env, parserOptions: _es6Parser, ...airbnbES6 } = require('eslint-config-airbnb-base/rules/es6');
8
8
 
9
- /** @type {import('eslint').Linter.FlatConfig[]} */
9
+ /** @type {import('eslint').Linter.Config[]} */
10
10
  module.exports = [airbnbBestPractices, airbnbErrors, airbnbNode, airbnbStyle, airbnbVariables, airbnbES6, airbnbStrict];
@@ -8,7 +8,7 @@ const unicorn = require('eslint-plugin-unicorn');
8
8
  const prettier = require('eslint-plugin-prettier/recommended');
9
9
  const jsdoc = require('eslint-plugin-jsdoc');
10
10
 
11
- /** @type {import('eslint').Linter.FlatConfig[]} */
11
+ /** @type {import('eslint').Linter.Config[]} */
12
12
  module.exports = [
13
13
  {
14
14
  plugins: {
@@ -85,6 +85,8 @@ module.exports = [
85
85
 
86
86
  // warn
87
87
  'sonarjs/no-duplicate-string': 'warn',
88
+ 'sonarjs/todo-tag': 'warn',
89
+ 'sonarjs/fixme-tag': 'warn',
88
90
 
89
91
  // off
90
92
  'no-plusplus': 'off',
@@ -97,18 +99,19 @@ module.exports = [
97
99
  camelcase: 'off',
98
100
  'no-underscore-dangle': 'off',
99
101
  'no-restricted-syntax': 'off',
100
-
101
- // incompatible with eslint 9
102
- 'sonarjs/no-gratuitous-expressions': 'off',
103
- 'sonarjs/no-extra-arguments': 'off',
104
- 'sonarjs/no-use-of-empty-return-value': 'off',
105
- 'sonarjs/no-empty-collection': 'off',
106
- 'sonarjs/no-unused-collection': 'off',
107
- 'sonarjs/no-redundant-jump': 'off',
108
- 'promise/no-return-wrap': 'off',
109
- 'promise/no-promise-in-callback': 'off',
110
- 'promise/no-callback-in-promise': 'off',
111
- 'promise/no-nesting': 'off',
102
+ 'sonarjs/no-unreachable': 'off',
103
+ 'sonarjs/no-commented-code': 'off',
104
+ 'sonarjs/no-hardcoded-credentials': 'off', // covered by no-secrets
105
+ 'sonarjs/use-type-alias': 'off', // too rigid to be useful
106
+ 'sonarjs/no-unstable-nested-components': 'off', // too rigid to be useful
107
+ 'sonarjs/prefer-function-type': 'off', // too rigid to be useful
108
+ 'sonarjs/assertions-in-tests': 'off', // too rigid to be useful
109
+ 'sonarjs/no-empty-test-file': 'off', // too rigid to be useful
110
+ 'sonarjs/no-nested-conditional': 'off', // covered by no-nested-ternary
111
+ 'sonarjs/sonar-no-unused-vars': 'off', // covered by other rules
112
+ 'sonarjs/no-empty-function': 'off', // covered by other rules
113
+ 'sonarjs/constructor-for-side-effects': 'off', // covered by other rules
114
+ 'sonarjs/sonar-max-params': 'off', // covered by other rules
112
115
  },
113
116
  },
114
117
  ];
@@ -7,7 +7,7 @@ const {
7
7
  ...airbnbImports
8
8
  } = require('eslint-config-airbnb-base/rules/imports');
9
9
 
10
- /** @type {import('eslint').Linter.FlatConfig[]} */
10
+ /** @type {import('eslint').Linter.Config[]} */
11
11
  module.exports = [
12
12
  {
13
13
  plugins: {
@@ -1,3 +1,4 @@
1
+ /** @type {import('eslint').Linter.Config} */
1
2
  module.exports = {
2
3
  files: ['**/*.controller.ts', '**/*.decorator.ts', '**/*.factory.ts', '**/*.module.ts', '**/*.service.ts'],
3
4
 
@@ -1,7 +1,7 @@
1
1
  const typescript = require('@typescript-eslint/eslint-plugin');
2
2
  const typescriptParser = require('@typescript-eslint/parser');
3
3
 
4
- /** @type {import('eslint').Linter.FlatConfig} */
4
+ /** @type {import('eslint').Linter.Config} */
5
5
  module.exports = {
6
6
  files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],
7
7
 
@@ -24,6 +24,13 @@ module.exports = {
24
24
  allowSingleExtends: true,
25
25
  },
26
26
  ],
27
+ '@typescript-eslint/no-empty-object-type': [
28
+ 'error',
29
+ {
30
+ // Allow `interface T extends U {}`
31
+ allowInterfaces: 'with-single-extends',
32
+ },
33
+ ],
27
34
  '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
28
35
  '@typescript-eslint/no-unused-vars': [
29
36
  'error',
@@ -1,6 +1,6 @@
1
1
  const EXTENSIONS = `{${['js', 'jsx', 'cjs', 'mjs', 'ts', 'tsx', 'cts', 'mts'].join(',')}}`;
2
2
 
3
- /** @type {import('eslint').Linter.FlatConfig} */
3
+ /** @type {import('eslint').Linter.Config} */
4
4
  module.exports = {
5
5
  files: [
6
6
  `**/*.test.${EXTENSIONS}`,
@@ -21,5 +21,7 @@ module.exports = {
21
21
  'promise/catch-or-return': 'off',
22
22
  'promise/always-return': 'off',
23
23
  'promise/no-nesting': 'off',
24
+ 'sonarjs/no-clear-text-protocols': 'off',
25
+ 'sonarjs/no-nested-functions': 'off',
24
26
  },
25
27
  };