Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
Remove ? from abstract format's params.
Browse files Browse the repository at this point in the history
As noted in comments on #3838, these parameters in the interface definition should not have `?` as they are always passed to the implementation.
Implementors should instead choose to _omit_ the args from their implementations if unused.
  • Loading branch information
mastermatt committed May 7, 2018
1 parent 76c2ece commit ba646a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/language/formatter/abstractFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { IFormatter, IFormatterMetadata } from "./formatter";

export abstract class AbstractFormatter implements IFormatter {
public static metadata: IFormatterMetadata;
public abstract format(failures: RuleFailure[], fixes?: RuleFailure[], fileNames?: string[]): string;
public abstract format(failures: RuleFailure[], fixes: RuleFailure[], fileNames: string[]): string;

protected sortFailures(failures: RuleFailure[]): RuleFailure[] {
return failures.slice().sort(RuleFailure.compare);
Expand Down
2 changes: 1 addition & 1 deletion src/language/formatter/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ export interface IFormatter {
* @param fixes Fixed linter failures. Available when the `--fix` argument is used on the command line
* @param fileNames All of file paths that were linted
*/
format(failures: RuleFailure[], fixes?: RuleFailure[], fileNames?: string[]): string;
format(failures: RuleFailure[], fixes: RuleFailure[], fileNames: string[]): string;
}

0 comments on commit ba646a1

Please sign in to comment.