From 8c8f03da50fa86fa726cfdea57cb38ca917e94d6 Mon Sep 17 00:00:00 2001 From: Tom Yearke Date: Fri, 31 Mar 2017 14:48:02 -0400 Subject: [PATCH] Updated ESLint and applied new XDMoD rules --- .eslintrc.json | 99 +++++++++++++++++++++++++++++--------------------- package.json | 4 +- 2 files changed, 60 insertions(+), 43 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index f391e7d3..16292d5c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,66 +1,81 @@ { - "env": {}, + "extends": "airbnb-base/legacy", + "env": { + "browser": false, + "node": false + }, "globals": {}, - "extends": "eslint:recommended", "rules": { - "curly": 2, - "guard-for-in": 2, - "no-extend-native": 2, - "block-scoped-var": 1, - "no-use-before-define": 2, - "no-caller": 2, - "no-sequences": 2, - "no-new": 2, - "no-extra-parens": 1, - "dot-notation": [ - 1, + "curly": [ + "error", + "all" + ], + "brace-style": [ + "error", + "1tbs", { - "allowPattern": "^[a-z]+(_[a-z]+)+$" + "allowSingleLine": false } ], "no-implicit-coercion": [ - 2, + "error", { "boolean": true, "number": true, "string": false } ], - "no-multi-spaces": 2, - "key-spacing": [ - 2, + "consistent-this": [ + "warn", + "self" + ], + "indent": [ + "error", + 4, { - "beforeColon": false, - "afterColon": true + "SwitchCase": 1, + "VariableDeclarator": 1, + "outerIIFEBody": 1, + "FunctionDeclaration": { + "parameters": 1, + "body": 1 + }, + "FunctionExpression": { + "parameters": 1, + "body": 1 + } } ], - "comma-spacing": [ - 2, + "func-names": "off", + "vars-on-top": "off", + "new-cap": [ + "error", { - "before": false, - "after": true + "newIsCap": true, + "newIsCapExceptions": [], + "capIsNew": false, + "capIsNewExceptions": [ + "Immutable.Map", + "Immutable.Set", + "Immutable.List" + ], + "properties": false } ], - "semi-spacing": [ - 2, + "max-len": [ + "error", + 512, + 4, { - "before": false, - "after": true + "ignoreUrls": true, + "ignoreComments": false, + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true } ], - "no-spaced-func": 2, - "no-trailing-spaces": 2, - "eol-last": 2, - "semi": 2, - "space-infix-ops": 2, - "consistent-this": [ - 1, - "self" - ], - "linebreak-style": [ - 2, - "unix" - ], - "keyword-spacing": 1 + "no-continue": "off", + "no-plusplus": "off", + "no-prototype-builtins": "off" } } diff --git a/package.json b/package.json index bd2fbf6c..159b8cd5 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ "description": "The SUPReMM module for Open XDMoD.", "dependencies": {}, "devDependencies": { - "eslint": "^3.8.1" + "eslint": "^3.16.1", + "eslint-config-airbnb-base": "^11.1.0", + "eslint-plugin-import": "^2.2.0" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1"