mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 03:39:55 +00:00
Add switch to auto fix eslint and stylelint issues
This commit is contained in:
parent
7470a3b813
commit
f22e39e22b
@ -1,9 +1,10 @@
|
||||
module.exports = function(grunt) {
|
||||
require("time-grunt")(grunt);
|
||||
var fix = (grunt.option("env") || "lint") === "lint";
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON("package.json"),
|
||||
eslint: {
|
||||
options: {
|
||||
fix: fix,
|
||||
configFile: ".eslintrc.json"
|
||||
},
|
||||
target: [
|
||||
@ -26,6 +27,7 @@ module.exports = function(grunt) {
|
||||
stylelint: {
|
||||
simple: {
|
||||
options: {
|
||||
fix: fix,
|
||||
configFile: ".stylelintrc.json"
|
||||
},
|
||||
src: [
|
||||
@ -101,5 +103,6 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks("grunt-jsonlint");
|
||||
grunt.loadNpmTasks("grunt-yamllint");
|
||||
grunt.loadNpmTasks("grunt-markdownlint");
|
||||
|
||||
grunt.registerTask("default", ["eslint", "stylelint", "jsonlint", "markdownlint", "yamllint"]);
|
||||
};
|
||||
|
@ -12,9 +12,9 @@
|
||||
"test": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests --recursive",
|
||||
"test:unit": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests/unit --recursive",
|
||||
"test:e2e": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests/e2e --recursive",
|
||||
"test:lint": "grunt",
|
||||
"test:lint": "grunt --env=test",
|
||||
"config:check": "node tests/configs/check_config.js",
|
||||
"lint": "grunt"
|
||||
"lint": "grunt --env=lint"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
Loading…
x
Reference in New Issue
Block a user