Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
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
22c0b6c33f145593fc2f2df7496a874ec35471a4
1 parent
b1d0d1fc
lint all 检查
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletions
lint-all.js
lint.js → lint-commit.js
package.json
lint-all.js
0 → 100644
View file @
22c0b6c
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
=
[
'.'
];
const
cssfiles
=
[
'public/scss/**/*.css'
];
jsfiles
.
forEach
(
function
(
filepath
)
{
console
.
log
(
`
JS
$
{
filepath
}
检查结果:`
);
shelljs
.
exec
(
`
$
{
lintPath
.
js
}
$
{
ext
}
-
f
table
-
c
.
eslintrc
--
cache
$
{
filepath
}
`
);
});
cssfiles
.
forEach
(
function
(
filepath
)
{
console
.
log
(
`
CSS
$
{
filepath
}
检查结果:`
);
shelljs
.
exec
(
`
$
{
lintPath
.
css
}
$
{
ext
}
--
syntax
scss
--
config
.
stylelintrc
--
custom
-
formatter
.
/
node_modules
/
stylelint
-
formatter
-
table
/
index
.
js
'${filepath}'
`
);
// eslint-disable-line
});
...
...
lint.js → lint
-commit
.js
View file @
22c0b6c
package.json
View file @
22c0b6c
...
...
@@ -15,7 +15,8 @@
"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'"
,
"precommit"
:
"node lint.js"
,
"lint-all"
:
"node lint-all.js"
,
"precommit"
:
"node lint-commit.js"
,
"prod"
:
"git pull && gulp --cwd=public ge && pm2 reload yohobuy-node"
},
"dependencies"
:
{
...
...
@@ -85,6 +86,7 @@
"shelljs"
:
"^0.7.0"
,
"stylelint"
:
"^7.9.0"
,
"stylelint-config-yoho"
:
"^1.2.8"
,
"stylelint-formatter-table"
:
"^1.0.3"
,
"webpack"
:
"1.13.2"
,
"webpack-dev-server"
:
"^1.14.1"
,
"webpack-stream"
:
"^3.1.0"
,
...
...
Please
register
or
login
to post a comment