浏览代码

eslintrc: add eslintrc and symlink during install

Kyle P Davis 9 年之前
父节点
当前提交
6b8008cb3e
共有 2 个文件被更改,包括 55 次插入0 次删除
  1. 54 0
      .eslintrc
  2. 1 0
      install.sh

+ 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],
+
+	},
+}

+ 1 - 0
install.sh

@@ -27,6 +27,7 @@ link "$CMD_DIR/.profile" "$HOME/.bash_profile" # certain scenarios use this one
 
 link "$CMD_DIR/.vimrc" "$HOME/.vimrc"
 
+link "$CMD_DIR/.eslintrc" "$HOME/.eslintrc"
 link "$CMD_DIR/.jshintrc" "$HOME/.jshintrc"
 link "$CMD_DIR/.jscsrc" "$HOME/.jscsrc"
 link "$CMD_DIR/.node-inspectorrc" "$HOME/.node-inspectorrc"