From 39b8fedae9d2a71a10cb5b88af56d540e7724071 Mon Sep 17 00:00:00 2001 From: kimtaejin3 Date: Tue, 16 Jul 2024 12:10:33 +0900 Subject: [PATCH] Received feedback to avoid running prettier --- lib/rules/jsx-closing-tag-location.js | 44 ++++++++++++--------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/lib/rules/jsx-closing-tag-location.js b/lib/rules/jsx-closing-tag-location.js index 3d1f477121..146a86b2f1 100644 --- a/lib/rules/jsx-closing-tag-location.js +++ b/lib/rules/jsx-closing-tag-location.js @@ -18,11 +18,9 @@ const report = require('../util/report'); // ------------------------------------------------------------------------------ const messages = { - onOwnLine: - 'Closing tag of a multiline JSX expression must be on its own line.', + onOwnLine: 'Closing tag of a multiline JSX expression must be on its own line.', matchIndent: 'Expected closing tag to match indentation of opening.', - alignWithOpening: - 'Expected closing tag to be aligned with the line containing the opening tag', + alignWithOpening: 'Expected closing tag to be aligned with the line containing the opening tag', }; const defaultOption = 'tag-aligned'; @@ -43,24 +41,22 @@ module.exports = { }, fixable: 'whitespace', messages, - schema: [ - { - anyOf: [ - { - enum: ['tag-aligned', 'line-aligned'], - }, - { - type: 'object', - properties: { - location: { - enum: ['tag-aligned', 'line-aligned'], - }, + schema: [{ + anyOf: [ + { + enum: ['tag-aligned', 'line-aligned'], + }, + { + type: 'object', + properties: { + location: { + enum: ['tag-aligned', 'line-aligned'], }, - additionalProperties: false, }, - ], - }, - ], + additionalProperties: false, + }, + ], + }], }, create(context) { @@ -100,15 +96,15 @@ module.exports = { } if ( - opening.loc.start.column === node.loc.start.column && - option === 'tag-aligned' + opening.loc.start.column === node.loc.start.column + && option === 'tag-aligned' ) { return; } if ( - openingStartOfLine.column === node.loc.start.column && - option === 'line-aligned' + openingStartOfLine.column === node.loc.start.column + && option === 'line-aligned' ) { return; }