Skip to content
This repository was archived by the owner on Aug 5, 2020. It is now read-only.

Commit e9f2868

Browse files
author
Marlow Payne
committed
Migrate JS linting to eslint
1 parent 51c6d32 commit e9f2868

File tree

14 files changed

+45
-79
lines changed

14 files changed

+45
-79
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- Publish to NPM
33
- Remove Zepto support in favor of jQuery
44
- Migrate all dependencies to NPM, remove Bower
5+
- Migrate JS linting to eslint
56
5.1.2
67
- Ensuring disabled items don't close on close
78
5.0.1

Gruntfile.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict'
1+
'use strict';
22

33
var path = require('path');
44

@@ -32,6 +32,7 @@ module.exports = function(grunt) {
3232
'grunt-contrib-watch',
3333
'grunt-contrib-connect',
3434
'grunt-css',
35+
'grunt-eslint',
3536
'grunt-shell',
3637
'grunt-contrib-clean',
3738
'grunt-contrib-copy',
@@ -48,8 +49,8 @@ module.exports = function(grunt) {
4849
});
4950

5051
grunt.registerTask('serve', ['build', 'connect:server', 'watch']);
51-
grunt.registerTask('build', ['lint:dev', 'copy', 'uglify', 'version:all', 'sass', 'autoprefixer', 'cssmin']);
52-
grunt.registerTask('release', ['lint:dev', 'test', 'shell:tagRelease']);
52+
grunt.registerTask('build', ['lint:prod', 'copy', 'uglify', 'version:all', 'sass', 'autoprefixer', 'cssmin']);
53+
grunt.registerTask('release', ['lint:prod', 'test', 'shell:tagRelease']);
5354
grunt.registerTask('test', ['build', 'connect:test', 'mocha_phantomjs']);
5455
grunt.registerTask('test:browser', ['build', 'connect:test:keepalive']);
5556
grunt.registerTask('default', 'build');

dist/bellows.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
var framework = window.jQuery;
1010
factory(framework, framework.Velocity, window.Plugin);
1111
}
12-
}(function($, Velocity, Plugin) {
12+
})(function($, Velocity, Plugin) {
1313
var cssClasses = {
1414
ITEM: 'bellows__item',
1515
HEADER: 'bellows__header',
@@ -29,9 +29,9 @@
2929
CLICK: 'click.bellows'
3030
};
3131

32-
function Bellows(element, options) {
32+
var Bellows = function(element, options) {
3333
Bellows.__super__.call(this, element, options, Bellows.DEFAULTS);
34-
}
34+
};
3535

3636
Bellows.VERSION = '6.0.0';
3737

@@ -254,4 +254,4 @@
254254
$('[data-bellows]').bellows();
255255

256256
return $;
257-
}));
257+
});

dist/bellows.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@
1414
"grunt-contrib-clean": "0.5.0",
1515
"grunt-contrib-connect": "0.9.0",
1616
"grunt-contrib-copy": "0.4.1",
17-
"grunt-contrib-jshint": "0.10.0",
1817
"grunt-contrib-sass": "0.8.1",
1918
"grunt-contrib-uglify": "0.8.1",
2019
"grunt-contrib-watch": "0.5.3",
2120
"grunt-css": "0.5.4",
22-
"grunt-jscs-checker": "0.4.1",
21+
"grunt-eslint": "17.3.2",
2322
"grunt-mocha-phantomjs": "0.3.2",
2423
"grunt-open": "0.2.3",
2524
"grunt-shell": "0.2.2",
2625
"grunt-version": "0.3.3",
27-
"jshint": "2.5.0",
28-
"mobify-code-style": "0.0.3",
26+
"mobify-code-style": "^2.4.2",
2927
"mocha": "1.14.0"
3028
},
3129
"license": "MIT",

src/js/bellows.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
var framework = window.jQuery;
1010
factory(framework, framework.Velocity, window.Plugin);
1111
}
12-
}(function($, Velocity, Plugin) {
12+
})(function($, Velocity, Plugin) {
1313
var cssClasses = {
1414
ITEM: 'bellows__item',
1515
HEADER: 'bellows__header',
@@ -29,9 +29,9 @@
2929
CLICK: 'click.bellows'
3030
};
3131

32-
function Bellows(element, options) {
32+
var Bellows = function(element, options) {
3333
Bellows.__super__.call(this, element, options, Bellows.DEFAULTS);
34-
}
34+
};
3535

3636
Bellows.VERSION = '0';
3737

@@ -254,4 +254,4 @@
254254
$('[data-bellows]').bellows();
255255

256256
return $;
257-
}));
257+
});

tasks/config/eslint.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = function(grunt) {
2+
var lint = require('../jslinting');
3+
4+
return {
5+
prod: {
6+
src: lint.targets,
7+
options: {
8+
reset: true,
9+
config: require.resolve('mobify-code-style/javascript/.eslintrc-prod')
10+
}
11+
},
12+
dev: {
13+
src: lint.targets,
14+
options: {
15+
reset: true,
16+
config: require.resolve('mobify-code-style/javascript/.eslintrc')
17+
}
18+
}
19+
};
20+
};

tasks/config/jscs.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

tasks/config/jshint.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

tasks/eslint/tasks.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
module.exports = function(grunt) {
3+
grunt.registerTask('lint:dev', ['eslint:dev']);
4+
grunt.registerTask('lint:prod', ['eslint:prod']);
5+
grunt.registerTask('lint', ['lint:dev']);
6+
};

0 commit comments

Comments
 (0)