eslint-plugin-svelte
Advanced tools
Comparing version 2.35.0 to 2.35.1
export declare const name: "eslint-plugin-svelte"; | ||
export declare const version: "2.35.0"; | ||
export declare const version: "2.35.1"; |
@@ -5,2 +5,2 @@ "use strict"; | ||
exports.name = 'eslint-plugin-svelte'; | ||
exports.version = '2.35.0'; | ||
exports.version = '2.35.1'; |
@@ -113,4 +113,5 @@ "use strict"; | ||
CallExpression(node) { | ||
const typeArguments = node.typeArguments ?? node.typeParameters; | ||
const firstToken = sourceCode.getFirstToken(node); | ||
const leftParenToken = sourceCode.getTokenAfter(node.typeParameters || node.callee, { | ||
const leftParenToken = sourceCode.getTokenAfter(typeArguments || node.callee, { | ||
filter: eslint_utils_1.isOpeningParenToken, | ||
@@ -120,6 +121,6 @@ includeComments: false | ||
const rightParenToken = sourceCode.getLastToken(node); | ||
if (node.typeParameters) { | ||
offsets.setOffsetToken(sourceCode.getFirstToken(node.typeParameters), 1, firstToken); | ||
if (typeArguments) { | ||
offsets.setOffsetToken(sourceCode.getFirstToken(typeArguments), 1, firstToken); | ||
} | ||
for (const optionalToken of sourceCode.getTokensBetween(sourceCode.getLastToken(node.typeParameters || node.callee), leftParenToken, { filter: isOptionalToken, includeComments: false })) { | ||
for (const optionalToken of sourceCode.getTokensBetween(sourceCode.getLastToken(typeArguments || node.callee), leftParenToken, { filter: isOptionalToken, includeComments: false })) { | ||
offsets.setOffsetToken(optionalToken, 1, firstToken); | ||
@@ -537,9 +538,10 @@ } | ||
NewExpression(node) { | ||
const typeArguments = node.typeArguments ?? node.typeParameters; | ||
const newToken = sourceCode.getFirstToken(node); | ||
const calleeTokens = (0, commons_1.getFirstAndLastTokens)(sourceCode, node.callee); | ||
offsets.setOffsetToken(calleeTokens.firstToken, 1, newToken); | ||
if (node.typeParameters) { | ||
offsets.setOffsetToken(sourceCode.getFirstToken(node.typeParameters), 1, calleeTokens.firstToken); | ||
if (typeArguments) { | ||
offsets.setOffsetToken(sourceCode.getFirstToken(typeArguments), 1, calleeTokens.firstToken); | ||
} | ||
const leftParenBefore = node.typeParameters || calleeTokens.lastToken; | ||
const leftParenBefore = typeArguments || calleeTokens.lastToken; | ||
if (node.arguments.length || leftParenBefore.range[1] < node.range[1]) { | ||
@@ -546,0 +548,0 @@ const rightParenToken = sourceCode.getLastToken(node); |
@@ -31,5 +31,6 @@ "use strict"; | ||
TSTypeReference(node) { | ||
if (node.typeParameters) { | ||
const typeArguments = node.typeArguments ?? node.typeParameters; | ||
if (typeArguments) { | ||
const firstToken = sourceCode.getFirstToken(node); | ||
offsets.setOffsetToken(sourceCode.getFirstToken(node.typeParameters), 1, firstToken); | ||
offsets.setOffsetToken(sourceCode.getFirstToken(typeArguments), 1, firstToken); | ||
} | ||
@@ -255,4 +256,5 @@ }, | ||
TSClassImplements(node) { | ||
if (node.typeParameters) { | ||
offsets.setOffsetToken(sourceCode.getFirstToken(node.typeParameters), 1, sourceCode.getFirstToken(node)); | ||
const typeArguments = node.typeArguments ?? node.typeParameters; | ||
if (typeArguments) { | ||
offsets.setOffsetToken(sourceCode.getFirstToken(typeArguments), 1, sourceCode.getFirstToken(node)); | ||
} | ||
@@ -439,2 +441,3 @@ }, | ||
TSImportType(node) { | ||
const typeArguments = node.typeArguments ?? node.typeParameters; | ||
const firstToken = sourceCode.getFirstToken(node); | ||
@@ -458,4 +461,4 @@ const leftParenToken = sourceCode.getTokenAfter(firstToken, { | ||
} | ||
if (node.typeParameters) { | ||
offsets.setOffsetToken(sourceCode.getFirstToken(node.typeParameters), 1, firstToken); | ||
if (typeArguments) { | ||
offsets.setOffsetToken(sourceCode.getFirstToken(typeArguments), 1, firstToken); | ||
} | ||
@@ -717,4 +720,5 @@ }, | ||
} | ||
if (node.superTypeParameters != null && node.superClass != null) { | ||
offsets.setOffsetToken(sourceCode.getFirstToken(node.superTypeParameters), 1, sourceCode.getFirstToken(node.superClass)); | ||
const superTypeArguments = node.superTypeArguments ?? node.superTypeParameters; | ||
if (superTypeArguments != null && node.superClass != null) { | ||
offsets.setOffsetToken(sourceCode.getFirstToken(superTypeArguments), 1, sourceCode.getFirstToken(node.superClass)); | ||
} | ||
@@ -721,0 +725,0 @@ if (node.implements != null && node.implements.length) { |
@@ -43,3 +43,3 @@ "use strict"; | ||
const node = n; | ||
if (node.typeParameters === undefined) { | ||
if ((node.typeArguments ?? node.typeParameters) === undefined) { | ||
context.report({ node, messageId: 'missingTypeParameter' }); | ||
@@ -46,0 +46,0 @@ } |
{ | ||
"name": "eslint-plugin-svelte", | ||
"version": "2.35.0", | ||
"version": "2.35.1", | ||
"description": "ESLint plugin for Svelte using AST", | ||
@@ -135,3 +135,3 @@ "repository": "git+https://github.com/sveltejs/eslint-plugin-svelte.git", | ||
"stylelint-config-standard": "^34.0.0", | ||
"stylus": "^0.61.0", | ||
"stylus": "^0.62.0", | ||
"svelte": "^4.0.0", | ||
@@ -143,3 +143,3 @@ "svelte-adapter-ghpages": "0.1.0", | ||
"typescript": "~5.1.0", | ||
"vite": "^4.0.0", | ||
"vite": "^5.0.0", | ||
"vite-plugin-svelte-md": "^0.1.7", | ||
@@ -146,0 +146,0 @@ "yaml": "^2.1.1" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
563946
12727