diff --git a/rules/sort-array-includes.ts b/rules/sort-array-includes.ts index 5784e173..a0912618 100644 --- a/rules/sort-array-includes.ts +++ b/rules/sort-array-includes.ts @@ -65,7 +65,7 @@ export default createEslintRule({ ], messages: { unexpectedArrayIncludesOrder: - 'Expected "{{second}}" to come before "{{first}}"', + 'Expected "{{right}}" to come before "{{left}}"', }, }, defaultOptions: [ @@ -121,33 +121,33 @@ export default createEslintRule({ ) .flat() - pairwise(nodes, (first, second) => { + pairwise(nodes, (left, right) => { let compareValue: boolean if ( options['spread-last'] && - first.node.type === AST_NODE_TYPES.Literal && - second.node.type === AST_NODE_TYPES.SpreadElement + left.node.type === AST_NODE_TYPES.Literal && + right.node.type === AST_NODE_TYPES.SpreadElement ) { compareValue = false } else if ( options['spread-last'] && - first.node.type === AST_NODE_TYPES.SpreadElement && - second.node.type === AST_NODE_TYPES.Literal + left.node.type === AST_NODE_TYPES.SpreadElement && + right.node.type === AST_NODE_TYPES.Literal ) { compareValue = true } else { - compareValue = compare(first, second, options) + compareValue = compare(left, right, options) } if (compareValue) { context.report({ messageId: 'unexpectedArrayIncludesOrder', data: { - first: toSingleLine(first.name), - second: toSingleLine(second.name), + left: toSingleLine(left.name), + right: toSingleLine(right.name), }, - node: second.node, + node: right.node, fix: fixer => { let sortedNodes = sortNodes(nodes, options) diff --git a/rules/sort-classes.ts b/rules/sort-classes.ts index e92d778e..c9d651da 100644 --- a/rules/sort-classes.ts +++ b/rules/sort-classes.ts @@ -76,8 +76,7 @@ export default createEslintRule({ }, ], messages: { - unexpectedClassesOrder: - 'Expected "{{second}}" to come before "{{first}}"', + unexpectedClassesOrder: 'Expected "{{right}}" to come before "{{left}}"', }, }, defaultOptions: [ @@ -172,21 +171,21 @@ export default createEslintRule({ return options.groups.length } - pairwise(nodes, (first, second) => { - let firstNum = getGroupNumber(first) - let secondNum = getGroupNumber(second) + pairwise(nodes, (left, right) => { + let leftNum = getGroupNumber(left) + let rightNum = getGroupNumber(right) if ( - firstNum > secondNum || - (firstNum === secondNum && compare(first, second, options)) + leftNum > rightNum || + (leftNum === rightNum && compare(left, right, options)) ) { context.report({ messageId: 'unexpectedClassesOrder', data: { - first: toSingleLine(first.name), - second: toSingleLine(second.name), + left: toSingleLine(left.name), + right: toSingleLine(right.name), }, - node: second.node, + node: right.node, fix: (fixer: TSESLint.RuleFixer) => { let fixes: TSESLint.RuleFix[] = [] diff --git a/rules/sort-enums.ts b/rules/sort-enums.ts index 2b34c0df..1f4b6b18 100644 --- a/rules/sort-enums.ts +++ b/rules/sort-enums.ts @@ -58,7 +58,7 @@ export default createEslintRule({ }, ], messages: { - unexpectedEnumsOrder: 'Expected "{{second}}" to come before "{{first}}"', + unexpectedEnumsOrder: 'Expected "{{right}}" to come before "{{left}}"', }, }, defaultOptions: [ @@ -87,15 +87,15 @@ export default createEslintRule({ node: member, })) - pairwise(nodes, (first, second) => { - if (compare(first, second, options)) { + pairwise(nodes, (left, right) => { + if (compare(left, right, options)) { context.report({ messageId: 'unexpectedEnumsOrder', data: { - first: toSingleLine(first.name), - second: toSingleLine(second.name), + left: toSingleLine(left.name), + right: toSingleLine(right.name), }, - node: second.node, + node: right.node, fix: fixer => makeFixes(fixer, nodes, sortNodes(nodes, options), source), }) diff --git a/rules/sort-imports.ts b/rules/sort-imports.ts index ffd522b6..6d6730f7 100644 --- a/rules/sort-imports.ts +++ b/rules/sort-imports.ts @@ -117,12 +117,11 @@ export default createEslintRule({ }, ], messages: { - unexpectedImportsOrder: - 'Expected "{{second}}" to come before "{{first}}"', + unexpectedImportsOrder: 'Expected "{{right}}" to come before "{{left}}"', missedSpacingBetweenImports: - 'Missed spacing between "{{first}}" and "{{second}}" imports', + 'Missed spacing between "{{left}}" and "{{right}}" imports', extraSpacingBetweenImports: - 'Extra spacing between "{{first}}" and "{{second}}" imports', + 'Extra spacing between "{{left}}" and "{{right}}" imports', }, }, defaultOptions: [ @@ -397,24 +396,24 @@ export default createEslintRule({ return fixes } - pairwise(nodes, (first, second) => { - let firstNum = getGroupNumber(first) - let secondNum = getGroupNumber(second) + pairwise(nodes, (left, right) => { + let leftNum = getGroupNumber(left) + let rightNum = getGroupNumber(right) - let numberOfEmptyLinesBetween = getLinesBetweenImports(first, second) + let numberOfEmptyLinesBetween = getLinesBetweenImports(left, right) if ( - !hasContentBetweenNodes(first, second) && - (firstNum > secondNum || - (firstNum === secondNum && compare(first, second, options))) + !hasContentBetweenNodes(left, right) && + (leftNum > rightNum || + (leftNum === rightNum && compare(left, right, options))) ) { context.report({ messageId: 'unexpectedImportsOrder', data: { - first: first.name, - second: second.name, + left: left.name, + right: right.name, }, - node: second.node, + node: right.node, fix, }) } @@ -426,36 +425,36 @@ export default createEslintRule({ context.report({ messageId: 'extraSpacingBetweenImports', data: { - first: first.name, - second: second.name, + left: left.name, + right: right.name, }, - node: second.node, + node: right.node, fix, }) } if (options['newlines-between'] === 'always') { - if (firstNum < secondNum && numberOfEmptyLinesBetween === 0) { + if (leftNum < rightNum && numberOfEmptyLinesBetween === 0) { context.report({ messageId: 'missedSpacingBetweenImports', data: { - first: first.name, - second: second.name, + left: left.name, + right: right.name, }, - node: second.node, + node: right.node, fix, }) } else if ( numberOfEmptyLinesBetween > 1 || - (firstNum === secondNum && numberOfEmptyLinesBetween > 0) + (leftNum === rightNum && numberOfEmptyLinesBetween > 0) ) { context.report({ messageId: 'extraSpacingBetweenImports', data: { - first: first.name, - second: second.name, + left: left.name, + right: right.name, }, - node: second.node, + node: right.node, fix, }) } diff --git a/rules/sort-interfaces.ts b/rules/sort-interfaces.ts index 3b2cd30d..1c0e3c2b 100644 --- a/rules/sort-interfaces.ts +++ b/rules/sort-interfaces.ts @@ -65,7 +65,7 @@ export default createEslintRule({ ], messages: { unexpectedInterfacePropertiesOrder: - 'Expected "{{second}}" to come before "{{first}}"', + 'Expected "{{right}}" to come before "{{left}}"', }, }, defaultOptions: [ @@ -125,15 +125,15 @@ export default createEslintRule({ } }) - pairwise(nodes, (first, second) => { - if (compare(first, second, options)) { + pairwise(nodes, (left, right) => { + if (compare(left, right, options)) { context.report({ messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: toSingleLine(first.name), - second: toSingleLine(second.name), + left: toSingleLine(left.name), + right: toSingleLine(right.name), }, - node: second.node, + node: right.node, fix: fixer => makeFixes(fixer, nodes, sortNodes(nodes, options), source), }) diff --git a/rules/sort-jsx-props.ts b/rules/sort-jsx-props.ts index 2a2fbcee..4dc14373 100644 --- a/rules/sort-jsx-props.ts +++ b/rules/sort-jsx-props.ts @@ -85,8 +85,7 @@ export default createEslintRule({ }, ], messages: { - unexpectedJSXPropsOrder: - 'Expected "{{second}}" to come before "{{first}}"', + unexpectedJSXPropsOrder: 'Expected "{{right}}" to come before "{{left}}"', }, }, defaultOptions: [ @@ -169,18 +168,18 @@ export default createEslintRule({ ) parts.forEach(nodes => { - pairwise(nodes, (first, second) => { + pairwise(nodes, (left, right) => { let comparison: boolean if ( - first.position === Position.exception && - second.position === Position.exception + left.position === Position.exception && + right.position === Position.exception ) { comparison = - options['always-on-top'].indexOf(first.name) > - options['always-on-top'].indexOf(second.name) - } else if (first.position === second.position) { - comparison = compare(first, second, options) + options['always-on-top'].indexOf(left.name) > + options['always-on-top'].indexOf(right.name) + } else if (left.position === right.position) { + comparison = compare(left, right, options) } else { let positionPower = { [Position.exception]: 2, @@ -190,17 +189,17 @@ export default createEslintRule({ } comparison = - positionPower[first.position] < positionPower[second.position] + positionPower[left.position] < positionPower[right.position] } if (comparison) { context.report({ messageId: 'unexpectedJSXPropsOrder', data: { - first: first.name, - second: second.name, + left: left.name, + right: right.name, }, - node: second.node, + node: right.node, fix: fixer => { let groups = groupBy(nodes, ({ position }) => position) diff --git a/rules/sort-map-elements.ts b/rules/sort-map-elements.ts index d98d4e41..94c3d1e1 100644 --- a/rules/sort-map-elements.ts +++ b/rules/sort-map-elements.ts @@ -60,7 +60,7 @@ export default createEslintRule({ ], messages: { unexpectedMapElementsOrder: - 'Expected "{{second}}" to come before "{{first}}"', + 'Expected "{{right}}" to come before "{{left}}"', }, }, defaultOptions: [ @@ -111,14 +111,14 @@ export default createEslintRule({ let name: string if (element.type === AST_NODE_TYPES.ArrayExpression) { - let [first] = element.elements + let [left] = element.elements - if (!first) { - name = `${first}` - } else if (first.type === AST_NODE_TYPES.Literal) { - name = first.raw + if (!left) { + name = `${left}` + } else if (left.type === AST_NODE_TYPES.Literal) { + name = left.raw } else { - name = source.text.slice(...first.range) + name = source.text.slice(...left.range) } } else { name = source.text.slice(...element.range) @@ -131,15 +131,15 @@ export default createEslintRule({ } }) - pairwise(nodes, (first, second) => { - if (compare(first, second, options)) { + pairwise(nodes, (left, right) => { + if (compare(left, right, options)) { context.report({ messageId: 'unexpectedMapElementsOrder', data: { - first: toSingleLine(first.name), - second: toSingleLine(second.name), + left: toSingleLine(left.name), + right: toSingleLine(right.name), }, - node: second.node, + node: right.node, fix: fixer => makeFixes(fixer, nodes, sortNodes(nodes, options), source), }) diff --git a/rules/sort-named-exports.ts b/rules/sort-named-exports.ts index 14e02287..3fa0cf4a 100644 --- a/rules/sort-named-exports.ts +++ b/rules/sort-named-exports.ts @@ -56,7 +56,7 @@ export default createEslintRule({ ], messages: { unexpectedNamedExportsOrder: - 'Expected "{{second}}" to come before "{{first}}"', + 'Expected "{{right}}" to come before "{{left}}"', }, }, defaultOptions: [ @@ -82,15 +82,15 @@ export default createEslintRule({ node: specifier, })) - pairwise(nodes, (first, second) => { - if (compare(first, second, options)) { + pairwise(nodes, (left, right) => { + if (compare(left, right, options)) { context.report({ messageId: 'unexpectedNamedExportsOrder', data: { - first: first.name, - second: second.name, + left: left.name, + right: right.name, }, - node: second.node, + node: right.node, fix: fixer => makeFixes(fixer, nodes, sortNodes(nodes, options), source), }) diff --git a/rules/sort-named-imports.ts b/rules/sort-named-imports.ts index d1bc0e64..3e9db24f 100644 --- a/rules/sort-named-imports.ts +++ b/rules/sort-named-imports.ts @@ -58,7 +58,7 @@ export default createEslintRule({ ], messages: { unexpectedNamedImportsOrder: - 'Expected "{{second}}" to come before "{{first}}"', + 'Expected "{{right}}" to come before "{{left}}"', }, }, defaultOptions: [ @@ -88,15 +88,15 @@ export default createEslintRule({ node: specifier, })) - pairwise(nodes, (first, second) => { - if (compare(first, second, options)) { + pairwise(nodes, (left, right) => { + if (compare(left, right, options)) { context.report({ messageId: 'unexpectedNamedImportsOrder', data: { - first: first.name, - second: second.name, + left: left.name, + right: right.name, }, - node: second.node, + node: right.node, fix: fixer => makeFixes(fixer, nodes, sortNodes(nodes, options), source), }) diff --git a/rules/sort-object-types.ts b/rules/sort-object-types.ts index 1cecd75c..c48d0198 100644 --- a/rules/sort-object-types.ts +++ b/rules/sort-object-types.ts @@ -59,7 +59,7 @@ export default createEslintRule({ ], messages: { unexpectedObjectTypesOrder: - 'Expected "{{second}}" to come before "{{first}}"', + 'Expected "{{right}}" to come before "{{left}}"', }, }, defaultOptions: [ @@ -113,15 +113,15 @@ export default createEslintRule({ } }) - pairwise(nodes, (first, second) => { - if (compare(first, second, options)) { + pairwise(nodes, (left, right) => { + if (compare(left, right, options)) { context.report({ messageId: 'unexpectedObjectTypesOrder', data: { - first: toSingleLine(first.name), - second: toSingleLine(second.name), + left: toSingleLine(left.name), + right: toSingleLine(right.name), }, - node: second.node, + node: right.node, fix: fixer => makeFixes(fixer, nodes, sortNodes(nodes, options), source), }) diff --git a/rules/sort-objects.ts b/rules/sort-objects.ts index f092e3ce..be4c706a 100644 --- a/rules/sort-objects.ts +++ b/rules/sort-objects.ts @@ -72,8 +72,7 @@ export default createEslintRule({ }, ], messages: { - unexpectedObjectsOrder: - 'Expected "{{second}}" to come before "{{first}}"', + unexpectedObjectsOrder: 'Expected "{{right}}" to come before "{{left}}"', }, }, defaultOptions: [ @@ -137,18 +136,18 @@ export default createEslintRule({ ) formatProperties(node.properties).forEach(nodes => { - pairwise(nodes, (first, second) => { + pairwise(nodes, (left, right) => { let comparison: boolean if ( - first.position === Position.exception && - second.position === Position.exception + left.position === Position.exception && + right.position === Position.exception ) { comparison = - options['always-on-top'].indexOf(first.name) > - options['always-on-top'].indexOf(second.name) - } else if (first.position === second.position) { - comparison = compare(first, second, options) + options['always-on-top'].indexOf(left.name) > + options['always-on-top'].indexOf(right.name) + } else if (left.position === right.position) { + comparison = compare(left, right, options) } else { let positionPower = { [Position.exception]: 1, @@ -156,17 +155,17 @@ export default createEslintRule({ } comparison = - positionPower[first.position] < positionPower[second.position] + positionPower[left.position] < positionPower[right.position] } if (comparison) { context.report({ messageId: 'unexpectedObjectsOrder', data: { - first: toSingleLine(first.name), - second: toSingleLine(second.name), + left: toSingleLine(left.name), + right: toSingleLine(right.name), }, - node: second.node, + node: right.node, fix: fixer => { let groups = groupBy(nodes, ({ position }) => position) diff --git a/rules/sort-union-types.ts b/rules/sort-union-types.ts index 78ac3141..f8909a6a 100644 --- a/rules/sort-union-types.ts +++ b/rules/sort-union-types.ts @@ -57,7 +57,7 @@ export default createEslintRule({ ], messages: { unexpectedUnionTypesOrder: - 'Expected "{{second}}" to come before "{{first}}"', + 'Expected "{{right}}" to come before "{{left}}"', }, }, defaultOptions: [ @@ -82,15 +82,15 @@ export default createEslintRule({ node: type, })) - pairwise(nodes, (first, second) => { - if (compare(first, second, options)) { + pairwise(nodes, (left, right) => { + if (compare(left, right, options)) { context.report({ messageId: 'unexpectedUnionTypesOrder', data: { - first: toSingleLine(first.name), - second: toSingleLine(second.name), + left: toSingleLine(left.name), + right: toSingleLine(right.name), }, - node: second.node, + node: right.node, fix: fixer => makeFixes(fixer, nodes, sortNodes(nodes, options), source), }) diff --git a/test/sort-array-includes.test.ts b/test/sort-array-includes.test.ts index dc126965..ff373266 100644 --- a/test/sort-array-includes.test.ts +++ b/test/sort-array-includes.test.ts @@ -67,8 +67,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: "'Cart Titan'", - second: '...otherTitans', + left: "'Cart Titan'", + right: '...otherTitans', }, }, ], @@ -122,8 +122,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: '...upperRanks', - second: '...lowerRanks', + left: '...upperRanks', + right: '...lowerRanks', }, }, ], @@ -165,8 +165,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: "'Genos'", - second: "'Bang'", + left: "'Genos'", + right: "'Bang'", }, }, ], @@ -210,8 +210,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: '...graceFieldOrphans', - second: "'Norman'", + left: '...graceFieldOrphans', + right: "'Norman'", }, }, ], @@ -268,8 +268,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: "'Sonozaki Shion'", - second: "'Maebara Keiichi'", + left: "'Sonozaki Shion'", + right: "'Maebara Keiichi'", }, }, ], @@ -336,8 +336,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: '...otherTitans', - second: "'Beast Titan'", + left: '...otherTitans', + right: "'Beast Titan'", }, }, ], @@ -391,8 +391,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: '...upperRanks', - second: '...lowerRanks', + left: '...upperRanks', + right: '...lowerRanks', }, }, ], @@ -434,8 +434,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: "'Genos'", - second: "'Bang'", + left: "'Genos'", + right: "'Bang'", }, }, ], @@ -479,8 +479,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: '...graceFieldOrphans', - second: "'Norman'", + left: '...graceFieldOrphans', + right: "'Norman'", }, }, ], @@ -537,8 +537,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: "'Sonozaki Shion'", - second: "'Maebara Keiichi'", + left: "'Sonozaki Shion'", + right: "'Maebara Keiichi'", }, }, ], @@ -605,15 +605,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: "'Cart Titan'", - second: '...otherTitans', + left: "'Cart Titan'", + right: '...otherTitans', }, }, { messageId: 'unexpectedArrayIncludesOrder', data: { - first: "'Beast Titan'", - second: "'War Hammer Titan'", + left: "'Beast Titan'", + right: "'War Hammer Titan'", }, }, ], @@ -667,8 +667,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: '...demons', - second: '...upperRanks', + left: '...demons', + right: '...upperRanks', }, }, ], @@ -710,8 +710,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: "'King'", - second: "'Saitama'", + left: "'King'", + right: "'Saitama'", }, }, ], @@ -755,8 +755,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: '...graceFieldOrphans', - second: "'Norman'", + left: '...graceFieldOrphans', + right: "'Norman'", }, }, ], @@ -813,15 +813,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: "'Ryūgū Rena'", - second: "'Sonozaki Shion'", + left: "'Ryūgū Rena'", + right: "'Sonozaki Shion'", }, }, { messageId: 'unexpectedArrayIncludesOrder', data: { - first: "'Sonozaki Shion'", - second: "'Maebara Keiichi'", + left: "'Sonozaki Shion'", + right: "'Maebara Keiichi'", }, }, ], @@ -866,15 +866,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedArrayIncludesOrder', data: { - first: "'Shusei Kagari'", - second: "'Akane Tsunemori'", + left: "'Shusei Kagari'", + right: "'Akane Tsunemori'", }, }, { messageId: 'unexpectedArrayIncludesOrder', data: { - first: "'Tomomi Masaoka'", - second: "'Nobuchika Ginoza'", + left: "'Tomomi Masaoka'", + right: "'Nobuchika Ginoza'", }, }, ], diff --git a/test/sort-classes.test.ts b/test/sort-classes.test.ts index 7bc61de3..21a81688 100644 --- a/test/sort-classes.test.ts +++ b/test/sort-classes.test.ts @@ -150,15 +150,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedClassesOrder', data: { - first: 'constructor', - second: 'placeOfWork', + left: 'constructor', + right: 'placeOfWork', }, }, { messageId: 'unexpectedClassesOrder', data: { - first: 'decreaseStressLevel', - second: 'greet', + left: 'decreaseStressLevel', + right: 'greet', }, }, ], @@ -242,8 +242,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedClassesOrder', data: { - first: 'territory', - second: 'status', + left: 'territory', + right: 'status', }, }, ], @@ -311,8 +311,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedClassesOrder', data: { - first: '[k: string];', - second: 'name', + left: '[k: string];', + right: 'name', }, }, ], @@ -462,15 +462,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedClassesOrder', data: { - first: 'constructor', - second: 'placeOfWork', + left: 'constructor', + right: 'placeOfWork', }, }, { messageId: 'unexpectedClassesOrder', data: { - first: 'decreaseStressLevel', - second: 'greet', + left: 'decreaseStressLevel', + right: 'greet', }, }, ], @@ -554,8 +554,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedClassesOrder', data: { - first: 'territory', - second: 'status', + left: 'territory', + right: 'status', }, }, ], @@ -623,8 +623,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedClassesOrder', data: { - first: '[k: string];', - second: 'name', + left: '[k: string];', + right: 'name', }, }, ], @@ -774,15 +774,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedClassesOrder', data: { - first: 'constructor', - second: 'placeOfWork', + left: 'constructor', + right: 'placeOfWork', }, }, { messageId: 'unexpectedClassesOrder', data: { - first: 'decreaseStressLevel', - second: 'greet', + left: 'decreaseStressLevel', + right: 'greet', }, }, ], @@ -866,8 +866,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedClassesOrder', data: { - first: 'key in Attractions', - second: 'territory', + left: 'key in Attractions', + right: 'territory', }, }, ], @@ -935,8 +935,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedClassesOrder', data: { - first: '[k: string];', - second: 'name', + left: '[k: string];', + right: 'name', }, }, ], diff --git a/test/sort-enums.test.ts b/test/sort-enums.test.ts index 0740dfd9..a4933505 100644 --- a/test/sort-enums.test.ts +++ b/test/sort-enums.test.ts @@ -61,8 +61,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'Sonozaki Shion', - second: 'Ryūgū Rena', + left: 'Sonozaki Shion', + right: 'Ryūgū Rena', }, }, ], @@ -119,8 +119,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: '8', - second: '12', + left: '8', + right: '12', }, }, ], @@ -174,8 +174,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'Miyuki', - second: 'Hana', + left: 'Miyuki', + right: 'Hana', }, }, ], @@ -226,8 +226,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'true', - second: 'false', + left: 'true', + right: 'false', }, }, ], @@ -275,8 +275,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'Yuu', - second: 'Chi-Chii', + left: 'Yuu', + right: 'Chi-Chii', }, }, ], @@ -337,8 +337,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'Sonozaki Shion', - second: 'Ryūgū Rena', + left: 'Sonozaki Shion', + right: 'Ryūgū Rena', }, }, ], @@ -395,8 +395,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: '12', - second: '2', + left: '12', + right: '2', }, }, ], @@ -450,8 +450,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'Miyuki', - second: 'Hana', + left: 'Miyuki', + right: 'Hana', }, }, ], @@ -502,8 +502,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'true', - second: 'false', + left: 'true', + right: 'false', }, }, ], @@ -551,8 +551,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'Yuu', - second: 'Chi-Chii', + left: 'Yuu', + right: 'Chi-Chii', }, }, ], @@ -613,15 +613,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'Furude Rika', - second: 'Sonozaki Mion', + left: 'Furude Rika', + right: 'Sonozaki Mion', }, }, { messageId: 'unexpectedEnumsOrder', data: { - first: 'Sonozaki Mion', - second: 'Sonozaki Shion', + left: 'Sonozaki Mion', + right: 'Sonozaki Shion', }, }, ], @@ -678,8 +678,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: '1', - second: '12', + left: '1', + right: '12', }, }, ], @@ -733,15 +733,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'Gin', - second: 'Miyuki', + left: 'Gin', + right: 'Miyuki', }, }, { messageId: 'unexpectedEnumsOrder', data: { - first: 'Miyuki', - second: 'Hana', + left: 'Miyuki', + right: 'Hana', }, }, ], @@ -792,8 +792,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'true', - second: 'false', + left: 'true', + right: 'false', }, }, ], @@ -841,8 +841,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'Yuu', - second: 'Chi-Chii', + left: 'Yuu', + right: 'Chi-Chii', }, }, ], @@ -884,8 +884,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedEnumsOrder', data: { - first: 'Ushio Kofune', - second: 'Mio Kofune', + left: 'Ushio Kofune', + right: 'Mio Kofune', }, }, ], diff --git a/test/sort-imports.test.ts b/test/sort-imports.test.ts index 633a47f3..d2df2c99 100644 --- a/test/sort-imports.test.ts +++ b/test/sort-imports.test.ts @@ -51,8 +51,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedImportsOrder', data: { - first: 'makoto-shinkai', - second: 'hayao-miyazaki', + left: 'makoto-shinkai', + right: 'hayao-miyazaki', }, }, ], @@ -184,85 +184,85 @@ describe(RULE_NAME, () => { { messageId: 'missedSpacingBetweenImports', data: { - first: '~/hunter-association', - second: '~/hunter-association', + left: '~/hunter-association', + right: '~/hunter-association', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '~/hunter-association', - second: 'phantom-troupe', + left: '~/hunter-association', + right: 'phantom-troupe', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: 'phantom-troupe', - second: '.', + left: 'phantom-troupe', + right: '.', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: '.', - second: '../ants', + left: '.', + right: '../ants', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '../ants', - second: 'path', + left: '../ants', + right: 'path', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: 'path', - second: 'fs', + left: 'path', + right: 'fs', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: 'fs', - second: '../ants', + left: 'fs', + right: '../ants', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: './association-data', - second: '~/hunters/beast-hunters', + left: './association-data', + right: '~/hunters/beast-hunters', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: '~/hunters/virus-hunters', - second: './index.d.ts', + left: '~/hunters/virus-hunters', + right: './index.d.ts', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: './index.d.ts', - second: './style.css', + left: './index.d.ts', + right: './style.css', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: './style.css', - second: 'hunter', + left: './style.css', + right: 'hunter', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '../ants', - second: '../../hunters/histoka', + left: '../ants', + right: '../../hunters/histoka', }, }, ], @@ -345,22 +345,22 @@ describe(RULE_NAME, () => { { messageId: 'extraSpacingBetweenImports', data: { - first: '~/tokyo-high/1st-year', - second: '~/tokyo-high/2nd-year', + left: '~/tokyo-high/1st-year', + right: '~/tokyo-high/2nd-year', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '~/tokyo-high/2nd-year', - second: 'jujutsu-kaisen', + left: '~/tokyo-high/2nd-year', + right: 'jujutsu-kaisen', }, }, { messageId: 'extraSpacingBetweenImports', data: { - first: 'jujutsu-kaisen', - second: '.', + left: 'jujutsu-kaisen', + right: '.', }, }, ], @@ -440,15 +440,15 @@ describe(RULE_NAME, () => { { messageId: 'extraSpacingBetweenImports', data: { - first: 'narehate', - second: '~/team/nanachi', + left: 'narehate', + right: '~/team/nanachi', }, }, { messageId: 'extraSpacingBetweenImports', data: { - first: '~/team/nanachi', - second: '~/team/reg', + left: '~/team/nanachi', + right: '~/team/reg', }, }, ], @@ -534,15 +534,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedImportsOrder', data: { - first: 'console.log', - second: 'daigo', + left: 'console.log', + right: 'daigo', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: 'daigo', - second: 'daigo/tahomaru', + left: 'daigo', + right: 'daigo/tahomaru', }, }, ], @@ -608,15 +608,15 @@ describe(RULE_NAME, () => { { messageId: 'extraSpacingBetweenImports', data: { - first: '../cats', - second: '~/delivery-service', + left: '../cats', + right: '~/delivery-service', }, }, { messageId: 'extraSpacingBetweenImports', data: { - first: '~/delivery-service', - second: 'witches', + left: '~/delivery-service', + right: 'witches', }, }, ], @@ -742,8 +742,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedImportsOrder', data: { - first: 'makoto-shinkai', - second: 'hayao-miyazaki', + left: 'makoto-shinkai', + right: 'hayao-miyazaki', }, }, ], @@ -875,85 +875,85 @@ describe(RULE_NAME, () => { { messageId: 'missedSpacingBetweenImports', data: { - first: '~/hunter-association', - second: '~/hunter-association', + left: '~/hunter-association', + right: '~/hunter-association', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '~/hunter-association', - second: 'phantom-troupe', + left: '~/hunter-association', + right: 'phantom-troupe', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: 'phantom-troupe', - second: '.', + left: 'phantom-troupe', + right: '.', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: '.', - second: '../ants', + left: '.', + right: '../ants', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '../ants', - second: 'path', + left: '../ants', + right: 'path', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: 'path', - second: 'fs', + left: 'path', + right: 'fs', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: 'fs', - second: '../ants', + left: 'fs', + right: '../ants', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: './association-data', - second: '~/hunters/beast-hunters', + left: './association-data', + right: '~/hunters/beast-hunters', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: '~/hunters/virus-hunters', - second: './index.d.ts', + left: '~/hunters/virus-hunters', + right: './index.d.ts', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: './index.d.ts', - second: './style.css', + left: './index.d.ts', + right: './style.css', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: './style.css', - second: 'hunter', + left: './style.css', + right: 'hunter', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '../ants', - second: '../../hunters/histoka', + left: '../ants', + right: '../../hunters/histoka', }, }, ], @@ -1036,22 +1036,22 @@ describe(RULE_NAME, () => { { messageId: 'extraSpacingBetweenImports', data: { - first: '~/tokyo-high/1st-year', - second: '~/tokyo-high/2nd-year', + left: '~/tokyo-high/1st-year', + right: '~/tokyo-high/2nd-year', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '~/tokyo-high/2nd-year', - second: 'jujutsu-kaisen', + left: '~/tokyo-high/2nd-year', + right: 'jujutsu-kaisen', }, }, { messageId: 'extraSpacingBetweenImports', data: { - first: 'jujutsu-kaisen', - second: '.', + left: 'jujutsu-kaisen', + right: '.', }, }, ], @@ -1131,15 +1131,15 @@ describe(RULE_NAME, () => { { messageId: 'extraSpacingBetweenImports', data: { - first: 'narehate', - second: '~/team/nanachi', + left: 'narehate', + right: '~/team/nanachi', }, }, { messageId: 'extraSpacingBetweenImports', data: { - first: '~/team/nanachi', - second: '~/team/reg', + left: '~/team/nanachi', + right: '~/team/reg', }, }, ], @@ -1225,15 +1225,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedImportsOrder', data: { - first: 'console.log', - second: 'daigo', + left: 'console.log', + right: 'daigo', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: 'daigo', - second: 'daigo/tahomaru', + left: 'daigo', + right: 'daigo/tahomaru', }, }, ], @@ -1299,15 +1299,15 @@ describe(RULE_NAME, () => { { messageId: 'extraSpacingBetweenImports', data: { - first: '../cats', - second: '~/delivery-service', + left: '../cats', + right: '~/delivery-service', }, }, { messageId: 'extraSpacingBetweenImports', data: { - first: '~/delivery-service', - second: 'witches', + left: '~/delivery-service', + right: 'witches', }, }, ], @@ -1433,8 +1433,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedImportsOrder', data: { - first: 'makoto-shinkai', - second: 'hayao-miyazaki', + left: 'makoto-shinkai', + right: 'hayao-miyazaki', }, }, ], @@ -1566,99 +1566,99 @@ describe(RULE_NAME, () => { { messageId: 'missedSpacingBetweenImports', data: { - first: '~/hunter-association', - second: '~/hunter-association', + left: '~/hunter-association', + right: '~/hunter-association', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '~/hunter-association', - second: 'phantom-troupe', + left: '~/hunter-association', + right: 'phantom-troupe', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: 'phantom-troupe', - second: '.', + left: 'phantom-troupe', + right: '.', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: '.', - second: '../ants', + left: '.', + right: '../ants', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '../ants', - second: 'path', + left: '../ants', + right: 'path', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: 'fs', - second: '../ants', + left: 'fs', + right: '../ants', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '../ants', - second: './association-data', + left: '../ants', + right: './association-data', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: './association-data', - second: '~/hunters/beast-hunters', + left: './association-data', + right: '~/hunters/beast-hunters', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '~/hunters/beast-hunters', - second: '~/hunters/virus-hunters', + left: '~/hunters/beast-hunters', + right: '~/hunters/virus-hunters', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: '~/hunters/virus-hunters', - second: './index.d.ts', + left: '~/hunters/virus-hunters', + right: './index.d.ts', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: './index.d.ts', - second: './style.css', + left: './index.d.ts', + right: './style.css', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: './style.css', - second: 'hunter', + left: './style.css', + right: 'hunter', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '.', - second: '../ants', + left: '.', + right: '../ants', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '../ants', - second: '../../hunters/histoka', + left: '../ants', + right: '../../hunters/histoka', }, }, ], @@ -1741,36 +1741,36 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedImportsOrder', data: { - first: '~/tokyo-high/1st-year', - second: '~/tokyo-high/2nd-year', + left: '~/tokyo-high/1st-year', + right: '~/tokyo-high/2nd-year', }, }, { messageId: 'extraSpacingBetweenImports', data: { - first: '~/tokyo-high/1st-year', - second: '~/tokyo-high/2nd-year', + left: '~/tokyo-high/1st-year', + right: '~/tokyo-high/2nd-year', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '~/tokyo-high/2nd-year', - second: 'jujutsu-kaisen', + left: '~/tokyo-high/2nd-year', + right: 'jujutsu-kaisen', }, }, { messageId: 'extraSpacingBetweenImports', data: { - first: 'jujutsu-kaisen', - second: '.', + left: 'jujutsu-kaisen', + right: '.', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '.', - second: '../../kyoto-high/data', + left: '.', + right: '../../kyoto-high/data', }, }, ], @@ -1850,22 +1850,22 @@ describe(RULE_NAME, () => { { messageId: 'extraSpacingBetweenImports', data: { - first: 'narehate', - second: '~/team/nanachi', + left: 'narehate', + right: '~/team/nanachi', }, }, { messageId: 'extraSpacingBetweenImports', data: { - first: '~/team/nanachi', - second: '~/team/reg', + left: '~/team/nanachi', + right: '~/team/reg', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '~/team/reg', - second: '~/team/riko', + left: '~/team/reg', + right: '~/team/riko', }, }, ], @@ -1951,15 +1951,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedImportsOrder', data: { - first: 'console.log', - second: 'daigo', + left: 'console.log', + right: 'daigo', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: 'daigo', - second: 'daigo/tahomaru', + left: 'daigo', + right: 'daigo/tahomaru', }, }, ], @@ -2025,22 +2025,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedImportsOrder', data: { - first: '../cats', - second: '~/delivery-service', + left: '../cats', + right: '~/delivery-service', }, }, { messageId: 'extraSpacingBetweenImports', data: { - first: '../cats', - second: '~/delivery-service', + left: '../cats', + right: '~/delivery-service', }, }, { messageId: 'extraSpacingBetweenImports', data: { - first: '~/delivery-service', - second: 'witches', + left: '~/delivery-service', + right: 'witches', }, }, ], @@ -2154,15 +2154,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedImportsOrder', data: { - first: '~/higotoshima/shinpei', - second: '~/higotoshima/mio', + left: '~/higotoshima/shinpei', + right: '~/higotoshima/mio', }, }, { messageId: 'unexpectedImportsOrder', data: { - first: '~/higotoshima/ushio', - second: '~/higotoshima/hizuru', + left: '~/higotoshima/ushio', + right: '~/higotoshima/hizuru', }, }, ], @@ -2231,15 +2231,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedImportsOrder', data: { - first: '@/components/mikuru', - second: '@melancholy/haruhi-suzumiya', + left: '@/components/mikuru', + right: '@melancholy/haruhi-suzumiya', }, }, { messageId: 'missedSpacingBetweenImports', data: { - first: '@melancholy/haruhi-suzumiya', - second: '~/data/yuki', + left: '@melancholy/haruhi-suzumiya', + right: '~/data/yuki', }, }, ], diff --git a/test/sort-interfaces.test.ts b/test/sort-interfaces.test.ts index b41b26e1..cf508dee 100644 --- a/test/sort-interfaces.test.ts +++ b/test/sort-interfaces.test.ts @@ -58,8 +58,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'name', - second: 'age', + left: 'name', + right: 'age', }, }, ], @@ -110,8 +110,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'yuuji', - second: '[key in Sorcerer]', + left: 'yuuji', + right: '[key in Sorcerer]', }, }, ], @@ -168,15 +168,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'spike-spiegel', - second: 'ein', + left: 'spike-spiegel', + right: 'ein', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'jet', - second: 'faye-valentine', + left: 'jet', + right: 'faye-valentine', }, }, ], @@ -230,8 +230,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'evangelion-owner', - second: '[key: string]', + left: 'evangelion-owner', + right: '[key: string]', }, }, ], @@ -291,15 +291,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'godspeed()', - second: 'airSpin', + left: 'godspeed()', + right: 'airSpin', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'sixfold()', - second: 'name', + left: 'sixfold()', + right: 'name', }, }, ], @@ -359,15 +359,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'age', - second: '[...memories]', + left: 'age', + right: '[...memories]', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'job', - second: '[value in stories]', + left: 'job', + right: '[value in stories]', }, }, ], @@ -427,22 +427,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'spirit', - second: 'owner', + left: 'spirit', + right: 'owner', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'owner', - second: 'esper', + left: 'owner', + right: 'esper', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'esper', - second: 'assistant', + left: 'esper', + right: 'assistant', }, }, ], @@ -478,8 +478,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'rescuer', - second: 'hikikomori', + left: 'rescuer', + right: 'hikikomori', }, }, ], @@ -537,8 +537,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'name', - second: 'age', + left: 'name', + right: 'age', }, }, ], @@ -589,8 +589,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'yuuji', - second: '[key in Sorcerer]', + left: 'yuuji', + right: '[key in Sorcerer]', }, }, ], @@ -647,15 +647,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'spike-spiegel', - second: 'ein', + left: 'spike-spiegel', + right: 'ein', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'jet', - second: 'faye-valentine', + left: 'jet', + right: 'faye-valentine', }, }, ], @@ -709,8 +709,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'evangelion-owner', - second: '[key: string]', + left: 'evangelion-owner', + right: '[key: string]', }, }, ], @@ -770,15 +770,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'godspeed()', - second: 'airSpin', + left: 'godspeed()', + right: 'airSpin', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'sixfold()', - second: 'name', + left: 'sixfold()', + right: 'name', }, }, ], @@ -838,15 +838,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'age', - second: '[...memories]', + left: 'age', + right: '[...memories]', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'job', - second: '[value in stories]', + left: 'job', + right: '[value in stories]', }, }, ], @@ -906,22 +906,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'spirit', - second: 'owner', + left: 'spirit', + right: 'owner', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'owner', - second: 'esper', + left: 'owner', + right: 'esper', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'esper', - second: 'assistant', + left: 'esper', + right: 'assistant', }, }, ], @@ -957,8 +957,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'rescuer', - second: 'hikikomori', + left: 'rescuer', + right: 'hikikomori', }, }, ], @@ -1016,8 +1016,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'age', - second: 'country', + left: 'age', + right: 'country', }, }, ], @@ -1082,8 +1082,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'color', - second: 'align', + left: 'color', + right: 'align', }, }, ], @@ -1134,8 +1134,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'yuuji', - second: '[key in Sorcerer]', + left: 'yuuji', + right: '[key in Sorcerer]', }, }, ], @@ -1195,15 +1195,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'age', - second: 'godspeed()', + left: 'age', + right: 'godspeed()', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'godspeed()', - second: 'airSpin', + left: 'godspeed()', + right: 'airSpin', }, }, ], @@ -1263,15 +1263,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: '[days in daysDiff]', - second: '[value in stories]', + left: '[days in daysDiff]', + right: '[value in stories]', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: '[...memories]', - second: 'job', + left: '[...memories]', + right: 'job', }, }, ], @@ -1331,22 +1331,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'spirit', - second: 'owner', + left: 'spirit', + right: 'owner', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'owner', - second: 'esper', + left: 'owner', + right: 'esper', }, }, { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'esper', - second: 'assistant', + left: 'esper', + right: 'assistant', }, }, ], @@ -1382,8 +1382,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'rescuer', - second: 'hikikomori', + left: 'rescuer', + right: 'hikikomori', }, }, ], @@ -1422,8 +1422,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedInterfacePropertiesOrder', data: { - first: 'name', - second: 'causeOfDeath', + left: 'name', + right: 'causeOfDeath', }, }, ], diff --git a/test/sort-jsx-props.test.ts b/test/sort-jsx-props.test.ts index 16ad0f38..0df4886c 100644 --- a/test/sort-jsx-props.test.ts +++ b/test/sort-jsx-props.test.ts @@ -77,8 +77,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'type', - second: 'role', + left: 'type', + right: 'role', }, }, ], @@ -141,8 +141,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'parasite:name', - second: 'name', + left: 'parasite:name', + right: 'name', }, }, ], @@ -214,15 +214,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'lastName', - second: 'big', + left: 'lastName', + right: 'big', }, }, { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'occupation', - second: 'age', + left: 'occupation', + right: 'age', }, }, ], @@ -287,8 +287,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'isFromCowboyBebop', - second: 'origin', + left: 'isFromCowboyBebop', + right: 'origin', }, }, ], @@ -347,8 +347,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'onChange', - second: 'shinigami', + left: 'onChange', + right: 'shinigami', }, }, ], @@ -425,15 +425,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'form', - second: 'handleTransform', + left: 'form', + right: 'handleTransform', }, }, { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'residence', - second: 'style', + left: 'residence', + right: 'style', }, }, ], @@ -498,15 +498,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'nickname', - second: 'name', + left: 'nickname', + right: 'name', }, }, { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'name', - second: 'id', + left: 'name', + right: 'id', }, }, ], @@ -535,8 +535,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'name', - second: 'id', + left: 'name', + right: 'id', }, }, ], @@ -565,8 +565,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'name', - second: 'id', + left: 'name', + right: 'id', }, }, ], @@ -638,8 +638,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'type', - second: 'role', + left: 'type', + right: 'role', }, }, ], @@ -702,8 +702,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'parasite:name', - second: 'name', + left: 'parasite:name', + right: 'name', }, }, ], @@ -775,15 +775,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'lastName', - second: 'big', + left: 'lastName', + right: 'big', }, }, { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'occupation', - second: 'age', + left: 'occupation', + right: 'age', }, }, ], @@ -848,8 +848,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'isFromCowboyBebop', - second: 'origin', + left: 'isFromCowboyBebop', + right: 'origin', }, }, ], @@ -908,8 +908,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'onChange', - second: 'shinigami', + left: 'onChange', + right: 'shinigami', }, }, ], @@ -986,15 +986,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'form', - second: 'handleTransform', + left: 'form', + right: 'handleTransform', }, }, { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'residence', - second: 'style', + left: 'residence', + right: 'style', }, }, ], @@ -1059,15 +1059,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'nickname', - second: 'name', + left: 'nickname', + right: 'name', }, }, { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'name', - second: 'id', + left: 'name', + right: 'id', }, }, ], @@ -1096,8 +1096,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'name', - second: 'id', + left: 'name', + right: 'id', }, }, ], @@ -1126,8 +1126,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'name', - second: 'id', + left: 'name', + right: 'id', }, }, ], @@ -1199,8 +1199,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'type', - second: 'role', + left: 'type', + right: 'role', }, }, ], @@ -1263,15 +1263,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'age', - second: 'parasite:name', + left: 'age', + right: 'parasite:name', }, }, { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'parasite:name', - second: 'name', + left: 'parasite:name', + right: 'name', }, }, ], @@ -1343,8 +1343,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'age', - second: 'weapon', + left: 'age', + right: 'weapon', }, }, ], @@ -1409,15 +1409,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'age', - second: 'bloodType', + left: 'age', + right: 'bloodType', }, }, { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'isFromCowboyBebop', - second: 'origin', + left: 'isFromCowboyBebop', + right: 'origin', }, }, ], @@ -1476,8 +1476,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'onChange', - second: 'shinigami', + left: 'onChange', + right: 'shinigami', }, }, ], @@ -1554,15 +1554,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'form', - second: 'handleTransform', + left: 'form', + right: 'handleTransform', }, }, { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'residence', - second: 'style', + left: 'residence', + right: 'style', }, }, ], @@ -1627,22 +1627,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'age', - second: 'nickname', + left: 'age', + right: 'nickname', }, }, { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'nickname', - second: 'name', + left: 'nickname', + right: 'name', }, }, { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'name', - second: 'id', + left: 'name', + right: 'id', }, }, ], @@ -1671,8 +1671,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'name', - second: 'id', + left: 'name', + right: 'id', }, }, ], @@ -1701,8 +1701,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'name', - second: 'id', + left: 'name', + right: 'id', }, }, ], @@ -1750,8 +1750,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedJSXPropsOrder', data: { - first: 'occupation', - second: 'firstName', + left: 'occupation', + right: 'firstName', }, }, ], diff --git a/test/sort-map-elements.test.ts b/test/sort-map-elements.test.ts index 5040fc6c..5219090d 100644 --- a/test/sort-map-elements.test.ts +++ b/test/sort-map-elements.test.ts @@ -66,8 +66,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: "'products'", - second: "'product'", + left: "'products'", + right: "'product'", }, }, ], @@ -154,8 +154,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: 'raymondName', - second: 'jessieName', + left: 'raymondName', + right: 'jessieName', }, }, ], @@ -209,8 +209,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: '2', - second: '1', + left: '2', + right: '1', }, }, ], @@ -267,15 +267,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: 'mapsApp', - second: 'booksApp', + left: 'mapsApp', + right: 'booksApp', }, }, { messageId: 'unexpectedMapElementsOrder', data: { - first: 'weatherApp', - second: 'musicApp', + left: 'weatherApp', + right: 'musicApp', }, }, ], @@ -341,8 +341,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: "'products'", - second: "'product'", + left: "'products'", + right: "'product'", }, }, ], @@ -429,8 +429,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: 'raymondName', - second: 'jessieName', + left: 'raymondName', + right: 'jessieName', }, }, ], @@ -484,8 +484,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: '2', - second: '1', + left: '2', + right: '1', }, }, ], @@ -542,15 +542,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: 'mapsApp', - second: 'booksApp', + left: 'mapsApp', + right: 'booksApp', }, }, { messageId: 'unexpectedMapElementsOrder', data: { - first: 'weatherApp', - second: 'musicApp', + left: 'weatherApp', + right: 'musicApp', }, }, ], @@ -616,15 +616,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: "'products'", - second: "'product'", + left: "'products'", + right: "'product'", }, }, { messageId: 'unexpectedMapElementsOrder', data: { - first: "'categories'", - second: "'category'", + left: "'categories'", + right: "'category'", }, }, ], @@ -678,8 +678,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: "'EUR'", - second: "'USD'", + left: "'EUR'", + right: "'USD'", }, }, ], @@ -707,8 +707,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: "'Europe'", - second: "'United States'", + left: "'Europe'", + right: "'United States'", }, }, ], @@ -795,8 +795,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: 'jessieName', - second: 'raymondName', + left: 'jessieName', + right: 'raymondName', }, }, ], @@ -850,8 +850,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: '1', - second: '3', + left: '1', + right: '3', }, }, ], @@ -908,15 +908,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: 'mapsApp', - second: 'booksApp', + left: 'mapsApp', + right: 'booksApp', }, }, { messageId: 'unexpectedMapElementsOrder', data: { - first: 'booksApp', - second: 'weatherApp', + left: 'booksApp', + right: 'weatherApp', }, }, ], @@ -964,8 +964,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedMapElementsOrder', data: { - first: "'USD'", - second: "'EUR'", + left: "'USD'", + right: "'EUR'", }, }, ], diff --git a/test/sort-named-exports.test.ts b/test/sort-named-exports.test.ts index 9906be23..d9eb1526 100644 --- a/test/sort-named-exports.test.ts +++ b/test/sort-named-exports.test.ts @@ -52,8 +52,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedExportsOrder', data: { - first: 'RuijerdSuperdia', - second: 'ErisBoreas', + left: 'RuijerdSuperdia', + right: 'ErisBoreas', }, }, ], @@ -105,8 +105,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedExportsOrder', data: { - first: 'RuijerdSuperdia', - second: 'ErisBoreas', + left: 'RuijerdSuperdia', + right: 'ErisBoreas', }, }, ], @@ -158,8 +158,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedExportsOrder', data: { - first: 'Rudeus', - second: 'RuijerdSuperdia', + left: 'Rudeus', + right: 'RuijerdSuperdia', }, }, ], @@ -185,8 +185,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedExportsOrder', data: { - first: 'SatoruFujinuma', - second: 'KayoHinazuki', + left: 'SatoruFujinuma', + right: 'KayoHinazuki', }, }, ], diff --git a/test/sort-named-imports.test.ts b/test/sort-named-imports.test.ts index b3429a9a..5ecdf93e 100644 --- a/test/sort-named-imports.test.ts +++ b/test/sort-named-imports.test.ts @@ -46,15 +46,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'Reki', - second: 'Rakka', + left: 'Reki', + right: 'Rakka', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'Rakka', - second: 'Kuu', + left: 'Rakka', + right: 'Kuu', }, }, ], @@ -117,22 +117,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'ReinerBraun', - second: 'FalcoGrice', + left: 'ReinerBraun', + right: 'FalcoGrice', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'FalcoGrice', - second: 'AnnieLeonhart', + left: 'FalcoGrice', + right: 'AnnieLeonhart', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'Gross', - second: 'BertholdtHoover', + left: 'Gross', + right: 'BertholdtHoover', }, }, ], @@ -186,8 +186,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'GendouIkari', - second: 'Eva0', + left: 'GendouIkari', + right: 'Eva0', }, }, ], @@ -266,22 +266,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'reinerBraun', - second: 'colossusTitan', + left: 'reinerBraun', + right: 'colossusTitan', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'zekeYeager', - second: 'erenYeager', + left: 'zekeYeager', + right: 'erenYeager', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'erenYeager', - second: 'annieLeonhart', + left: 'erenYeager', + right: 'annieLeonhart', }, }, ], @@ -327,15 +327,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'Reki', - second: 'Rakka', + left: 'Reki', + right: 'Rakka', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'Rakka', - second: 'Kuu', + left: 'Rakka', + right: 'Kuu', }, }, ], @@ -398,22 +398,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'ReinerBraun', - second: 'FalcoGrice', + left: 'ReinerBraun', + right: 'FalcoGrice', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'FalcoGrice', - second: 'AnnieLeonhart', + left: 'FalcoGrice', + right: 'AnnieLeonhart', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'Gross', - second: 'BertholdtHoover', + left: 'Gross', + right: 'BertholdtHoover', }, }, ], @@ -467,8 +467,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'GendouIkari', - second: 'Eva0', + left: 'GendouIkari', + right: 'Eva0', }, }, ], @@ -547,22 +547,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'reinerBraun', - second: 'colossusTitan', + left: 'reinerBraun', + right: 'colossusTitan', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'zekeYeager', - second: 'erenYeager', + left: 'zekeYeager', + right: 'erenYeager', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'erenYeager', - second: 'annieLeonhart', + left: 'erenYeager', + right: 'annieLeonhart', }, }, ], @@ -608,8 +608,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'Reki', - second: 'Rakka', + left: 'Reki', + right: 'Rakka', }, }, ], @@ -672,15 +672,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'AnnieLeonhart', - second: 'BertholdtHoover', + left: 'AnnieLeonhart', + right: 'BertholdtHoover', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'Gross', - second: 'ReinerBraun', + left: 'Gross', + right: 'ReinerBraun', }, }, ], @@ -734,15 +734,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'GendouIkari', - second: 'Eva0', + left: 'GendouIkari', + right: 'Eva0', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'Eva0', - second: 'Eva1', + left: 'Eva0', + right: 'Eva1', }, }, ], @@ -821,22 +821,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'colossusTitan', - second: 'zekeYeager', + left: 'colossusTitan', + right: 'zekeYeager', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'zekeYeager', - second: 'erenYeager', + left: 'zekeYeager', + right: 'erenYeager', }, }, { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'erenYeager', - second: 'annieLeonhart', + left: 'erenYeager', + right: 'annieLeonhart', }, }, ], @@ -864,8 +864,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedNamedImportsOrder', data: { - first: 'Rebecca', - second: 'Maine', + left: 'Rebecca', + right: 'Maine', }, }, ], diff --git a/test/sort-object-types.test.ts b/test/sort-object-types.test.ts index 1c7edc12..4b241a06 100644 --- a/test/sort-object-types.test.ts +++ b/test/sort-object-types.test.ts @@ -58,8 +58,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'name', - second: 'birthname', + left: 'name', + right: 'birthname', }, }, ], @@ -119,8 +119,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'slayerName', - second: 'attackType', + left: 'slayerName', + right: 'attackType', }, }, ], @@ -183,22 +183,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'age', - second: '[key: string]', + left: 'age', + right: '[key: string]', }, }, { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'occupation', - second: 'name', + left: 'occupation', + right: 'name', }, }, { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'residence', - second: 'rank', + left: 'residence', + right: 'rank', }, }, ], @@ -259,8 +259,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'goldenBatAttack(): void', - second: '8', + left: 'goldenBatAttack(): void', + right: '8', }, }, ], @@ -302,8 +302,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'reasonOfDeath', - second: 'name', + left: 'reasonOfDeath', + right: 'name', }, }, ], @@ -361,8 +361,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'name', - second: 'birthname', + left: 'name', + right: 'birthname', }, }, ], @@ -422,8 +422,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'slayerName', - second: 'attackType', + left: 'slayerName', + right: 'attackType', }, }, ], @@ -486,22 +486,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'age', - second: '[key: string]', + left: 'age', + right: '[key: string]', }, }, { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'occupation', - second: 'name', + left: 'occupation', + right: 'name', }, }, { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'residence', - second: 'rank', + left: 'residence', + right: 'rank', }, }, ], @@ -562,8 +562,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'goldenBatAttack(): void', - second: '8', + left: 'goldenBatAttack(): void', + right: '8', }, }, ], @@ -605,8 +605,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'reasonOfDeath', - second: 'name', + left: 'reasonOfDeath', + right: 'name', }, }, ], @@ -664,15 +664,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'name', - second: 'birthname', + left: 'name', + right: 'birthname', }, }, { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'birthname', - second: 'status', + left: 'birthname', + right: 'status', }, }, ], @@ -732,8 +732,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'demon', - second: 'attackType', + left: 'demon', + right: 'attackType', }, }, ], @@ -796,22 +796,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'age', - second: '[key: string]', + left: 'age', + right: '[key: string]', }, }, { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'occupation', - second: 'name', + left: 'occupation', + right: 'name', }, }, { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'name', - second: 'residence', + left: 'name', + right: 'residence', }, }, ], @@ -871,22 +871,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: '[...kills]', - second: '[[data]]', + left: '[...kills]', + right: '[[data]]', }, }, { messageId: 'unexpectedObjectTypesOrder', data: { - first: '[[data]]', - second: 'goldenBatAttack(): void', + left: '[[data]]', + right: 'goldenBatAttack(): void', }, }, { messageId: 'unexpectedObjectTypesOrder', data: { - first: '8', - second: 'hide', + left: '8', + right: 'hide', }, }, ], @@ -928,8 +928,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectTypesOrder', data: { - first: 'name', - second: 'reasonOfDeath', + left: 'name', + right: 'reasonOfDeath', }, }, ], diff --git a/test/sort-objects.test.ts b/test/sort-objects.test.ts index 7fe00710..fa7fc967 100644 --- a/test/sort-objects.test.ts +++ b/test/sort-objects.test.ts @@ -61,8 +61,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'hometown', - second: 'eye-color', + left: 'hometown', + right: 'eye-color', }, }, ], @@ -119,8 +119,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'hunter', - second: 'dog', + left: 'hunter', + right: 'dog', }, }, ], @@ -201,29 +201,29 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'crime-coefficient', - second: 'age', + left: 'crime-coefficient', + right: 'age', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'crime-coefficient', - second: 'age', + left: 'crime-coefficient', + right: 'age', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'shinya-kogami', - second: 'nobuchika-ginoza', + left: 'shinya-kogami', + right: 'nobuchika-ginoza', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'crime-coefficient', - second: 'age', + left: 'crime-coefficient', + right: 'age', }, }, ], @@ -277,15 +277,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'robots[1]', - second: 'getTestEva()', + left: 'robots[1]', + right: 'getTestEva()', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'getTestEva()', - second: 'eva-02', + left: 'getTestEva()', + right: 'eva-02', }, }, ], @@ -350,15 +350,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'genres', - second: 'id', + left: 'genres', + right: 'id', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'id', - second: 'name', + left: 'id', + right: 'name', }, }, ], @@ -414,15 +414,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'sister', - second: 'mrs-yokokawa', + left: 'sister', + right: 'mrs-yokokawa', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'mrs-yokokawa', - second: 'brother', + left: 'mrs-yokokawa', + right: 'brother', }, }, ], @@ -483,8 +483,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'hometown', - second: 'eye-color', + left: 'hometown', + right: 'eye-color', }, }, ], @@ -541,8 +541,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'hunter', - second: 'dog', + left: 'hunter', + right: 'dog', }, }, ], @@ -623,29 +623,29 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'crime-coefficient', - second: 'age', + left: 'crime-coefficient', + right: 'age', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'crime-coefficient', - second: 'age', + left: 'crime-coefficient', + right: 'age', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'shinya-kogami', - second: 'nobuchika-ginoza', + left: 'shinya-kogami', + right: 'nobuchika-ginoza', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'crime-coefficient', - second: 'age', + left: 'crime-coefficient', + right: 'age', }, }, ], @@ -699,15 +699,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'robots[1]', - second: 'getTestEva()', + left: 'robots[1]', + right: 'getTestEva()', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'getTestEva()', - second: 'eva-02', + left: 'getTestEva()', + right: 'eva-02', }, }, ], @@ -772,15 +772,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'genres', - second: 'id', + left: 'genres', + right: 'id', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'id', - second: 'name', + left: 'id', + right: 'name', }, }, ], @@ -836,15 +836,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'sister', - second: 'mrs-yokokawa', + left: 'sister', + right: 'mrs-yokokawa', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'mrs-yokokawa', - second: 'brother', + left: 'mrs-yokokawa', + right: 'brother', }, }, ], @@ -905,8 +905,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'age', - second: 'hometown', + left: 'age', + right: 'hometown', }, }, ], @@ -963,8 +963,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'dog', - second: 'hunter', + left: 'dog', + right: 'hunter', }, }, ], @@ -1045,29 +1045,29 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'age', - second: 'crime-coefficient', + left: 'age', + right: 'crime-coefficient', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'age', - second: 'crime-coefficient', + left: 'age', + right: 'crime-coefficient', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'akane-tsunemori', - second: 'nobuchika-ginoza', + left: 'akane-tsunemori', + right: 'nobuchika-ginoza', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'age', - second: 'crime-coefficient', + left: 'age', + right: 'crime-coefficient', }, }, ], @@ -1121,15 +1121,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'robots[1]', - second: 'getTestEva()', + left: 'robots[1]', + right: 'getTestEva()', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'getTestEva()', - second: 'eva-02', + left: 'getTestEva()', + right: 'eva-02', }, }, ], @@ -1194,22 +1194,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'episodes', - second: 'genres', + left: 'episodes', + right: 'genres', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'genres', - second: 'id', + left: 'genres', + right: 'id', }, }, { messageId: 'unexpectedObjectsOrder', data: { - first: 'id', - second: 'name', + left: 'id', + right: 'name', }, }, ], @@ -1265,8 +1265,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'sister', - second: 'mrs-yokokawa', + left: 'sister', + right: 'mrs-yokokawa', }, }, ], @@ -1308,8 +1308,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedObjectsOrder', data: { - first: 'mom', - second: 'daughter', + left: 'mom', + right: 'daughter', }, }, ], diff --git a/test/sort-union-types.test.ts b/test/sort-union-types.test.ts index 229364e7..ff29c762 100644 --- a/test/sort-union-types.test.ts +++ b/test/sort-union-types.test.ts @@ -46,8 +46,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: "'Parona'", - second: "'Gugu'", + left: "'Parona'", + right: "'Gugu'", }, }, ], @@ -97,29 +97,29 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'string', - second: 'any', + left: 'string', + right: 'any', }, }, { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'unknown', - second: 'null', + left: 'unknown', + right: 'null', }, }, { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'undefined', - second: 'never', + left: 'undefined', + right: 'never', }, }, { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'void', - second: 'bigint', + left: 'void', + right: 'bigint', }, }, ], @@ -145,8 +145,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: "'psychic-abilities'", - second: "'power'", + left: "'psychic-abilities'", + right: "'power'", }, }, ], @@ -172,8 +172,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'Zenitsu', - second: 'Inosuke', + left: 'Zenitsu', + right: 'Inosuke', }, }, ], @@ -207,8 +207,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: "{ name: 'Intelligent Titan', status: 'titan' }", - second: "{ name: 'Eren Yeager', species: 'human' }", + left: "{ name: 'Intelligent Titan', status: 'titan' }", + right: "{ name: 'Eren Yeager', species: 'human' }", }, }, ], @@ -252,8 +252,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'Saitama', - second: '( superstrike: () => void, ) => Hero[] | Saitama', + left: 'Saitama', + right: '( superstrike: () => void, ) => Hero[] | Saitama', }, }, ], @@ -299,8 +299,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: "'Parona'", - second: "'Gugu'", + left: "'Parona'", + right: "'Gugu'", }, }, ], @@ -350,29 +350,29 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'string', - second: 'any', + left: 'string', + right: 'any', }, }, { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'unknown', - second: 'null', + left: 'unknown', + right: 'null', }, }, { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'undefined', - second: 'never', + left: 'undefined', + right: 'never', }, }, { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'void', - second: 'bigint', + left: 'void', + right: 'bigint', }, }, ], @@ -398,8 +398,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: "'psychic-abilities'", - second: "'power'", + left: "'psychic-abilities'", + right: "'power'", }, }, ], @@ -425,8 +425,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'Zenitsu', - second: 'Inosuke', + left: 'Zenitsu', + right: 'Inosuke', }, }, ], @@ -460,8 +460,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: "{ name: 'Intelligent Titan', status: 'titan' }", - second: "{ name: 'Eren Yeager', species: 'human' }", + left: "{ name: 'Intelligent Titan', status: 'titan' }", + right: "{ name: 'Eren Yeager', species: 'human' }", }, }, ], @@ -505,8 +505,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'Saitama', - second: '( superstrike: () => void, ) => Hero[] | Saitama', + left: 'Saitama', + right: '( superstrike: () => void, ) => Hero[] | Saitama', }, }, ], @@ -552,8 +552,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: "'Joaan'", - second: "'Parona'", + left: "'Joaan'", + right: "'Parona'", }, }, ], @@ -603,22 +603,22 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'any', - second: 'unknown', + left: 'any', + right: 'unknown', }, }, { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'null', - second: 'undefined', + left: 'null', + right: 'undefined', }, }, { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'void', - second: 'bigint', + left: 'void', + right: 'bigint', }, }, ], @@ -644,8 +644,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: "'power'", - second: "'psychic-abilities'", + left: "'power'", + right: "'psychic-abilities'", }, }, ], @@ -696,8 +696,8 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: "{ name: 'Eren Yeager', species: 'human' }", - second: "{ name: 'Intelligent Titan', status: 'titan' }", + left: "{ name: 'Eren Yeager', species: 'human' }", + right: "{ name: 'Intelligent Titan', status: 'titan' }", }, }, ], @@ -741,15 +741,15 @@ describe(RULE_NAME, () => { { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'Saitama', - second: '( superstrike: () => void, ) => Hero[] | Saitama', + left: 'Saitama', + right: '( superstrike: () => void, ) => Hero[] | Saitama', }, }, { messageId: 'unexpectedUnionTypesOrder', data: { - first: 'Hero[]', - second: 'Saitama', + left: 'Hero[]', + right: 'Saitama', }, }, ], diff --git a/utils/pairwise.ts b/utils/pairwise.ts index 93cf3467..373f2699 100644 --- a/utils/pairwise.ts +++ b/utils/pairwise.ts @@ -1,14 +1,14 @@ export let pairwise = ( nodes: T[], - callback: (first: T, second: T, iteration: number) => void, + callback: (left: T, right: T, iteration: number) => void, ) => { if (nodes.length > 1) { for (let i = 1; i < nodes.length; i++) { - let first = nodes.at(i - 1) - let second = nodes.at(i) + let left = nodes.at(i - 1) + let right = nodes.at(i) - if (first && second) { - callback(first, second, i - 1) + if (left && right) { + callback(left, right, i - 1) } } }