Skip to content

Commit

Permalink
refactor: renames requiresEndingSemicolonWhenInline to `addSafetySe…
Browse files Browse the repository at this point in the history
…micolonWhenInline`
  • Loading branch information
hugop95 committed Oct 25, 2024
1 parent df3a5be commit d981c71
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rules/sort-classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ export default createEslintRule<SortClassesOptions, MESSAGE_ID>({
node: member,
dependencies,
name,
requiresEndingSemicolonWhenInline: requiresEndingSemicolon,
addSafetySemicolonWhenInline: requiresEndingSemicolon,
dependencyName: getDependencyName(
name,
modifiers.includes('static'),
Expand Down
2 changes: 1 addition & 1 deletion rules/sort-exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default createEslintRule<Options, MESSAGE_ID>({
size: rangeToDiff(node, sourceCode),
name: node.source.value,
node,
requiresEndingSemicolonWhenInline: true,
addSafetySemicolonWhenInline: true,
}
let lastNode = parts.at(-1)?.at(-1)
if (
Expand Down
2 changes: 1 addition & 1 deletion rules/sort-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ export default createEslintRule<Options<string[]>, MESSAGE_ID>({
size: rangeToDiff(node, sourceCode),
group: getGroup(),
node,
requiresEndingSemicolonWhenInline: true,
addSafetySemicolonWhenInline: true,
isIgnored:
!options.sortSideEffects &&
isSideEffect &&
Expand Down
2 changes: 1 addition & 1 deletion rules/sort-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export default createEslintRule<Options<string[]>, MESSAGE_ID>({
node: element,
group: getGroup(),
name,
requiresEndingSemicolonWhenInline: true,
addSafetySemicolonWhenInline: true,
}

if (
Expand Down
2 changes: 1 addition & 1 deletion rules/sort-object-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export default createEslintRule<Options<string[]>, MESSAGE_ID>({
group: getGroup(),
node: member,
name,
requiresEndingSemicolonWhenInline: true,
addSafetySemicolonWhenInline: true,
}

if (
Expand Down
2 changes: 1 addition & 1 deletion rules/sort-switch-case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default createEslintRule<Options, MESSAGE_ID>({
size: rangeToDiff(caseNode.test ?? caseNode, sourceCode),
node: caseNode,
isDefaultClause,
requiresEndingSemicolonWhenInline: true,
addSafetySemicolonWhenInline: true,
name,
}
},
Expand Down
2 changes: 1 addition & 1 deletion typings/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { TSESTree } from '@typescript-eslint/types'

export interface SortingNode<Node extends TSESTree.Node = TSESTree.Node> {
requiresEndingSemicolonWhenInline?: boolean
hasMultipleImportDeclarations?: boolean
addSafetySemicolonWhenInline?: boolean
group?: string
name: string
size: number
Expand Down
2 changes: 1 addition & 1 deletion utils/make-fixes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export let makeFixes = (
if (
!sortedNodeText.endsWith(';') &&
!sortedNodeText.endsWith(',') &&
sortedSortingNode.requiresEndingSemicolonWhenInline &&
sortedSortingNode.addSafetySemicolonWhenInline &&
nextToken &&
node.loc.start.line === nextToken.loc.start.line &&
nextToken.value !== ';' &&
Expand Down

0 comments on commit d981c71

Please sign in to comment.