Refactor to improve iterations
- Use function abstractions (such as map, reduce, filter etc.) over for-of loops to gain benefits of having less side effects and easier readability. - Enable `downLevelIterations` for writing modern code with lazy evaluation. - Refactor for of loops to named abstractions to clearly express their intentions without needing to analyse the loop itself. - Add missing cases for changes that had no tests.
This commit is contained in:
@@ -13,7 +13,7 @@ export class ScriptStub extends BaseEntity<string> implements IScript {
|
||||
|
||||
public readonly documentationUrls = new Array<string>();
|
||||
|
||||
public level = RecommendationLevel.Standard;
|
||||
public level? = RecommendationLevel.Standard;
|
||||
|
||||
constructor(public readonly id: string) {
|
||||
super(id);
|
||||
@@ -23,7 +23,7 @@ export class ScriptStub extends BaseEntity<string> implements IScript {
|
||||
return Boolean(this.code.revert);
|
||||
}
|
||||
|
||||
public withLevel(value: RecommendationLevel): ScriptStub {
|
||||
public withLevel(value?: RecommendationLevel): ScriptStub {
|
||||
this.level = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user