Jforrester has uploaded a new change for review.
https://gerrit.wikimedia.org/r/302285
Change subject: [WIP] build: Introduce eslint to replace jshint and jscs
......................................................................
[WIP] build: Introduce eslint to replace jshint and jscs
Not yet passing or hooked up.
Change-Id: Ieec7c491b6ab286275fb3965ae353338e3cca84b
---
A .eslintrc.json
M Gruntfile.js
M package.json
M src/Theme.js
M src/mixins/FloatableElement.js
5 files changed, 33 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/85/302285/1
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..eb5fd59
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,19 @@
+{
+ "extends": "wikimedia",
+
+ "ecmaVersion": 5,
+ "env": {
+ "browser": true,
+ "node": true,
+ "jquery": true,
+ "qunit": true
+ },
+ "globals": {
+ "OO": false
+ },
+
+ "rules": {
+ "dot-notation": 0,
+ "valid-jsdoc": 0
+ }
+}
diff --git a/Gruntfile.js b/Gruntfile.js
index a0b5108..738325f 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -42,6 +42,7 @@
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.loadNpmTasks( 'grunt-svg2png' );
grunt.loadNpmTasks( 'grunt-tyops' );
+ grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadTasks( 'build/tasks' );
( function () {
@@ -341,6 +342,14 @@
},
// Lint – Code
+ eslint: {
+ dev: [
+ '*.js',
+ '{build,demos,src,tests}/**/*.js',
+ '!demos/{dist,node_modules,vendor}/**/*.js',
+ '!tests/JSPHP.test.js'
+ ]
+ },
jshint: {
options: {
jshintrc: true
diff --git a/package.json b/package.json
index 88f2e61..c38ec2a 100644
--- a/package.json
+++ b/package.json
@@ -26,6 +26,7 @@
"oojs": "1.1.10"
},
"devDependencies": {
+ "eslint-config-wikimedia": "0.1.0",
"grunt": "1.0.1",
"grunt-banana-checker": "0.5.0",
"grunt-contrib-clean": "1.0.0",
@@ -38,6 +39,7 @@
"grunt-contrib-watch": "1.0.0",
"grunt-csscomb":
"git://github.com/jdforrester/grunt-csscomb.git#v3.1.0-wmf.1",
"grunt-cssjanus": "0.3.2",
+ "grunt-eslint": "19.0.0",
"grunt-exec": "1.0.0",
"grunt-file-exists": "0.1.4",
"grunt-image": "1.5.2",
diff --git a/src/Theme.js b/src/Theme.js
index dd5cebf..3831a7a 100644
--- a/src/Theme.js
+++ b/src/Theme.js
@@ -7,7 +7,8 @@
* @constructor
* @param {Object} [config] Configuration options
*/
-OO.ui.Theme = function OoUiTheme( config ) {
+OO.ui.Theme = function OoUiTheme( config ) { // eslint-disable-line
no-unused-vars
+
// Configuration initialization
config = config || {};
};
diff --git a/src/mixins/FloatableElement.js b/src/mixins/FloatableElement.js
index 2b0193d..e26d077 100644
--- a/src/mixins/FloatableElement.js
+++ b/src/mixins/FloatableElement.js
@@ -18,7 +18,7 @@
* @cfg {jQuery} [$floatable] Node to position, assigned to #$floatable, omit
to use #$element
* @cfg {jQuery} [$floatableContainer] Node to position below
*/
-OO.ui.mixin.FloatableElement = function OoUiMixinFloatableElement( config ) {
+OO.ui.mixin.FloatableElement = function OoUiMixinFloatableElement( config ) {
// eslint-disable-line no-unused-vars
// Configuration initialization
config = config || {};
--
To view, visit https://gerrit.wikimedia.org/r/302285
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieec7c491b6ab286275fb3965ae353338e3cca84b
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits