jenkins-bot has submitted this change and it was merged.
Change subject: Add grunt linting tasks
..
Add grunt linting tasks
Change-Id: Ida8ec3de35d810ebb21176bf71359b16c0c29049
---
A .csslintrc
A .jscsrc
A .jshintignore
A .jshintrc
M Gruntfile.js
M i18n/ce.json
M i18n/de.json
M i18n/es.json
M i18n/eu.json
M i18n/fr.json
M i18n/he.json
M i18n/it.json
M i18n/ja.json
M i18n/ko.json
M i18n/ksh.json
M i18n/lb.json
M i18n/mk.json
M i18n/nl.json
M i18n/pl.json
M i18n/pt.json
M i18n/sv.json
M i18n/ta.json
M i18n/vi.json
M i18n/zh-hans.json
M package.json
25 files changed, 102 insertions(+), 34 deletions(-)
Approvals:
Alex Monk: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.csslintrc b/.csslintrc
new file mode 100644
index 000..68d60d2
--- /dev/null
+++ b/.csslintrc
@@ -0,0 +1,13 @@
+{
+ "adjoining-classes": false,
+ "box-model": false,
+ "box-sizing": false,
+ "fallback-colors": false,
+ "important": false,
+ "outline-none": false,
+ "qualified-headings": false,
+ "unique-headings": false,
+ "universal-selector": false,
+ "unqualified-attributes": false,
+ "gradients": false
+}
diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 000..1959eea
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,21 @@
+{
+ "preset": "wikimedia",
+
+ "jsDoc": {
+ "checkAnnotations": {
+ "preset": "jsduck5",
+ "extra": {
+ "this": true,
+ "source": true,
+ "see": true
+ }
+ },
+ "checkTypes": "strictNativeCase",
+ "checkParamNames": true,
+ "checkRedundantAccess": true,
+ "checkRedundantReturns": true,
+ "requireNewlineAfterDescription": true,
+ "requireParamTypes": true,
+ "requireReturnTypes": true
+ }
+}
diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 000..ff3cfde
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1,2 @@
+/* Tooling */
+node_modules/
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 000..b0a9b23
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,25 @@
+{
+ // Enforcing
+ "bitwise": true,
+ "eqeqeq": true,
+ "freeze": true,
+ "latedef": true,
+ "noarg": true,
+ "nonew": true,
+ "undef": true,
+ "unused": true,
+ "strict": false,
+
+ // Relaxing
+ "es5": false,
+
+ // Environment
+ "browser": true,
+ "jquery": true,
+
+ "globals": {
+ "mediaWiki": false,
+ "OO": false,
+ "ve": false
+ }
+}
diff --git a/Gruntfile.js b/Gruntfile.js
index 9c56558..a2f24cf 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,10 +1,43 @@
/*jshint node:true */
module.exports = function ( grunt ) {
+ grunt.loadNpmTasks( 'grunt-contrib-csslint' );
+ grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+ grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
+ grunt.loadNpmTasks( 'grunt-jscs' );
grunt.initConfig( {
+ jshint: {
+ options: {
+ jshintrc: true
+ },
+ all: [
+ '*.js',
+ 'js/*.js',
+ 'modules/ve-score/**/*.js'
+ ]
+ },
+ jscs: {
+ src: '<%= jshint.all %>'
+ },
+ csslint: {
+ options: {
+ csslintrc: '.csslintrc'
+ },
+ all: 'modules/ve-score/**/*.css'
+ },
+ watch: {
+ files: [
+ '.{jscsrc,jshintignore,jshintrc}',
+ '<%= jshint.all %>'
+ ],
+ tasks: 'lint'
+ },
banana: {
+ options: {
+ disallowDuplicateTranslations: false
+ },
all: 'i18n/'
},
jsonlint: {
@@ -15,6 +48,7 @@
}
} );
- grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+ grunt.registerTask( 'lint', [ 'jshint', 'jscs', 'jsonlint', 'csslint',
'banana' ] );
+ grunt.registerTask( 'test', 'lint' );
grunt.registerTask( 'default', 'test' );
};
diff --git a/i18n/ce.json b/i18n/ce.json
index c24d12d..85e111a 100644
--- a/i18n/ce.json
+++ b/i18n/ce.json
@@ -6,6 +6,5 @@
},