Skip to content

Commit

Permalink
upgrade: upgrade dev deps and move from jscs to eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
DonutEspresso committed Feb 22, 2018
1 parent 471ac19 commit 9f7f088
Show file tree
Hide file tree
Showing 22 changed files with 929 additions and 732 deletions.
182 changes: 147 additions & 35 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
// eslint: recommended automatically enables most/all rules from the
// possible errors section and more:
// http://eslint.org/docs/rules/#possible-errors
"extends": "eslint:recommended",
"env": {
"browser": false,
"node": true,
"es6": false
},
"rules": {
// possible errors
"comma-dangle": [ 2 ],
"no-cond-assign": [ 2 ],
"no-console": [ 2 ],
"no-constant-condition": [ 2 ],
"no-control-regex": [ 2 ],
"no-debugger": [ 2 ],
Expand All @@ -21,47 +23,54 @@
"no-extra-boolean-cast": [ 2 ],
"no-extra-semi": [ 2 ],
"no-func-assign": [ 2 ],
// this is for variable hoisting, not necessary if we use block scoped declarations
// "no-inner-declarations": [ 2, "both" ],
"no-invalid-regexp": [ 2 ],
"no-irregular-whitespace": [ 2 ],
"no-negated-in-lhs": [ 2 ],
"no-reserved-keys": [ 0 ],
"no-regex-spaces": [ 2 ],
"no-sparse-arrays": [ 2 ],
"no-unreachable": [ 2 ],
"no-unsafe-negation": [ 2 ],
"use-isnan": [ 2 ],
"valid-typeof": [ 2 ],
"valid-jsdoc": [ 2, {
"requireReturnDescription": false,
"prefer": {
"return": "returns"
}
"requireReturnDescription": false
}],
"valid-typeof": [ 2 ],

// best practices
"array-callback-return": [ 2 ],
"block-scoped-var": [ 2 ],
"class-methods-use-this": [ 2 ],
"consistent-return": [ 2 ],
"curly": [ 2 ],
"default-case": [ 2 ],
"dot-notation": [ 2, { "allowKeywords": true } ],
"eqeqeq": [ 2 ],
"guard-for-in": [ 0 ],
"guard-for-in": [ 2 ],
"no-alert": [ 2 ],
"no-caller": [ 2 ],
"no-case-declarations": [ 2 ],
"no-div-regex": [ 2 ],
"no-empty-function": [ 2 ],
"no-empty-pattern": [ 2 ],
"no-eq-null": [ 2 ],
"no-eval": [ 2 ],
"no-extend-native": [ 2 ],
"no-extra-bind": [ 2 ],
"no-extra-label": [ 2 ],
"no-fallthrough": [ 2 ],
"no-floating-decimal": [ 2 ],
"no-global-assign": [ 2 ],
"no-implicit-coercion": [ 2 ],
"no-implied-eval": [ 2 ],
"no-iterator": [ 2 ],
"no-labels": [ 2 ],
"no-lone-blocks": [ 2 ],
"no-loop-func": [ 2 ],
"no-magic-numbers": [ 0 ],
"no-multi-spaces": [ 0 ],
"no-native-reassign": [ 2 ],
"no-new": [ 0 ],
"no-new": [ 2 ],
"no-new-func": [ 2 ],
"no-new-wrappers": [ 2 ],
"no-octal": [ 2 ],
Expand All @@ -71,11 +80,17 @@
"no-redeclare": [ 2 ],
"no-return-assign": [ 2 ],
"no-script-url": [ 2 ],
"no-self-assign": [ 2 ],
"no-self-compare": [ 2 ],
"no-sequences": [ 2 ],
"no-throw-literal": [ 2 ],
"no-unmodified-loop-condition": [ 2 ],
"no-unused-expressions": [ 2 ],
"no-unused-labels": [ 2 ],
"no-useless-call": [ 2 ],
"no-useless-concat": [ 2 ],
"no-void": [ 2 ],
"no-warning-comments": [ 1 ],
"no-with": [ 2 ],
"wrap-iife": [ 2 ],
"yoda": [ 2, "never" ],
Expand All @@ -90,42 +105,139 @@
"no-shadow-restricted-names": [ 2 ],
"no-undef": [ 2 ],
"no-undef-init": [ 2 ],
"no-undefined": [ 0 ],
"no-unused-vars": [ 2, { "vars": "all", "args": "none" } ],
"no-use-before-define": [ 2, "nofunc" ],

// node.js
"callback-return": [ 2, [ "callback", "cb", "cb1", "cb2", "cb3", "next", "innerCb", "done" ]],
"global-require": [ 2 ],
"handle-callback-err": [ 2, "^.*(e|E)rr" ],
"no-mixed-requires": [ 2 ],
"no-new-require": [ 2 ],
"no-path-concat": [ 2 ],
"no-process-exit": [ 0 ],

// ES6
"generator-star-spacing": [ 2, "after" ],
"no-process-exit": [ 2 ],

// stylistic
// we use JSCS, set most to off because they're on by default.
// turn the few on that aren't handled by JSCS today.
"camelcase": [ 0 ],
"key-spacing": [ 0 ],
"no-lonely-if": [ 0 ],
"no-multi-str": [ 0 ],
"no-underscore-dangle": [ 0 ],
"quotes": [ 0 ],
"semi": [ 0 ],
"space-infix-ops": [ 0 ],
"space-return-throw-case": [ 0 ],
"space-unary-ops": [ 0 ],

"array-bracket-newline": [ 2, { "multiline": true }],
"array-bracket-spacing": [ 2, "always", {
"singleValue": true,
"objectsInArrays": false,
"arraysInArrays": false
}],
"block-spacing": [ 2, "always" ],
"camelcase": [ 2, {
"properties": "always"
}],
"comma-dangle": [ 2, "never" ],
"comma-spacing": [ 2, { "before": false, "after": true }],
"comma-style": [ 2, "last" ],
"computed-property-spacing": [ 2, "never" ],
"consistent-this": [ 2, "self" ],
"func-call-spacing": [ 2, "never" ],
"func-style": [ 2, "declaration" ],
"function-paren-newline": [ 2, "consistent" ],
"indent": [ 2, 4, {
"CallExpression": { "arguments": "off" }
}],
"key-spacing": [ 2, {
"beforeColon": false,
"afterColon": true
}],
"keyword-spacing": [ 2, {
"before": true,
"after": true
}],
"lines-between-class-members": [ 2, "always" ],
"max-len": [ 2, {
"code": 80
}],
"multiline-ternary": [ 2, "always-multiline" ],
"new-cap": [ 2, {
"newIsCap": true,
"properties": true
}],
"new-parens": [ 2 ],
"no-array-constructor": [ 2 ],
"no-mixed-operators": [ 2 ],
"no-nested-ternary": [ 2 ],
"no-new-object": [ 2 ]

"no-new-object": [ 2 ],
"no-trailing-spaces": [ 2 ],
"no-unneeded-ternary": [ 2 ],
"no-whitespace-before-property": [ 2 ],
"object-curly-newline": [ 2, { "consistent": true }],
"object-curly-spacing": [ 2, "always", {
"arraysInObjects": false,
"objectsInObjects": false
}],
"one-var-declaration-per-line": [ 2 ],
"operator-linebreak": [ 2, "after" ],
"padding-line-between-statements": [ 2,
{
"blankLine": "always",
"prev": "directive",
"next": "*"
},
{
"blankLine": "any",
"prev": "directive",
"next": "directive"
},
{
"blankLine": "always",
"prev": "*",
"next": "cjs-export"
},
{
"blankLine": "always",
"prev": "*",
"next": "export"
},
{
"blankLine": "always",
"prev": "block",
"next": "*"
}
],
"quotes": [ 2, "single", { "avoidEscape": true }],
"require-jsdoc": [ 2, {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true,
"ArrowFunctionExpression": false,
"FunctionExpression": false
}
}],
"semi": [ 2, "always" ],
"space-before-blocks": [ 2, "always" ],
"space-before-function-paren": [ 2, "never" ],
"space-in-parens": [ 2, "never" ],
"space-infix-ops": [ 2 ],
"space-unary-ops": [ 2, { "words": true, "nonwords": false }],
"spaced-comment": [ 2, "always", {
"exceptions": ["-"]
}],
"switch-colon-spacing": [ 2, { "after": true, "before": false }],
"template-tag-spacing": [ 2, "never" ],

