-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: configure prettier and eslint
- add prettier to do formatting - add eslint-config-prettier to disable rules conflicting with prettier - remove eslint from grunt workflow - use lint-stage to lint and format on precommit - use eslint and prettier in travis directly - remove rules that are already part of the "recommended" ruleset That rational is that eslint and prettier should be run in Travis-CI, on commit and as IDE integration (highlighting errors directlry). They don't need to be run along with test-cases. Getting linting errors when running the tests because of missing semicolons is just annoying, but doesn't help the overall code-quality.
- Loading branch information
Showing
19 changed files
with
1,890 additions
and
553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.rvmrc | ||
.DS_Store | ||
/tmp/ | ||
*.sublime-project | ||
*.sublime-workspace | ||
npm-debug.log | ||
sauce_connect.log* | ||
.idea | ||
yarn-error.log | ||
node_modules | ||
/handlebars-release.tgz | ||
|
||
# Generated files | ||
lib/handlebars/compiler/parser.js | ||
/coverage/ | ||
/dist/ | ||
/integration-testing/*/dist/ | ||
|
||
# Third-party or files that must remain unchanged | ||
/spec/expected/ | ||
/spec/vendor | ||
|
||
# JS-Snippets | ||
src/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,118 +1,67 @@ | ||
module.exports = { | ||
"extends": ["eslint:recommended","plugin:compat/recommended"], | ||
"globals": { | ||
"self": false | ||
extends: ['eslint:recommended', 'plugin:compat/recommended', 'prettier'], | ||
globals: { | ||
self: false | ||
}, | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
env: { | ||
node: true, | ||
es6: true | ||
}, | ||
"rules": { | ||
// overrides eslint:recommended defaults | ||
"no-sparse-arrays": "off", | ||
"no-func-assign": "off", | ||
"no-console": "warn", | ||
"no-debugger": "warn", | ||
"no-unreachable": "warn", | ||
|
||
// Possible Errors // | ||
//-----------------// | ||
"no-unsafe-negation": "error", | ||
rules: { | ||
'no-console': 'warn', | ||
|
||
// temporarily disabled until the violating places are fixed. | ||
'no-func-assign': 'off', | ||
'no-sparse-arrays': 'off', | ||
|
||
// Best Practices // | ||
//----------------// | ||
"curly": "error", | ||
"default-case": "warn", | ||
"dot-notation": ["error", { "allowKeywords": false }], | ||
"guard-for-in": "warn", | ||
"no-alert": "error", | ||
"no-caller": "error", | ||
"no-div-regex": "warn", | ||
"no-eval": "error", | ||
"no-extend-native": "error", | ||
"no-extra-bind": "error", | ||
"no-floating-decimal": "error", | ||
"no-implied-eval": "error", | ||
"no-iterator": "error", | ||
"no-labels": "error", | ||
"no-lone-blocks": "error", | ||
"no-loop-func": "error", | ||
"no-multi-spaces": "error", | ||
"no-multi-str": "warn", | ||
"no-global-assign": "error", | ||
"no-new": "error", | ||
"no-new-func": "error", | ||
"no-new-wrappers": "error", | ||
"no-octal-escape": "error", | ||
"no-process-env": "error", | ||
"no-proto": "error", | ||
"no-return-assign": "error", | ||
"no-script-url": "error", | ||
"no-self-compare": "error", | ||
"no-sequences": "error", | ||
"no-throw-literal": "error", | ||
"no-unused-expressions": "error", | ||
"no-warning-comments": "warn", | ||
"no-with": "error", | ||
"radix": "error", | ||
"wrap-iife": "error", | ||
"no-prototype-builtins": "error", | ||
|
||
'default-case': 'warn', | ||
'dot-notation': ['error', { allowKeywords: false }], | ||
'guard-for-in': 'warn', | ||
'no-alert': 'error', | ||
'no-caller': 'error', | ||
'no-div-regex': 'warn', | ||
'no-eval': 'error', | ||
'no-extend-native': 'error', | ||
'no-extra-bind': 'error', | ||
'no-floating-decimal': 'error', | ||
'no-implied-eval': 'error', | ||
'no-iterator': 'error', | ||
'no-labels': 'error', | ||
'no-lone-blocks': 'error', | ||
'no-loop-func': 'error', | ||
'no-multi-str': 'warn', | ||
'no-global-assign': 'error', | ||
'no-new': 'error', | ||
'no-new-func': 'error', | ||
'no-new-wrappers': 'error', | ||
'no-octal-escape': 'error', | ||
'no-process-env': 'error', | ||
'no-proto': 'error', | ||
'no-return-assign': 'error', | ||
'no-script-url': 'error', | ||
'no-self-compare': 'error', | ||
'no-sequences': 'error', | ||
'no-throw-literal': 'error', | ||
'no-unused-expressions': 'error', | ||
'no-warning-comments': 'warn', | ||
'no-with': 'error', | ||
radix: 'error', | ||
|
||
// Variables // | ||
//-----------// | ||
"no-catch-shadow": "error", | ||
"no-label-var": "error", | ||
"no-shadow-restricted-names": "error", | ||
"no-undef-init": "error", | ||
"no-use-before-define": ["error", "nofunc"], | ||
|
||
|
||
// Stylistic Issues // | ||
//------------------// | ||
"comma-dangle": ["error", "never"], | ||
"quote-props": ["error", "as-needed", { "keywords": true, "unnecessary": false }], | ||
"brace-style": ["error", "1tbs", { "allowSingleLine": true }], | ||
"camelcase": "error", | ||
"comma-spacing": ["error", { "before": false, "after": true }], | ||
"comma-style": ["error", "last"], | ||
"consistent-this": ["warn", "self"], | ||
"eol-last": "error", | ||
"func-style": ["error", "declaration"], | ||
"key-spacing": ["error", { | ||
"beforeColon": false, | ||
"afterColon": true | ||
}], | ||
"new-cap": "error", | ||
"new-parens": "error", | ||
"no-array-constructor": "error", | ||
"no-lonely-if": "error", | ||
"no-mixed-spaces-and-tabs": "error", | ||
"no-nested-ternary": "warn", | ||
"no-new-object": "error", | ||
"no-spaced-func": "error", | ||
"no-trailing-spaces": "error", | ||
"no-extra-parens": ["error", "functions"], | ||
"quotes": ["error", "single", "avoid-escape"], | ||
"semi": "error", | ||
"semi-spacing": ["error", { "before": false, "after": true }], | ||
"keyword-spacing": "error", | ||
"space-before-blocks": ["error", "always"], | ||
"space-before-function-paren": ["error", { "anonymous": "never", "named": "never" }], | ||
"space-in-parens": ["error", "never"], | ||
"space-infix-ops": "error", | ||
"space-unary-ops": "error", | ||
"spaced-comment": ["error", "always", { "markers": [","] }], | ||
"wrap-regex": "warn", | ||
'no-label-var': 'error', | ||
'no-undef-init': 'error', | ||
'no-use-before-define': ['error', 'nofunc'], | ||
|
||
// ECMAScript 6 // | ||
//--------------// | ||
"no-var": "warn" | ||
'no-var': 'error' | ||
}, | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"ecmaVersion": 6, | ||
"ecmaFeatures": {} | ||
parserOptions: { | ||
sourceType: 'module', | ||
ecmaVersion: 6, | ||
ecmaFeatures: {} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
vendor | ||
.rvmrc | ||
.DS_Store | ||
lib/handlebars/compiler/parser.js | ||
/dist/ | ||
/tmp/ | ||
/coverage/ | ||
node_modules | ||
*.sublime-project | ||
*.sublime-workspace | ||
npm-debug.log | ||
sauce_connect.log* | ||
.idea | ||
yarn-error.log | ||
/yarn-error.log | ||
/yarn.lock | ||
node_modules | ||
/handlebars-release.tgz | ||
|
||
# Generated files | ||
lib/handlebars/compiler/parser.js | ||
/coverage/ | ||
/dist/ | ||
/integration-testing/*/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.rvmrc | ||
.DS_Store | ||
/tmp/ | ||
*.sublime-project | ||
*.sublime-workspace | ||
npm-debug.log | ||
sauce_connect.log* | ||
.idea | ||
yarn-error.log | ||
node_modules | ||
/handlebars-release.tgz | ||
|
||
# Generated files | ||
lib/handlebars/compiler/parser.js | ||
/coverage/ | ||
/dist/ | ||
/integration-testing/*/dist/ | ||
|
||
# Third-party or files that must remain unchanged | ||
/spec/expected/ | ||
/spec/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
module.exports = { | ||
"extends": "eslint:recommended", | ||
"globals": { | ||
"self": false | ||
extends: ['eslint:recommended', 'plugin:es5/no-es2015', 'prettier'], | ||
globals: { | ||
self: false | ||
}, | ||
"env": { | ||
"node": true | ||
env: { | ||
node: true | ||
}, | ||
"rules": { | ||
'no-console': 'off' | ||
rules: { | ||
'no-console': 'off', | ||
'no-var': 'off' | ||
} | ||
} | ||
}; |
Oops, something went wrong.