allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [45/50] allura git commit: [#8035] Separate .eslintrc into configs for ES5 and ES6
Date Wed, 27 Jan 2016 20:22:59 GMT
[#8035] Separate .eslintrc into configs for ES5 and ES6


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/b4f0ae43
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/b4f0ae43
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/b4f0ae43

Branch: refs/heads/hs/8035
Commit: b4f0ae43a8c0445aa72374fa3251280ae206a759
Parents: 5cc34c0
Author: Heith Seewald <heiths@gmail.com>
Authored: Tue Jan 26 11:35:35 2016 -0500
Committer: Heith Seewald <heiths@gmail.com>
Committed: Wed Jan 27 15:21:32 2016 -0500

----------------------------------------------------------------------
 .eslintignore-es5 |  2 ++
 .eslintignore-es6 |  1 +
 .eslintrc-es5     | 42 ++++++++++++++++++++++++++++++++++++++++++
 .eslintrc-es6     | 39 +++++++++++++++++++++++++++++++++++++++
 package.json      |  4 +++-
 5 files changed, 87 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/b4f0ae43/.eslintignore-es5
----------------------------------------------------------------------
diff --git a/.eslintignore-es5 b/.eslintignore-es5
new file mode 100644
index 0000000..8dfa7af
--- /dev/null
+++ b/.eslintignore-es5
@@ -0,0 +1,2 @@
+Allura/allura/public/nf/js/build
+**/*es6.js
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/b4f0ae43/.eslintignore-es6
----------------------------------------------------------------------
diff --git a/.eslintignore-es6 b/.eslintignore-es6
new file mode 100644
index 0000000..ddff5f8
--- /dev/null
+++ b/.eslintignore-es6
@@ -0,0 +1 @@
+Allura/allura/public/nf/js/build

http://git-wip-us.apache.org/repos/asf/allura/blob/b4f0ae43/.eslintrc-es5
----------------------------------------------------------------------
diff --git a/.eslintrc-es5 b/.eslintrc-es5
new file mode 100644
index 0000000..493b774
--- /dev/null
+++ b/.eslintrc-es5
@@ -0,0 +1,42 @@
+{
+  "rules": {
+    "indent": [2, 4],
+    "no-unused-vars": [2, {"vars": "all", "args": "none"}],
+    "no-console": 0,
+    "semi": [2, "always"],
+    "eqeqeq": 2,
+    "block-scoped-var": 2,
+    "consistent-return": 2,
+    // specify curly brace conventions for all control statements
+    "curly": [2, "all"],
+    // require default case in switch statements
+    "default-case": 2,
+    // disallow use of eval()
+    "no-eval": 2,
+    // disallow adding to native types
+    "no-extend-native": 2,
+    // disallow use of eval()-like methods
+    "no-implied-eval": 2,
+    // disallow this keywords outside of classes or class-like objects
+    "no-invalid-this": 2,
+    // disallow creation of functions within loops
+    "no-loop-func": 2,
+    // disallow declaring the same variable more then once
+    "no-redeclare": 2,
+    // disallow use of the with statement
+    "no-with": 2,
+    // require use of the second argument for parseInt()
+    "radix": 2
+  },
+  "globals": {
+
+  },
+  "parser": "esprima-fb",
+  "env": {
+    "browser": true,
+    "jquery": true
+  },
+  "extends": "eslint:recommended",
+  "plugins": [
+  ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/b4f0ae43/.eslintrc-es6
----------------------------------------------------------------------
diff --git a/.eslintrc-es6 b/.eslintrc-es6
new file mode 100644
index 0000000..455b95a
--- /dev/null
+++ b/.eslintrc-es6
@@ -0,0 +1,39 @@
+{
+  "rules": {
+    "max-len": [1, 119, 4],
+    "indent": [2, 4],
+    "jsx-quotes": [0],
+    "quotes": [0],
+    "operator-linebreak": [2, "before", { "overrides": { "?": "after", "&&": "after"
} }],
+    "require-jsdoc": [2, {"require": {
+        "FunctionDeclaration": true,
+        "MethodDefinition": false,
+        "ClassDeclaration": false
+      }
+    }],
+    "no-inline-comments": 0,
+    "comma-dangle": 0
+  },
+  "globals": {
+    "ReactDOM": true,
+    "React": true,
+    "$": true,
+    "window": true,
+    "_": true,
+    "ReactReorderable": true
+  },
+  "parser": "babel-eslint",
+  "env": {
+    "es6": true,
+    "browser": true
+  },
+  "extends": "google",
+  "ecmaFeatures": {
+    "jsx": true,
+    "forOf": true,
+    "experimentalObjectRestSpread": true
+  },
+  "plugins": [
+    "react"
+  ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/b4f0ae43/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 1f12ff5..3ae1bc9 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,9 @@
     "watch": "broccoli-timepiece Allura/allura/public/nf/js/build/",
     "env": "env",
     "eslint": "eslint",
-    "lint": "eslint Allura/allura/public/nf/js/*.es6.js || true"
+    "lint-es5": "eslint -c .eslintrc-es5  --ignore-path .eslintignore-es5 Allura/allura/public/**/*.js
|| true",
+    "lint-es6": "eslint -c .eslintrc-es6  --ignore-path .eslintignore-es6 Allura/allura/public/**/*.es6.js
|| true",
+    "lint": "npm run lint-es5 && npm run lint-es6"
   },
   "repository": {
     "type": "git",


Mime
View raw message