Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f679786

Browse files
committed
chore(plugin-typescript): fix some tests
1 parent f68d82c commit f679786

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

packages/eslint-plugin-typescript/lib/rules/adjacent-overload-signatures.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module.exports = {
4747
// have no declarations, so ignore them
4848
return member.declaration ? getMemberName(member.declaration) : null;
4949
}
50-
case 'DeclareFunction':
50+
case 'TSDeclareFunction':
5151
case 'FunctionDeclaration':
5252
case 'TSNamespaceFunctionDeclaration':
5353
case 'TSEmptyBodyFunctionDeclaration':
@@ -60,10 +60,10 @@ module.exports = {
6060
(member.name && (member.name.name || member.name.value))
6161
);
6262
}
63-
case 'TSCallSignature': {
63+
case 'TSCallSignatureDeclaration': {
6464
return 'call';
6565
}
66-
case 'TSConstructSignature': {
66+
case 'TSConstructSignatureDeclaration': {
6767
return 'new';
6868
}
6969
case 'MethodDefinition': {

packages/eslint-plugin-typescript/lib/rules/member-ordering.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ module.exports = {
217217
case 'TSPropertySignature':
218218
case 'TSMethodSignature':
219219
return node.key.name;
220-
case 'TSConstructSignature':
220+
case 'TSConstructSignatureDeclaration':
221221
return 'new';
222222
default:
223223
return null;

packages/eslint-plugin-typescript/lib/rules/no-object-literal-type-assertion.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ module.exports = {
3838
* @returns {*} true or false
3939
*/
4040
function checkType(node) {
41-
if (node && node.type === 'TSTypeAnnotation' && node.typeAnnotation) {
42-
switch (node.typeAnnotation.type) {
41+
if (node) {
42+
switch (node.type) {
4343
case 'TSAnyKeyword':
4444
case 'TSUnknownKeyword':
4545
return false;
@@ -51,7 +51,7 @@ module.exports = {
5151
}
5252

5353
return {
54-
'TSTypeAssertionExpression, TSAsExpression'(node) {
54+
'TSTypeAssertion, TSAsExpression'(node) {
5555
if (
5656
checkType(node.typeAnnotation) &&
5757
node.expression.type === 'ObjectExpression'

packages/eslint-plugin-typescript/lib/rules/no-unused-vars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module.exports = Object.assign({}, baseRule, {
5353
'TSTypeReference Identifier'(node) {
5454
context.markVariableAsUsed(node.name);
5555
},
56-
'ClassImplements Identifier'(node) {
56+
'TSClassImplements Identifier'(node) {
5757
context.markVariableAsUsed(node.name);
5858
},
5959
'TSParameterProperty Identifier'(node) {

0 commit comments

Comments
 (0)