Skip to content

Commit

Permalink
remove remaining style-only rules, add additional correctness rules, …
Browse files Browse the repository at this point in the history
…update deps (#8)

* remove remaining style-only rules
* adds additional correctness rules
* updates dependencies

new projects will use this eslint config, and we want it to just be standardjs plus additional rules that help enforce correctness, no style. each existing project can add its own style rules or (suggested) use eslint --fix to automatically adhere to this config.

reviewers: @samskeller @sawyerh
  • Loading branch information
kencheeto authored Jul 30, 2018
1 parent 0be229e commit 467dd5d
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 168 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
We're based on [Standard JS](http://standardjs.com/), which provides a complete node/browser/react ruleset, with a few changes:

* using `eslint` directly, since we want to relax rulesets for adoption into existing repos
* enforcing use of semicolons
* locking to es6, as we don't assume babel compilation for node services
* using `eslint-config-standard` instead of `standard`, since we want to add additional rules
* adding additional rules that either promote correctness or a higher signal-to-noise ratio
* avoiding rules that are purely stylistic in nature

[See the full Standard JS ruleset here](https://github.com/feross/eslint-config-standard/blob/master/eslintrc.json) and the [Standard React ruleset here](https://github.com/feross/eslint-config-standard-react/blob/master/eslintrc.json).

Expand Down
14 changes: 5 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
module.exports = {
extends: ['standard', 'standard-react'],
rules: {
/*
Standard overrides
*/
semi: ['error', 'always'], // churn-expensive to enforce
'space-before-function-paren': ['error', 'never'],

/*
Nava-specific rules
*/
'linebreak-style': ['error', 'unix'],
'sort-vars': ['error', {ignoreCase: true}],
'no-alert': 'error',
'no-var': 'error',
'prefer-const': 'error',
'prefer-arrow-callback': 'error'
'prefer-arrow-callback': 'error',
'promise/no-native': 'error',
'promise/catch-or-return': 'error',
'promise/no-return-wrap': 'error',
'promise/valid-params': 'error'
}
};
Loading

0 comments on commit 467dd5d

Please sign in to comment.