no-unused-expressions: [error, { allowTernary: true }]

This commit is contained in:
Alexander
2019-08-08 21:48:54 +03:00
parent ceccfd8867
commit 78d8e80330
2 changed files with 4 additions and 12 deletions
+1 -1
View File
@@ -92,7 +92,7 @@
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-unsafe-finally": "error",
"no-unused-expressions": "error",
"no-unused-expressions": ["error", { "allowTernary": true }],
"no-unused-labels": "error",
"no-var": "error",
"object-shorthand": "error",
@@ -214,17 +214,9 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor {
}
function insertAccessor(changeTracker: textChanges.ChangeTracker, file: SourceFile, accessor: AccessorDeclaration, declaration: AcceptedDeclaration, container: ContainerDeclaration) {
if (isParameterPropertyDeclaration(declaration)) {
changeTracker.insertNodeAtClassStart(file, <ClassLikeDeclaration>container, accessor);
}
else {
if (isPropertyAssignment(declaration)) {
changeTracker.insertNodeAfterComma(file, declaration, accessor);
}
else {
changeTracker.insertNodeAfter(file, declaration, accessor);
}
}
isParameterPropertyDeclaration(declaration) ? changeTracker.insertNodeAtClassStart(file, <ClassLikeDeclaration>container, accessor) :
isPropertyAssignment(declaration) ? changeTracker.insertNodeAfterComma(file, declaration, accessor) :
changeTracker.insertNodeAfter(file, declaration, accessor);
}
function updateReadonlyPropertyInitializerStatementConstructor(changeTracker: textChanges.ChangeTracker, file: SourceFile, constructor: ConstructorDeclaration, fieldName: string, originalName: string) {