Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed Oct 20, 2017
1 parent 9511e30 commit bc63c5b
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 330 deletions.
18 changes: 1 addition & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,38 +1,22 @@
ESLINT = node_modules/.bin/eslint
NPM = npm
XYZ = node_modules/.bin/xyz --repo [email protected]:sanctuary-js/sanctuary-style.git --script scripts/prepublish

JSON = $(shell find . -name '*.json' -not -path './node_modules/*' | sort)
SCRIPTS = $(shell find scripts -type f -not -name prepublish | sort)
FILES = eslint-es3.json eslint-es6.json


.PHONY: all
all: LICENSE $(FILES)
all: LICENSE

.PHONY: LICENSE
LICENSE:
cp -- '$@' '[email protected]'
sed 's/Copyright (c) .* Sanctuary/Copyright (c) $(shell git log --date=short --pretty=format:%ad | sort -r | head -n 1 | cut -d - -f 1) Sanctuary/' '[email protected]' >'$@'
rm -- '[email protected]'

eslint-%.json: eslint-%-only.json eslint-common.json scripts/eslint-combine
scripts/eslint-combine eslint-common.json '$<' >'$@'


.PHONY: clean
clean: $(FILES)
rm -f -- $^


.PHONY: lint
lint:
printf 'require(\\"%s\\")\n' $(JSON) | xargs node --eval
$(ESLINT) --config eslint-es6.json --env es6 --env node -- $(SCRIPTS)
make clean
make
git checkout -- LICENSE
git diff --exit-code


