mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-27 17:00:54 +01:00
Fix linter errors and warnings
This commit is contained in:
parent
bcf634faa8
commit
cedc65d9fa
@ -1,4 +1,7 @@
|
||||
/build
|
||||
/material
|
||||
/site
|
||||
/lib
|
||||
|
||||
# Temporary
|
||||
/tests/regression
|
||||
/lib/tasks/tests/regression
|
||||
|
@ -42,7 +42,7 @@
|
||||
"rules": {
|
||||
"array-callback-return": 2,
|
||||
"array-bracket-spacing": 2,
|
||||
"arrow-body-style": 2,
|
||||
"arrow-body-style": [2, "always"],
|
||||
"arrow-parens": [2, "as-needed"],
|
||||
"arrow-spacing": 2,
|
||||
"block-scoped-var": 2,
|
||||
|
@ -39,7 +39,6 @@ addons:
|
||||
# Install dependencies
|
||||
before_script:
|
||||
- sudo pip install -r requirements.txt
|
||||
- npm install
|
||||
|
||||
# Perform build and tests
|
||||
script: npm run build
|
||||
|
@ -60,8 +60,8 @@ const args = yargs
|
||||
* Override gulp.src() for nicer error handling.
|
||||
*/
|
||||
const src = gulp.src
|
||||
gulp.src = (...glob) =>
|
||||
src.apply(gulp, glob)
|
||||
gulp.src = (...glob) => {
|
||||
return src.apply(gulp, glob)
|
||||
.pipe(
|
||||
plumber(function(error) {
|
||||
util.log(util.colors.red(
|
||||
@ -86,12 +86,14 @@ gulp.src = (...glob) =>
|
||||
if (args._[0] !== "watch")
|
||||
throw error
|
||||
}))
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to load a task
|
||||
*/
|
||||
const load = task =>
|
||||
const load = task => {
|
||||
require(`./${config.lib}/tasks/${task}`)(gulp, config, args)
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Images
|
||||
@ -114,12 +116,12 @@ gulp.task("assets:images:build:svg",
|
||||
*/
|
||||
gulp.task("assets:images:build", args.clean ? [
|
||||
"assets:images:clean"
|
||||
] : [], () =>
|
||||
gulp.start([
|
||||
] : [], () => {
|
||||
return gulp.start([
|
||||
"assets:images:build:ico",
|
||||
"assets:images:build:svg"
|
||||
])
|
||||
)
|
||||
})
|
||||
|
||||
/*
|
||||
* Clean images generated by build
|
||||
@ -152,7 +154,7 @@ gulp.task("assets:javascripts:build", (args.clean ? [
|
||||
] : []).concat(args.lint ? [
|
||||
"assets:javascripts:lint"
|
||||
] : []), () => {
|
||||
gulp.start([
|
||||
return gulp.start([
|
||||
"assets:javascripts:build:application",
|
||||
"assets:javascripts:build:modernizr"
|
||||
])
|
||||
|
15
bin/lint
15
bin/lint
@ -27,5 +27,18 @@ if [ ! -d ../node_modules ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run command
|
||||
# Run ESLint
|
||||
$(pwd)/node_modules/.bin/eslint .
|
||||
ESLINT=$?
|
||||
|
||||
# Run Sass-Lint
|
||||
$(pwd)/node_modules/.bin/sass-lint -c .sass-lint.yml -vq
|
||||
SASSLINT=$?
|
||||
|
||||
# If one command failed, exit with error
|
||||
if [ $ESLINT == 1 ] || [ $SASSLINT == 1 ]; then
|
||||
exit 1
|
||||
fi;
|
||||
|
||||
# Otherwise return with success
|
||||
exit 0
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
# Check if "npm install" was executed
|
||||
if [ ! -d $(pwd)/node_modules ]; then
|
||||
ls $(pwd)
|
||||
echo "\"node_modules\" not found:"
|
||||
echo "npm install"
|
||||
exit 1
|
||||
|
@ -40,7 +40,7 @@ export default (gulp, config, args) => {
|
||||
stream({
|
||||
entry: [
|
||||
"whatwg-fetch",
|
||||
"application.js",
|
||||
"application.js"
|
||||
],
|
||||
output: {
|
||||
filename: "application.js",
|
||||
|
Loading…
Reference in New Issue
Block a user