@stylistic/eslint-plugin-jsx
Advanced tools
Comparing version 2.11.0 to 2.12.0
@@ -102,3 +102,3 @@ 'use strict'; | ||
} | ||
function trimTokenBeforeNewline(node, tokenBefore) { | ||
function trimTokenBeforeNewline(tokenBefore) { | ||
const isBracket = tokenBefore.value === "{" || tokenBefore.value === "["; | ||
@@ -121,6 +121,8 @@ return `${tokenBefore.value.trim()}${isBracket ? "" : " "}`; | ||
if (!utils.isParenthesized(node, context.sourceCode)) { | ||
const tokenBefore = sourceCode.getTokenBefore(node, { includeComments: true }); | ||
const tokenAfter = sourceCode.getTokenAfter(node, { includeComments: true }); | ||
const tokenBefore = sourceCode.getTokenBefore(node); | ||
const tokenAfter = sourceCode.getTokenAfter(node); | ||
const start = node.loc.start; | ||
if (tokenBefore.loc.end.line < start.line) { | ||
const textBetween = sourceCode.getText().slice(tokenBefore.range[1], node.range[0]).trim(); | ||
const indent = start.column > 0 ? " ".repeat(start.column) : ""; | ||
context.report({ | ||
@@ -134,4 +136,5 @@ node, | ||
], | ||
`${trimTokenBeforeNewline(node, tokenBefore)}( | ||
${start.column > 0 ? " ".repeat(start.column) : ""}${sourceCode.getText(node)} | ||
`${trimTokenBeforeNewline(tokenBefore)}( | ||
${indent}${textBetween}${textBetween.length > 0 ? ` | ||
${indent}` : ""}${sourceCode.getText(node)} | ||
${start.column > 0 ? " ".repeat(start.column - 2) : ""})` | ||
@@ -138,0 +141,0 @@ ) |
{ | ||
"name": "@stylistic/eslint-plugin-jsx", | ||
"type": "commonjs", | ||
"version": "2.11.0", | ||
"version": "2.12.0", | ||
"author": "Anthony Fu <anthonyfu117@hotmail.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
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
154231
4347