Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
沈志敏
8 years ago
Commit
b7855587c1accffad035bce12c645184c7bd2cb8
1 parent
2fcd5edf
代码检查
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
check.js
package.json
check.js
0 → 100644
View file @
b785558
const
shelljs
=
require
(
'shelljs'
);
const
path
=
require
(
'path'
);
const
ext
=
process
.
platform
===
'win32'
?
'.cmd'
:
''
;
// Windows 平台需要加后缀
const
lintPath
=
{
js
:
path
.
resolve
(
'./node_modules/.bin/eslint'
),
css
:
path
.
resolve
(
'./node_modules/.bin/stylelint'
)
};
const
jsfiles
=
[
'.'
,
'public/vue/**/*.vue'
];
const
cssfiles
=
[
'public/scss/**/*.css'
,
'public/vue/**/*.vue'
];
jsfiles
.
forEach
(
function
(
filepath
){
shelljs
.
exec
(
`
$
{
lintPath
.
js
}
$
{
ext
}
-
f
table
-
c
.
eslintrc
--
cache
$
{
filepath
}
`
);
});
cssfiles
.
forEach
(
function
(
filepath
){
shelljs
.
exec
(
`
$
{
lintPath
.
css
}
$
{
ext
}
--
syntax
scss
--
config
.
stylelintrc
--
custom
-
formatter
.
/
node_modules
/
stylelint
-
formatter
-
table
/
index
.
js
'${filepath}'
`
);
})
...
...
package.json
View file @
b785558
...
...
@@ -17,6 +17,7 @@
"lint-css"
:
"stylelint --syntax scss --config .stylelintrc public/scss/**/*.css"
,
"lint-vue-js"
:
"eslint -c .eslintrc --cache public/vue/**/*.vue"
,
"lint-vue-css"
:
"stylelint --syntax scss --extract --config .stylelintrc public/vue/**/*.vue"
,
"lint-all"
:
"node check.js"
,
"precommit"
:
"node lint.js"
},
"license"
:
"MIT"
,
...
...
@@ -92,6 +93,7 @@
"shelljs"
:
"^0.7.6"
,
"stylelint"
:
"^7.9.0"
,
"stylelint-config-yoho"
:
"^1.2.8"
,
"stylelint-formatter-table"
:
"^1.0.2"
,
"stylelint-processor-html"
:
"^1.0.0"
,
"vue"
:
"^2.1.10"
,
"vue-loader"
:
"^11.1.0"
,
...
...
Please
register
or
login
to post a comment