Skip to content

Commit

Permalink
feat(eslint-config): enable eslint curly (#308)
Browse files Browse the repository at this point in the history
this is disabled by prettier default config and we want it enabled it
  • Loading branch information
juanpicado authored Dec 28, 2019
1 parent 617e5da commit 91acb12
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion core/file-locking/src/__tests__/lock.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const getFilePath = (filename: string): string => {
const removeTempFile = (filename: string): void => {
const filepath = getFilePath(filename);
fs.unlink(filepath, error => {
if (error) throw error;
if (error) {
throw error;
}
});
};

Expand Down
7 changes: 5 additions & 2 deletions plugins/aws-s3-storage/src/s3PackageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,11 @@ export default class S3PackageManager implements ILocalPackageManager {
Prefix: `${this.config.keyPrefix}${this.packageName}`,
},
function(err) {
if (err && is404Error(err as VerdaccioError)) callback(null);
else callback(err);
if (err && is404Error(err as VerdaccioError)) {
callback(null);
} else {
callback(err);
}
}
);
}
Expand Down
4 changes: 3 additions & 1 deletion plugins/htpasswd/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export function unlockFile(name: string, cb: Callback): void {
export function parseHTPasswd(input: string): Record<string, any> {
return input.split('\n').reduce((result, line) => {
const args = line.split(':', 3);
if (args.length > 1) result[args[0]] = args[1];
if (args.length > 1) {
result[args[0]] = args[1];
}
return result;
}, {});
}
Expand Down
1 change: 1 addition & 0 deletions tools/eslint-config/rules/prettier.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
extends: ['plugin:prettier/recommended', 'prettier/@typescript-eslint'],
rules: {
curly: ['error', 'all'],
'prettier/prettier': [
'error',
{
Expand Down

0 comments on commit 91acb12

Please sign in to comment.