// TODO: things that are nice to have as part of a build or via analysis tools like bithound. let's revisit.
// "valid-jsoc": [ 2 ],
// "complexity": [ 2 ],
// "no-else-return": [ 2 ]
/*
// es6
"arrow-body-style": [ 2, "always" ],
"arrow-parens": [ 2, "always" ],
"arrow-spacing": [ 2 ],
"constructor-super": [ 2 ],
"generator-star-spacing": [ 2, { "before": false, "after": true }],
"no-class-assign": [ 2 ],
"no-dupe-class-members": [ 2 ],
"no-duplicate-imports": [ 2 ],
"no-new-symbol": [ 2 ],
"no-const-assign": [ 2 ],
"no-useless-computed-key": [ 2 ],
"no-useless-constructor": [ 2 ],
"no-useless-rename": [ 2 ],
"no-var": [ 2 ],
"prefer-const": [ 2 ],
"sort-imports": [ 2 ]
*/
}
}
16 changes: 5 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ TOOLS := $(ROOT)/tools
# Tools and binaries
#
ESLINT := $(NODE_BIN)/eslint
JSCS := $(NODE_BIN)/jscs
MOCHA := $(NODE_BIN)/mocha
_MOCHA := $(NODE_BIN)/_mocha
ISTANBUL := $(NODE_BIN)/istanbul
Expand Down Expand Up @@ -39,7 +38,7 @@ SHRINKWRAP = $(ROOT)/npm-shrinkwrap.json
#

.PHONY: all
all: node_modules lint codestyle test clean-coverage
all: node_modules lint test clean-coverage


node_modules: package.json
Expand All @@ -60,14 +59,9 @@ lint: node_modules $(LIB_FILES) $(TEST_FILES)
@$(ESLINT) $(LIB_FILES) $(TEST_FILES)


.PHONY: codestyle
codestyle: node_modules $(LIB_FILES) $(TEST_FILES)
@$(JSCS) $(LIB_FILES) $(TEST_FILES)


.PHONY: codestyle-fix
codestyle-fix: node_modules $(LIB_FILES) $(TEST_FILES)
@$(JSCS) $(LIB_FILES) $(TEST_FILES) --fix
.PHONY: lint-fix
lint-fix: node_modules $(LIB_FILES) $(TEST_FILES)
@$(ESLINT) $(LIB_FILES) $(TEST_FILES) --fix


.PHONY: nsp
Expand All @@ -78,7 +72,7 @@ nsp: node_modules $(NSP)


.PHONY: prepush
prepush: node_modules lint codestyle test versioncheck
prepush: node_modules lint test versioncheck


.PHONY: test
Expand Down

0 comments on commit 9f7f088

Please sign in to comment.