Skip to content

Commit 78d8e80

Browse files
committed
no-unused-expressions: [error, { allowTernary: true }]
1 parent ceccfd8 commit 78d8e80

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"no-trailing-spaces": "error",
9393
"no-undef-init": "error",
9494
"no-unsafe-finally": "error",
95-
"no-unused-expressions": "error",
95+
"no-unused-expressions": ["error", { "allowTernary": true }],
9696
"no-unused-labels": "error",
9797
"no-var": "error",
9898
"object-shorthand": "error",

src/services/refactors/generateGetAccessorAndSetAccessor.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,9 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor {
214214
}
215215

216216
function insertAccessor(changeTracker: textChanges.ChangeTracker, file: SourceFile, accessor: AccessorDeclaration, declaration: AcceptedDeclaration, container: ContainerDeclaration) {
217-
if (isParameterPropertyDeclaration(declaration)) {
218-
changeTracker.insertNodeAtClassStart(file, <ClassLikeDeclaration>container, accessor);
219-
}
220-
else {
221-
if (isPropertyAssignment(declaration)) {
222-
changeTracker.insertNodeAfterComma(file, declaration, accessor);
223-
}
224-
else {
225-
changeTracker.insertNodeAfter(file, declaration, accessor);
226-
}
227-
}
217+
isParameterPropertyDeclaration(declaration) ? changeTracker.insertNodeAtClassStart(file, <ClassLikeDeclaration>container, accessor) :
218+
isPropertyAssignment(declaration) ? changeTracker.insertNodeAfterComma(file, declaration, accessor) :
219+
changeTracker.insertNodeAfter(file, declaration, accessor);
228220
}
229221

230222
function updateReadonlyPropertyInitializerStatementConstructor(changeTracker: textChanges.ChangeTracker, file: SourceFile, constructor: ConstructorDeclaration, fieldName: string, originalName: string) {

0 commit comments

Comments
 (0)