Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
b6267b5a
Commit
b6267b5a
authored
Dec 01, 2018
by
ιεΈ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support pretier info ignored
parent
7b77a0d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
package.json
package.json
+1
-1
scripts/lint-prettier.js
scripts/lint-prettier.js
+3
-0
scripts/prettier.js
scripts/prettier.js
+3
-0
No files found.
package.json
View file @
b6267b5a
...
@@ -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"
],
],
...
...
scripts/lint-prettier.js
View file @
b6267b5a
...
@@ -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
,
...
...
scripts/prettier.js
View file @
b6267b5a
...
@@ -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
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment