Skip to content

Commit

Permalink
style(utils): use more curly
Browse files Browse the repository at this point in the history
  • Loading branch information
papaia committed Feb 8, 2021
1 parent 00b644e commit f82dfac
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ const makeParamError = (param: string) =>
`Invalid or missing \`${param}\` option given to prettignore.`;
export const validateConfig = (config: PrettignoreConfig) => {
const errors = [];
if (!Array.isArray(config.files)) errors.push(makeParamError('files'));
if (config.endOfLine && !EndOfLine[config.endOfLine])
if (!Array.isArray(config.files)) {
errors.push(makeParamError('files'));
}
if (config.endOfLine && !EndOfLine[config.endOfLine]) {
errors.push(makeParamError('endOfLine'));
}
if (errors.length) {
errors.forEach((e) => console.error(e));
process.exit(1);
Expand Down

0 comments on commit f82dfac

Please sign in to comment.