Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
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
ccbikai
9 years ago
Commit
02ab7797b74295446677cf4443d5a9e16d667bb6
1 parent
7ba41710
支持检查 scss 语法
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
lint.js
package.json
lint.js
View file @
02ab779
...
...
@@ -32,13 +32,13 @@ if (changeFiles.js) {
if
(
changeFiles
.
css
)
{
changeFiles
.
css
=
changeFiles
.
css
.
replace
(
/
\n
/g
,
' '
);
lintResult
.
css
=
shelljs
.
exec
(
`
$
{
lintPath
.
css
}
$
{
ext
}
--
config
.
stylelintrc
$
{
changeFiles
.
css
}
`
);
lintResult
.
css
=
shelljs
.
exec
(
`
$
{
lintPath
.
css
}
$
{
ext
}
--
syntax
scss
--
config
.
stylelintrc
$
{
changeFiles
.
css
}
`
);
}
if
(
changeFiles
.
vue
)
{
changeFiles
.
vue
=
changeFiles
.
vue
.
replace
(
/
\n
/g
,
' '
);
lintResult
.
vueScript
=
shelljs
.
exec
(
`
$
{
lintPath
.
js
}
$
{
ext
}
-
c
.
eslintrc
--
cache
--
fix
$
{
changeFiles
.
vue
}
`
);
lintResult
.
vueStyle
=
shelljs
.
exec
(
`
$
{
lintPath
.
css
}
$
{
ext
}
--
extract
--
config
.
stylelintrc
$
{
changeFiles
.
vue
}
`
);
lintResult
.
vueStyle
=
shelljs
.
exec
(
`
$
{
lintPath
.
css
}
$
{
ext
}
--
syntax
scss
--
extract
--
config
.
stylelintrc
$
{
changeFiles
.
vue
}
`
);
// eslint-disable-line
}
const
errorCode
=
lintResult
.
js
.
code
||
lintResult
.
css
.
code
||
lintResult
.
vueScript
.
code
||
lintResult
.
vueStyle
.
code
;
...
...
package.json
View file @
02ab779
...
...
@@ -13,8 +13,8 @@
"online"
:
"NODE_ENV=\"production\" node app.js"
,
"debug"
:
"DEBUG=\"express:*\" nodemon -e js,hbs -i public/ app.js"
,
"lint-js"
:
"eslint -c .eslintrc --cache --fix ."
,
"lint-css"
:
"stylelint --config .stylelintrc public/scss/**/*.css"
,
"lint-vue"
:
"stylelint --extract --config .stylelintrc public/vue/**/*.vue || eslint -c .eslintrc --cache --fix public/vue/**/*.vue"
,
"lint-css"
:
"stylelint --syntax scss --config .stylelintrc public/scss/**/*.css"
,
"lint-vue"
:
"stylelint --syntax scss --extract --config .stylelintrc public/vue/**/*.vue || eslint -c .eslintrc --cache --fix public/vue/**/*.vue"
,
"precommit"
:
"node lint.js"
},
"license"
:
"MIT"
,
...
...
Please
register
or
login
to post a comment