.PHONY: release-major release-minor release-patch
Expand Down
192 changes: 110 additions & 82 deletions eslint-common.json
Original file line number Diff line number Diff line change
@@ -1,84 +1,112 @@
{
"array-bracket-spacing": ["never"],
"block-spacing": ["always"],
"brace-style": ["1tbs", {"allowSingleLine": true}],
"comma-spacing": [{"before": false, "after": true}],
"comma-style": ["last"],
"computed-property-spacing": ["never"],
"curly": ["multi-line", "consistent"],
"dot-location": ["property"],
"eol-last": ["always"],
"eqeqeq": ["always", {"null": "never"}],
"func-call-spacing": ["never"],
"indent": [2, {"SwitchCase": 1, "FunctionDeclaration": {"parameters": "first"}, "FunctionExpression": {"parameters": "first"}, "CallExpression": {"arguments": "first"}, "ArrayExpression": "first", "ObjectExpression": "first"}],
"key-spacing": [{"beforeColon": false, "afterColon": true, "mode": "strict"}],
"keyword-spacing": [{"before": true, "after": true}],
"linebreak-style": ["unix"],
"max-len": [{"code": 79, "ignoreUrls": true, "ignorePattern": "^ *//# "}],
"new-parens": [],
"no-array-constructor": [],
"no-caller": [],
"no-case-declarations": [],
"no-compare-neg-zero": [],
"no-cond-assign": ["except-parens"],
"no-dupe-args": [],
"no-dupe-keys": [],
"no-duplicate-case": [],
"no-empty-character-class": [],
"no-eval": [{"allowIndirect": false}],
"no-extra-parens": ["all", {"conditionalAssign": false, "nestedBinaryExpressions": false}],
"no-extra-semi": [],
"no-fallthrough": [],
"no-floating-decimal": [],
"no-global-assign": [],
"no-implicit-coercion": [{"boolean": true, "number": true, "string": true, "allow": []}],
"no-irregular-whitespace": [{"skipComments": false}],
"no-lonely-if": [],
"no-mixed-spaces-and-tabs": [],
"no-multi-str": [],
"no-multiple-empty-lines": [{"max": 2, "maxBOF": 0, "maxEOF": 0}],
"no-negated-condition": [],
"no-new-object": [],
"no-octal": [],
"no-octal-escape": [],
"no-param-reassign": [{"props": false}],
"no-path-concat": [],
"no-plusplus": [],
"no-prototype-builtins": [],
"no-regex-spaces": [],
"no-self-assign": [],
"no-sequences": [],
"no-shadow-restricted-names": [],
"no-sparse-arrays": [],
"no-tabs": [],
"no-throw-literal": [],
"no-trailing-spaces": [{"skipBlankLines": false}],
"no-undef": [{"typeof": false}],
"no-unexpected-multiline": [],
"no-unneeded-ternary": [{"defaultAssignment": false}],
"no-unreachable": [],
"no-unsafe-negation": [],
"no-unused-vars": [{"vars": "all", "args": "none", "caughtErrors": "none"}],
"no-useless-concat": [],
"no-useless-escape": [],
"no-whitespace-before-property": [],
"no-with": [],
"object-curly-spacing": ["never"],
"object-property-newline": [{"allowMultiplePropertiesPerLine": true}],
"operator-assignment": ["always"],
"quotes": ["single", {"avoidEscape": true}],
"radix": ["always"],
"semi": ["always", {"omitLastInOneLineBlock": false}],
"semi-spacing": [{"before": false, "after": true}],
"space-before-blocks": ["always"],
"space-before-function-paren": [{"anonymous": "never", "named": "never"}],
"space-in-parens": ["never", {"exceptions": []}],
"space-infix-ops": [],
"space-unary-ops": [{"words": true, "nonwords": false, "overrides": {}}],
"spaced-comment": ["always", {"line": {"markers": ["#", "."], "exceptions": ["."]}}],
"strict": ["safe"],
"unicode-bom": ["never"],
"valid-typeof": [{"requireStringLiterals": true}],
"wrap-iife": ["outside"],
"yoda": ["never", {"exceptRange": true}]
"rules": {
"array-bracket-spacing": ["error", "never"],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", {"allowSingleLine": true}],
"comma-spacing": ["error", {"before": false, "after": true}],
"comma-style": ["error", "last"],
"computed-property-spacing": ["error", "never"],
"curly": ["error", "multi-line", "consistent"],
"dot-location": ["error", "property"],
"eol-last": ["error", "always"],
"eqeqeq": ["error", "always", {"null": "never"}],
"for-direction": ["error"],
"func-call-spacing": ["error", "never"],
"indent": ["error", 2, {"SwitchCase": 1, "FunctionDeclaration": {"parameters": "first"}, "FunctionExpression": {"parameters": "first"}, "CallExpression": {"arguments": "first"}, "ArrayExpression": "first", "ObjectExpression": "first", "ignoredNodes": ["ConditionalExpression", "MemberExpression"]}],
"key-spacing": ["error", {"beforeColon": false, "afterColon": true, "mode": "strict"}],
"keyword-spacing": ["error", {"before": true, "after": true}],
"linebreak-style": ["error", "unix"],
"max-len": ["error", {"code": 79, "ignoreUrls": true, "ignorePattern": "^ *//(# | .* :: |[.] > |[.] // )"}],
"new-parens": ["error"],
"no-array-constructor": ["error"],
"no-caller": ["error"],
"no-case-declarations": ["error"],
"no-compare-neg-zero": ["error"],
"no-cond-assign": ["error", "except-parens"],
"no-dupe-args": ["error"],
"no-dupe-keys": ["error"],
"no-duplicate-case": ["error"],
"no-empty-character-class": ["error"],
"no-eval": ["error", {"allowIndirect": false}],
"no-extra-parens": ["error", "all", {"conditionalAssign": false, "nestedBinaryExpressions": false}],
"no-extra-semi": ["error"],
"no-fallthrough": ["error"],
"no-floating-decimal": ["error"],
"no-global-assign": ["error"],
"no-implicit-coercion": ["error", {"boolean": true, "number": true, "string": true, "allow": []}],
"no-irregular-whitespace": ["error", {"skipComments": false}],
"no-lonely-if": ["error"],
"no-mixed-spaces-and-tabs": ["error"],
"no-multi-str": ["error"],
"no-multiple-empty-lines": ["error", {"max": 2, "maxBOF": 0, "maxEOF": 0}],
"no-negated-condition": ["error"],
"no-new-object": ["error"],
"no-octal": ["error"],
"no-octal-escape": ["error"],
"no-param-reassign": ["error", {"props": false}],
"no-path-concat": ["error"],
"no-plusplus": ["error"],
"no-prototype-builtins": ["error"],
"no-regex-spaces": ["error"],
"no-self-assign": ["error"],
"no-sequences": ["error"],
"no-shadow-restricted-names": ["error"],
"no-sparse-arrays": ["error"],
"no-tabs": ["error"],
"no-throw-literal": ["error"],
"no-trailing-spaces": ["error", {"skipBlankLines": false}],
"no-undef": ["error", {"typeof": false}],
"no-unexpected-multiline": ["error"],
"no-unneeded-ternary": ["error", {"defaultAssignment": false}],
"no-unreachable": ["error"],
"no-unsafe-negation": ["error"],
"no-unused-vars": ["error", {"vars": "all", "args": "none", "caughtErrors": "none"}],
"no-useless-concat": ["error"],
"no-useless-escape": ["error"],
"no-whitespace-before-property": ["error"],
"no-with": ["error"],
"object-curly-newline": ["error", {"consistent": true}],
"object-curly-spacing": ["error", "never"],
"object-property-newline": ["error", {"allowMultiplePropertiesPerLine": true}],
"operator-assignment": ["error", "always"],
"quotes": ["error", "single", {"avoidEscape": true}],
"radix": ["error", "always"],
"semi": ["error", "always", {"omitLastInOneLineBlock": false}],
"semi-spacing": ["error", {"before": false, "after": true}],
"semi-style": ["error", "last"],
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["error", {"anonymous": "never", "named": "never"}],
"space-in-parens": ["error", "never", {"exceptions": []}],
"space-infix-ops": ["error"],
"space-unary-ops": ["error", {"words": true, "nonwords": false, "overrides": {}}],
"spaced-comment": ["error", "always", {"line": {"markers": ["#", "."], "exceptions": ["."]}}],
"strict": ["error", "safe"],
"switch-colon-spacing": ["error", {"before": false, "after": true}],
"unicode-bom": ["error", "never"],
"valid-typeof": ["error", {"requireStringLiterals": true}],
"wrap-iife": ["error", "outside"],
"yoda": ["error", "never", {"exceptRange": true}]
},
"overrides": [
{
"files": ["index.js"],
"globals": {"define": false, "module": false, "require": false, "self": false}
},
{
"files": ["karma.conf.js"],
"env": {"node": true},
"rules": {
"dot-notation": ["error", {"allowKeywords": true}]
}
},
{
"files": ["test/**/*.js"],
"env": {"es6": true, "node": true},
"globals": {"suite": false, "test": false},
"rules": {
"dot-notation": ["error", {"allowKeywords": true}],
"max-len": ["off"]
}
}
]
}
11 changes: 0 additions & 11 deletions eslint-es3-only.json

