Skip to content

Commit

Permalink
support pretier info ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Dec 1, 2018
1 parent 7b77a0d commit b6267b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"puppeteer": "^1.10.0"
},
"lint-staged": {
"**/*.{js,jsx,less}": [
"**/*.{js,ts,tsx,json,jsx,less}": [
"node ./scripts/lint-prettier.js",
"git add"
],
Expand Down
3 changes: 3 additions & 0 deletions scripts/lint-prettier.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ files.forEach(file => {
});
try {
const fileInfo = prettier.getFileInfo.sync(file);
if (fileInfo.ignored) {
return;
}
const input = fs.readFileSync(file, 'utf8');
const withParserOptions = {
...options,
Expand Down
3 changes: 3 additions & 0 deletions scripts/prettier.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ files.forEach(file => {
config: prettierConfigPath,
});
const fileInfo = prettier.getFileInfo.sync(file);
if (fileInfo.ignored) {
return;
}
try {
const input = fs.readFileSync(file, 'utf8');
const withParserOptions = {
Expand Down

0 comments on commit b6267b5

Please sign in to comment.