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
ac86837d
Commit
ac86837d
authored
Dec 01, 2018
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #2953,prettier support win
parent
4eb06991
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
7 deletions
+56
-7
.eslintignore
.eslintignore
+2
-1
package.json
package.json
+1
-1
scripts/prettier.js
scripts/prettier.js
+48
-0
src/components/DescriptionList/DescriptionList.js
src/components/DescriptionList/DescriptionList.js
+2
-3
src/manifest.json
src/manifest.json
+3
-2
No files found.
.eslintignore
View file @
ac86837d
/functions/mock/**
/scripts
\ No newline at end of file
package.json
View file @
ac86837d
...
...
@@ -20,7 +20,7 @@
"test"
:
"umi test"
,
"test:component"
:
"umi test ./src/components"
,
"test:all"
:
"node ./tests/run-tests.js"
,
"prettier"
:
"
prettier --write './src/**/*'
"
,
"prettier"
:
"
node node ./scripts/prettier.js
"
,
"docker:dev"
:
"docker-compose -f ./docker/docker-compose.dev.yml up"
,
"docker:build"
:
"docker-compose -f ./docker/docker-compose.dev.yml build"
,
"docker-prod:dev"
:
"docker-compose -f ./docker/docker-compose.yml up"
,
...
...
scripts/prettier.js
0 → 100644
View file @
ac86837d
/**
* copy to https://github.com/facebook/react/blob/master/scripts/prettier/index.js
* prettier api doc https://prettier.io/docs/en/api.html
*----------*****--------------
* prettier all js and all ts.
*----------*****--------------
*/
const
glob
=
require
(
'
glob
'
);
const
prettier
=
require
(
'
prettier
'
);
const
fs
=
require
(
'
fs
'
);
const
prettierConfigPath
=
require
.
resolve
(
'
../.prettierrc
'
);
let
didError
=
false
;
let
files
=
[];
const
jsFiles
=
glob
.
sync
(
'
src/**/*.js*
'
,
{
ignore
:
[
'
**/node_modules/**
'
,
'
build/**
'
]
});
const
tsFiles
=
glob
.
sync
(
'
src/**/*.ts*
'
,
{
ignore
:
[
'
**/node_modules/**
'
,
'
build/**
'
]
});
files
=
files
.
concat
(
jsFiles
);
files
=
files
.
concat
(
tsFiles
);
if
(
!
files
.
length
)
{
return
;
}
files
.
forEach
(
async
file
=>
{
const
options
=
prettier
.
resolveConfig
.
sync
(
file
,
{
config
:
prettierConfigPath
,
});
const
fileInfo
=
await
prettier
.
getFileInfo
(
file
);
try
{
const
input
=
fs
.
readFileSync
(
file
,
'
utf8
'
);
const
withParserOptions
=
{
...
options
,
parser
:
fileInfo
.
inferredParser
,
};
const
output
=
prettier
.
format
(
input
,
withParserOptions
);
if
(
output
!==
input
)
{
fs
.
writeFileSync
(
file
,
output
,
'
utf8
'
);
console
.
log
(
`\x1b[34m
${
file
}
is prettier`
);
}
}
catch
(
e
)
{
didError
=
true
;
}
});
console
.
log
(
'
\
x1b[32m prettier success!
'
);
if
(
didError
)
{
process
.
exit
(
1
);
}
src/components/DescriptionList/DescriptionList.js
View file @
ac86837d
...
...
@@ -22,9 +22,8 @@ const DescriptionList = ({
<
div
className
=
{
clsString
}
{...
restProps
}
>
{
title
?
<
div
className
=
{
styles
.
title
}
>
{
title
}
<
/div> : null
}
<
Row
gutter
=
{
gutter
}
>
{
React
.
Children
.
map
(
children
,
child
=>
(
child
?
React
.
cloneElement
(
child
,
{
column
})
:
child
)
{
React
.
Children
.
map
(
children
,
child
=>
child
?
React
.
cloneElement
(
child
,
{
column
})
:
child
)}
<
/Row
>
<
/div
>
...
...
src/manifest.json
View file @
ac86837d
...
...
@@ -9,7 +9,8 @@
{
"src"
:
"icons/icon-192x192.png"
,
"sizes"
:
"192x192"
},{
},
{
"src"
:
"icons/icon-128x128.png"
,
"sizes"
:
"128x128"
}
...
...
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