mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +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) {
|
module.exports = function(grunt) {
|
||||||
require("time-grunt")(grunt);
|
require("time-grunt")(grunt);
|
||||||
|
var fix = (grunt.option("env") || "lint") === "lint";
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
pkg: grunt.file.readJSON("package.json"),
|
|
||||||
eslint: {
|
eslint: {
|
||||||
options: {
|
options: {
|
||||||
|
fix: fix,
|
||||||
configFile: ".eslintrc.json"
|
configFile: ".eslintrc.json"
|
||||||
},
|
},
|
||||||
target: [
|
target: [
|
||||||
@ -26,6 +27,7 @@ module.exports = function(grunt) {
|
|||||||
stylelint: {
|
stylelint: {
|
||||||
simple: {
|
simple: {
|
||||||
options: {
|
options: {
|
||||||
|
fix: fix,
|
||||||
configFile: ".stylelintrc.json"
|
configFile: ".stylelintrc.json"
|
||||||
},
|
},
|
||||||
src: [
|
src: [
|
||||||
@ -101,5 +103,6 @@ module.exports = function(grunt) {
|
|||||||
grunt.loadNpmTasks("grunt-jsonlint");
|
grunt.loadNpmTasks("grunt-jsonlint");
|
||||||
grunt.loadNpmTasks("grunt-yamllint");
|
grunt.loadNpmTasks("grunt-yamllint");
|
||||||
grunt.loadNpmTasks("grunt-markdownlint");
|
grunt.loadNpmTasks("grunt-markdownlint");
|
||||||
|
|
||||||
grunt.registerTask("default", ["eslint", "stylelint", "jsonlint", "markdownlint", "yamllint"]);
|
grunt.registerTask("default", ["eslint", "stylelint", "jsonlint", "markdownlint", "yamllint"]);
|
||||||
};
|
};
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
"test": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests --recursive",
|
"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: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: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",
|
"config:check": "node tests/configs/check_config.js",
|
||||||
"lint": "grunt"
|
"lint": "grunt --env=lint"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user