2.0.7 • Published 4 years ago
@unicefnz/eslint-config v2.0.7
UNICEF NZ Javascript Style Guide
Installing
Check out Installing for detailed instructions installing the ESLint plugin
npm install --save-dev eslint typescript @unicefnz/eslint-config
// .eslintrc.js
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('@unicefnz/eslint-config/patch');
module.exports = {
extends: [
'@unicefnz'
],
parserOptions: { tsconfigRootDir: __dirname }
}
Style Choices
This guide extends Airbnb's JS style with a few opinionated tweaks to make your life easier.
- arrow-parens has been loosened so simple expressions don't require parentheses
- comma-dangle is disabled
- import/no-extraneous-dependencies is disabled, this can stop you importing devDeps and types, etc
- import/no-unresolved is disabled, this should be a build time error, not a linting issue
- max-len has been bumped up to 140 characters. You could put a tweet on every line!
- no-plusplus has been disabled. Only needed to avoid insane edge cases.
- prefer-template is disabled
React
- react/jsx-filename-extension is disabled
- react/jsx-props-no-spreading is disabled, sometimes this is required
- react/require-default-props is disabled, sometimes undefined is fine
- react/jsx-one-expression-per-line is disabled. Makes "Hello {name}" invalid, come on.
- react/static-property-placement is disabled with typescript
- jsx-a11y/accessible-emoji is disabled, because come on, no one can be bothered
Typescript
- consistent-return disabled, this should be enforced by the typescript compiler
- spaced-comment modified to allow /// comments
Contributing
Have a look at Contributing
2.0.7
4 years ago
2.0.6
4 years ago
2.0.5
4 years ago
2.0.4
4 years ago
2.0.3
4 years ago
2.0.2
4 years ago
2.0.1
5 years ago
2.0.0-beta.2
5 years ago
2.0.0
5 years ago
2.0.0-beta.1
5 years ago
1.5.0
5 years ago
1.4.2
5 years ago
1.4.1
5 years ago
1.4.0
5 years ago
1.3.0
5 years ago
1.2.2
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.0
5 years ago
1.0.0
5 years ago