Commit b6267b5a authored by 陈帅's avatar 陈帅

support pretier info ignored

parent 7b77a0d7
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
"puppeteer": "^1.10.0" "puppeteer": "^1.10.0"
}, },
"lint-staged": { "lint-staged": {
"**/*.{js,jsx,less}": [ "**/*.{js,ts,tsx,json,jsx,less}": [
"node ./scripts/lint-prettier.js", "node ./scripts/lint-prettier.js",
"git add" "git add"
], ],
......
...@@ -22,6 +22,9 @@ files.forEach(file => { ...@@ -22,6 +22,9 @@ files.forEach(file => {
}); });
try { try {
const fileInfo = prettier.getFileInfo.sync(file); const fileInfo = prettier.getFileInfo.sync(file);
if (fileInfo.ignored) {
return;
}
const input = fs.readFileSync(file, 'utf8'); const input = fs.readFileSync(file, 'utf8');
const withParserOptions = { const withParserOptions = {
...options, ...options,
......
...@@ -27,6 +27,9 @@ files.forEach(file => { ...@@ -27,6 +27,9 @@ files.forEach(file => {
config: prettierConfigPath, config: prettierConfigPath,
}); });
const fileInfo = prettier.getFileInfo.sync(file); const fileInfo = prettier.getFileInfo.sync(file);
if (fileInfo.ignored) {
return;
}
try { try {
const input = fs.readFileSync(file, 'utf8'); const input = fs.readFileSync(file, 'utf8');
const withParserOptions = { const withParserOptions = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment