Skip to content

Commit

Permalink
Move prettier configuration to .prettierrc (#3921)
Browse files Browse the repository at this point in the history
This means that people can develop with the intended prettier
configuration in their local editor (as will look for a .prettierrc by
default), while maintaining the `forceprettier` functionality (and
keeps the configuration in one place)
  • Loading branch information
kizza authored and jpoon committed Jul 25, 2019
1 parent bf5e24d commit 38cca47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "es5"
}
13 changes: 5 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,12 @@ function runPrettier(command, done) {
}

const prettierPath = path.normalize('./node_modules/.bin/prettier');
exec(
`${prettierPath} --write --print-width 100 --single-quote --trailing-comma es5 ${files}`,
function(err) {
if (err) {
return done(new PluginError('runPrettier', { message: err }));
}
return done();
exec(`${prettierPath} --write ${files}`, function(err) {
if (err) {
return done(new PluginError('runPrettier', { message: err }));
}
);
return done();
});
});
}

Expand Down

0 comments on commit 38cca47

Please sign in to comment.