-
Notifications
You must be signed in to change notification settings - Fork 887
Conversation
This formatter does not output any lint errors. Instead, it lists all of the files that had lint errors. This is useful for creating lists of files that need to be taken care of, or for bulk-opening all of the files in an editor from CLI. Todo: test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, I like the idea overall.
minor name change suggestion: "files list" instead of "file list"
|
||
export class Formatter extends AbstractFormatter { | ||
public format(failures: RuleFailure[]): string { | ||
const files: Array<string> = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: please format the typedef as string[]
public format(failures: RuleFailure[]): string { | ||
const files: Array<string> = []; | ||
|
||
failures.forEach((failure: RuleFailure) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use a for-of loop instead of forEach
, or refactor this logic into a reduce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Looks like VSCode decided to format-on-save tsconfig.json files to 2-space indents. |
@nomaed small merge conflict to address, otherwise looks good |
…matter # Conflicts: # src/formatters/stylishFormatter.ts
@adidahiya Merge resolved |
} | ||
} | ||
|
||
return files.join("\n") + "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about always printing this trailing newline. See #1553 for discussion about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkillian I am thinking that you're talking about cases when files is empty?
Because there is a need of a newline at the end of the output, if there is an output (of course, this is not an empty line).
This formatter does not output any lint errors. Instead, it lists all of the files that had lint errors. This is useful for creating lists of files that need to be taken care of, or for bulk-opening all of the files in an editor from CLI.
) Addresses review #875140 in PR palantir#1558 for compatibility with discussion item palantir#1553
This formatter does not output any lint error details. Instead, it lists all of the files that had lint errors.
This is useful for creating lists of files that need to be taken care
of, or for bulk-opening all of the files in an editor from CLI.
Example:
Prose
Files-list
Usage examples:
Opening all files that require fixing in an editor:
When using Perforce RCS, checking out all files for edit:
$ tslint --project tsconfig.json -t fileslist | xargs p4 edit