Skip to content

Commit

Permalink
Gruntfile/Dependencies: Migrate to eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Sep 20, 2018
1 parent 3855606 commit d87fb12
Show file tree
Hide file tree
Showing 4 changed files with 1,203 additions and 6,210 deletions.
40 changes: 40 additions & 0 deletions .eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"env": {
"es6": true,
"browser": true,
"mocha": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module"
},
"globals": {
"it": true,
"describe": true,
"beforeEach": true,
"afterEach": true,
"before": true
},
"rules": {
"curly": 2,
"eqeqeq": 0,
"wrap-iife": [
2,
"any"
],
"no-use-before-define": 0,
"no-caller": 2,
"no-console": 0,
"no-empty": 0,
"dot-notation": 0,
"no-undef": 2,
"no-cond-assign": [
2,
"except-parens"
],
"no-eq-null": 0,
"strict": 0
}
}
45 changes: 13 additions & 32 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var cp = require("child_process");
var tags = require("common-tags");
const cp = require("child_process");
const tags = require("common-tags");

module.exports = function (grunt) {
grunt.initConfig({
Expand All @@ -9,29 +9,10 @@ module.exports = function (grunt) {
"test/unit/*.js"
],
},
jshint: {
all: [ "gruntfile.js", "lib/*.js", "test/*.js", "examples/*.js"],
eslint: {
target: ["gruntfile.js", "lib/*.js", "test/*.js", "examples/*.js"],
options: {
globals: {
it: true,
describe: true,
beforeEach: true,
afterEach: true,
before: true
},
curly: true,
eqeqeq: true,
immed: true,
latedef: false,
nonew: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
node: true,
strict: false,
esnext: true,
configFile: ".eslint.json"
}
},
jscs: {
Expand Down Expand Up @@ -93,8 +74,8 @@ module.exports = function (grunt) {
});

grunt.registerTask("test", ["mochaTest"]);
grunt.registerTask("default", ["jshint:all", "jscs", "mochaTest"]);
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.registerTask("default", ["eslint", "jscs", "mochaTest"]);
grunt.loadNpmTasks("grunt-eslint");
grunt.loadNpmTasks("grunt-mocha-test");
grunt.loadNpmTasks("grunt-jsbeautifier");
grunt.loadNpmTasks("grunt-jscs");
Expand All @@ -112,11 +93,11 @@ module.exports = function (grunt) {
});

grunt.registerTask("changelog", "'changelog', 'changelog:v0.0.0..v0.0.2' or 'changelog:v0.0.0'", (arg) => {
var done = grunt.task.current.async();
var tags = cp.execSync("git tag --sort version:refname").toString().split("\n");
var tagIndex = -1;
var range;
var revisionRange;
const done = grunt.task.current.async();
const tags = cp.execSync("git tag --sort version:refname").toString().split("\n");
let tagIndex = -1;
let range;
let revisionRange;

if (!arg) {
// grunt changelog
Expand Down Expand Up @@ -155,7 +136,7 @@ module.exports = function (grunt) {
return;
}

var rows = result.split("\n").filter(commit => {
const rows = result.split("\n").filter(commit => {
return !commit.includes("|Merge ") && !commit.includes(range[0]);
});

Expand Down
Loading

0 comments on commit d87fb12

Please sign in to comment.