@typescript-eslint/eslint-plugin 8.67.1-alpha.21 → 8.67.1-alpha.23

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.
@@ -72,15 +72,19 @@ exports.default = (0, util_1.createRule)({
72
72
  return;
73
73
  }
74
74
  const scope = context.sourceCode.getScope(node);
75
- const mergedWithClassDeclaration = scope.set
75
+ const mergedWithOtherDeclaration = scope.set
76
76
  .get(node.id.name)
77
- ?.defs.some(def => def.node.type === utils_1.AST_NODE_TYPES.ClassDeclaration);
77
+ ?.defs.some(def => def.node !== node &&
78
+ (def.node.type === utils_1.AST_NODE_TYPES.ClassDeclaration ||
79
+ def.node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration));
80
+ const isDefaultExport = node.parent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration;
81
+ const shouldSuggest = !mergedWithOtherDeclaration && !isDefaultExport;
78
82
  if (extend.length === 0) {
79
83
  context.report({
80
84
  node: node.id,
81
85
  messageId: 'noEmptyInterface',
82
86
  data: { option: 'allowInterfaces' },
83
- ...(!mergedWithClassDeclaration && {
87
+ ...(shouldSuggest && {
84
88
  suggest: ['object', 'unknown'].map(replacement => ({
85
89
  messageId: 'replaceEmptyInterface',
86
90
  data: { replacement },
@@ -99,7 +103,7 @@ exports.default = (0, util_1.createRule)({
99
103
  context.report({
100
104
  node: node.id,
101
105
  messageId: 'noEmptyInterfaceWithSuper',
102
- ...(!mergedWithClassDeclaration && {
106
+ ...(shouldSuggest && {
103
107
  suggest: [
104
108
  {
105
109
  messageId: 'replaceEmptyInterfaceWithSuper',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/eslint-plugin",
3
- "version": "8.67.1-alpha.21",
3
+ "version": "8.67.1-alpha.23",
4
4
  "description": "TypeScript plugin for ESLint",
5
5
  "files": [
6
6
  "dist",
@@ -47,10 +47,10 @@
47
47
  ],
48
48
  "dependencies": {
49
49
  "@eslint-community/regexpp": "^4.12.2",
50
- "@typescript-eslint/scope-manager": "8.67.1-alpha.21",
51
- "@typescript-eslint/type-utils": "8.67.1-alpha.21",
52
- "@typescript-eslint/utils": "8.67.1-alpha.21",
53
- "@typescript-eslint/visitor-keys": "8.67.1-alpha.21",
50
+ "@typescript-eslint/scope-manager": "8.67.1-alpha.23",
51
+ "@typescript-eslint/type-utils": "8.67.1-alpha.23",
52
+ "@typescript-eslint/utils": "8.67.1-alpha.23",
53
+ "@typescript-eslint/visitor-keys": "8.67.1-alpha.23",
54
54
  "ignore": "^7.0.5",
55
55
  "natural-compare": "^1.4.0",
56
56
  "ts-api-utils": "^2.5.0"
@@ -60,8 +60,8 @@
60
60
  "@types/mdast": "^4.0.4",
61
61
  "@types/natural-compare": "^1.4.3",
62
62
  "@types/react": "^18.3.21",
63
- "@typescript-eslint/rule-schema-to-typescript-types": "8.67.1-alpha.21",
64
- "@typescript-eslint/rule-tester": "8.67.1-alpha.21",
63
+ "@typescript-eslint/rule-schema-to-typescript-types": "8.67.1-alpha.23",
64
+ "@typescript-eslint/rule-tester": "8.67.1-alpha.23",
65
65
  "@typescript/native": "npm:typescript@^7.0.2",
66
66
  "@vitest/coverage-v8": "^4.0.18",
67
67
  "ajv": "^6.12.6",
@@ -81,7 +81,7 @@
81
81
  "vitest": "^4.0.18"
82
82
  },
83
83
  "peerDependencies": {
84
- "@typescript-eslint/parser": "^8.67.1-alpha.21",
84
+ "@typescript-eslint/parser": "^8.67.1-alpha.23",
85
85
  "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
86
86
  "typescript": ">=4.8.4 <6.1.0"
87
87
  },