]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Added eslint
authorColin Marshall <colin.michael.marshall@gmail.com>
Tue, 16 Feb 2016 05:05:55 +0000 (22:05 -0700)
committerColin Marshall <colin.michael.marshall@gmail.com>
Tue, 16 Feb 2016 05:05:55 +0000 (22:05 -0700)
.eslintrc [new file with mode: 0644]
gulp/lint.js
package.json

diff --git a/.eslintrc b/.eslintrc
new file mode 100644 (file)
index 0000000..20147eb
--- /dev/null
+++ b/.eslintrc
@@ -0,0 +1,76 @@
+{
+  "env": {
+    "jasmine": true,
+    "node": true,
+    "mocha": true,
+    "browser": true,
+    "builtin": true
+  },
+  "globals": {},
+  "rules": {
+    "block-scoped-var": 2,
+    "camelcase": 2,
+    "comma-style": [
+      2,
+      "first"
+    ],
+    "curly": [
+      2,
+      "all"
+    ],
+    "dot-notation": [
+      2,
+      {
+        "allowKeywords": true
+      }
+    ],
+    "eqeqeq": [
+      2,
+      "allow-null"
+    ],
+    "global-strict": [
+      2,
+      "never"
+    ],
+    "guard-for-in": 2,
+    "new-cap": 2,
+    "no-bitwise": 2,
+    "no-caller": 2,
+    "no-cond-assign": [
+      2,
+      "except-parens"
+    ],
+    "no-debugger": 2,
+    "no-empty": 2,
+    "no-eval": 2,
+    "no-extend-native": 2,
+    "no-extra-parens": 2,
+    "no-irregular-whitespace": 2,
+    "no-iterator": 2,
+    "no-loop-func": 2,
+    "no-multi-str": 2,
+    "no-new": 2,
+    "no-plusplus": 2,
+    "no-proto": 2,
+    "no-script-url": 2,
+    "no-sequences": 2,
+    "no-shadow": 2,
+    "no-undef": 2,
+    "no-unused-vars": 2,
+    "no-with": 2,
+    "quotes": [
+      2,
+      "single"
+    ],
+    "semi": [
+      0,
+      "never"
+    ],
+    "strict": 2,
+    "valid-typeof": 2,
+    "wrap-iife": [
+      2,
+      "inside"
+    ]
+  }
+}
\ No newline at end of file
index a32f869204c83cb36c35fc26be3133571ed4c27d..113faba8389cf5751f130c8b403a7629f27a7df4 100644 (file)
@@ -1,6 +1,7 @@
 var gulp = require('gulp');
 var scssLint = require('gulp-scss-lint');
 var jshint = require('gulp-jshint');
+var eslint = require('gulp-eslint');
 
 var PATHS = [
   'scss/**/*.scss',
@@ -23,3 +24,23 @@ gulp.task('lint:javascript', function() {
     .pipe(jshint())
     .pipe(jshint.reporter('default'));
 });
+
+gulp.task('lint:eslint', function () {
+    // ESLint ignores files with "node_modules" paths.
+    // So, it's best to have gulp ignore the directory as well.
+    // Also, Be sure to return the stream from the task;
+    // Otherwise, the task may end before the stream has finished.
+    return gulp.src(['js/*.js'])
+        // eslint() attaches the lint output to the "eslint" property
+        // of the file object so it can be used by other modules.
+        .pipe(eslint({
+               useEslintrc: true,
+               configFile: '.eslintrc'
+        }))
+        // eslint.format() outputs the lint results to the console.
+        // Alternatively use eslint.formatEach() (see Docs).
+        .pipe(eslint.format())
+        // To have the process exit with an error code (1) on
+        // lint error, return the stream and pipe to failAfterError last.
+        .pipe(eslint.failAfterError());
+});
index 243e47247acbd45a5af99ece8343497096996e16..ebb6e46ce679c4b154a27968be04e2a84e221fbc 100644 (file)
@@ -17,6 +17,7 @@
   "license": "MIT",
   "devDependencies": {
     "babel-core": "^6.3.26",
+    "babel-eslint": "^4.1.8",
     "babel-plugin-transform-es2015-arrow-functions": "^6.3.13",
     "babel-plugin-transform-es2015-block-scoped-functions": "^6.3.13",
     "babel-plugin-transform-es2015-block-scoping": "^6.4.0",
@@ -41,6 +42,7 @@
     "gulp-cache-bust": "^1.0.2",
     "gulp-concat": "^2.4.3",
     "gulp-cssnano": "^2.1.0",
+    "gulp-eslint": "^2.0.0",
     "gulp-filter": "^3.0.1",
     "gulp-jshint": "^2.0.0",
     "gulp-load-plugins": "^1.2.0",