Skip to content

Commit

Permalink
Received feedback to avoid running prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
kimtaejin3 committed Jul 16, 2024
1 parent 2f48e9c commit 2fdf0b4
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions lib/rules/jsx-closing-tag-location.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 2fdf0b4

Please sign in to comment.