This file was deleted.

85 changes: 2 additions & 83 deletions eslint-es3.json
Original file line number Diff line number Diff line change
@@ -1,95 +1,14 @@
{
"extends": ["./eslint-common.json"],
"rules": {
"array-bracket-spacing": ["error", "never"],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", {"allowSingleLine": true}],
"comma-dangle": ["error", "never"],
"comma-spacing": ["error", {"after": true, "before": false}],
"comma-style": ["error", "last"],
"computed-property-spacing": ["error", "never"],
"curly": ["error", "multi-line", "consistent"],
"dot-location": ["error", "property"],
"dot-notation": ["error", {"allowKeywords": false}],
"eol-last": ["error", "always"],
"eqeqeq": ["error", "always", {"null": "never"}],
"func-call-spacing": ["error", "never"],
"func-style": ["error", "declaration", {"allowArrowFunctions": false}],
"indent": ["error", 2, {"ArrayExpression": "first", "CallExpression": {"arguments": "first"}, "FunctionDeclaration": {"parameters": "first"}, "FunctionExpression": {"parameters": "first"}, "ObjectExpression": "first", "SwitchCase": 1}],
"key-spacing": ["error", {"afterColon": true, "beforeColon": false, "mode": "strict"}],
"keyword-spacing": ["error", {"after": true, "before": true}],
"linebreak-style": ["error", "unix"],
"max-len": ["error", {"code": 79, "ignorePattern": "^ *//# ", "ignoreUrls": true}],
"new-parens": ["error"],
"no-array-constructor": ["error"],
"no-caller": ["error"],
"no-case-declarations": ["error"],
"no-catch-shadow": ["error"],
"no-compare-neg-zero": ["error"],
"no-cond-assign": ["error", "except-parens"],
"no-dupe-args": ["error"],
"no-dupe-keys": ["error"],
"no-duplicate-case": ["error"],
"no-empty-character-class": ["error"],
"no-eval": ["error", {"allowIndirect": false}],
"no-extra-parens": ["error", "all", {"conditionalAssign": false, "nestedBinaryExpressions": false}],
"no-extra-semi": ["error"],
"no-fallthrough": ["error"],
"no-floating-decimal": ["error"],
"no-func-assign": ["error"],
"no-global-assign": ["error"],
"no-implicit-coercion": ["error", {"allow": [], "boolean": true, "number": true, "string": true}],
"no-inner-declarations": ["error", "functions"],
"no-invalid-regexp": ["error", {"allowConstructorFlags": ["g", "i", "m"]}],
"no-irregular-whitespace": ["error", {"skipComments": false}],
"no-lonely-if": ["error"],
"no-mixed-spaces-and-tabs": ["error"],
"no-multi-str": ["error"],
"no-multiple-empty-lines": ["error", {"max": 2, "maxBOF": 0, "maxEOF": 0}],
"no-negated-condition": ["error"],
"no-new-object": ["error"],
"no-octal": ["error"],
"no-octal-escape": ["error"],
"no-param-reassign": ["error", {"props": false}],
"no-path-concat": ["error"],
"no-plusplus": ["error"],
"no-prototype-builtins": ["error"],
"no-redeclare": ["error", {"builtinGlobals": true}],
"no-regex-spaces": ["error"],
"no-self-assign": ["error"],
"no-sequences": ["error"],
"no-shadow-restricted-names": ["error"],
"no-sparse-arrays": ["error"],
"no-tabs": ["error"],
"no-throw-literal": ["error"],
"no-trailing-spaces": ["error", {"skipBlankLines": false}],
"no-undef": ["error", {"typeof": false}],
"no-unexpected-multiline": ["error"],
"no-unneeded-ternary": ["error", {"defaultAssignment": false}],
"no-unreachable": ["error"],
"no-unsafe-negation": ["error"],
"no-unused-vars": ["error", {"args": "none", "caughtErrors": "none", "vars": "all"}],
"no-useless-concat": ["error"],
"no-useless-escape": ["error"],
"no-whitespace-before-property": ["error"],
"no-with": ["error"],
"object-curly-spacing": ["error", "never"],
"object-property-newline": ["error", {"allowMultiplePropertiesPerLine": true}],
"operator-assignment": ["error", "always"],
"quote-props": ["error", "as-needed", {"keywords": true}],
"quotes": ["error", "single", {"avoidEscape": true}],
"radix": ["error", "always"],
"semi": ["error", "always", {"omitLastInOneLineBlock": false}],
"semi-spacing": ["error", {"after": true, "before": false}],
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["error", {"anonymous": "never", "named": "never"}],
"space-in-parens": ["error", "never", {"exceptions": []}],
"space-infix-ops": ["error"],
"space-unary-ops": ["error", {"nonwords": false, "overrides": {}, "words": true}],
"spaced-comment": ["error", "always", {"line": {"exceptions": ["."], "markers": ["#", "."]}}],
"strict": ["error", "safe"],
"unicode-bom": ["error", "never"],
"valid-typeof": ["error", {"requireStringLiterals": true}],
"wrap-iife": ["error", "outside"],
"yoda": ["error", "never", {"exceptRange": true}]
"quote-props": ["error", "as-needed", {"keywords": true}]
}
}
24 changes: 0 additions & 24 deletions eslint-es6-only.json

This file was deleted.

Loading

0 comments on commit bc63c5b

Please sign in to comment.