Browse Source

MPIDE-28: 👕: trying eslint

Kyle P Davis 10 years ago
parent
commit
332d798b59
3 changed files with 58 additions and 1 deletions
  1. 1 0
      .eslintignore
  2. 54 0
      .eslintrc
  3. 3 1
      package.json

+ 1 - 0
.eslintignore

@@ -0,0 +1 @@
+node_modules/

+ 54 - 0
.eslintrc

@@ -0,0 +1,54 @@
+{
+
+	//TODO: reorder these based on eslint docs
+
+	"parser": "babel-eslint", // for the <3 of generator comprehensions
+
+	"env": {
+		"es6": true,
+		"node": true,
+		"mocha": true,
+		"jquery": true,
+	},
+
+	"rules": {
+
+		// Possible Errors
+		"comma-dangle": [2, "always-multiline"],
+		"valid-jsdoc": 2,
+
+		// Best Practices
+		"block-scoped-var": 2,
+		"complexity": [2, 15],
+		"curly": [2, "multi-line"],
+		"default-case": 2,
+		"dot-location": [2, "property"],
+		"guard-for-in": 2,
+		"no-floating-decimal": 2,
+		"wrap-iife": 2, //TODO: use "any" instead?
+
+		// Strict Mode
+		"strict": [2, "global"],
+
+		// Variables
+		//
+
+		// Node.js
+		//no-sync ? ? ?
+
+		// Stylistic Issues
+		"brace-style": [2, "1tbs"],
+		"camelcase": [2, "always"],
+
+		// ECMAScript 6
+		//
+
+
+		// Legacy
+		"max-depth": [2, 7],
+		"max-len": [2, 140],
+		"max-params": [2, 11],
+		"max-statements": [2, 42],
+
+	},
+}

+ 3 - 1
package.json

@@ -5,8 +5,10 @@
   "repository": "https://github.com/RiveraGroup/model-lang.git",
   "license": "MIT",
   "devDependencies": {
-    "bower": "^1.4.1",
     "babel": "^5.4.3",
+    "babel-eslint": "^3.1.7",
+    "bower": "^1.4.1",
+    "eslint": "^0.21.2",
     "pegjs": "0.8.0"
   },
   "scripts": {