You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2016/02/05 21:42:16 UTC
[21/30] allura git commit: [#8035] Separate .eslintrc into configs
for ES5 and ES6
[#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/79b61af0
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/79b61af0
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/79b61af0
Branch: refs/heads/master
Commit: 79b61af0dbc32f258386dd969dace3847ef78a34
Parents: 388a389
Author: Heith Seewald <he...@gmail.com>
Authored: Tue Jan 26 11:35:35 2016 -0500
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Feb 5 14:37:20 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/79b61af0/.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/79b61af0/.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/79b61af0/.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/79b61af0/.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/79b61af0/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",