Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESLint] Update dependencies and split configs #21

Merged
merged 3 commits into from
May 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eslint/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
},
"rules": {
"quote-props": 0,
"max-len": ["error", 80]
"no-multiple-empty-lines": 0
}
}
3 changes: 3 additions & 0 deletions eslint/.hound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
eslint:
enabled: true
config_file: .eslintrc.json
1 change: 1 addition & 0 deletions eslint/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/rules/*.yml
/.eslintrc.json
/.gitignore
/.hound.yml
/yarn.lock
25 changes: 25 additions & 0 deletions eslint/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## master
### Changed
- `newline-per-chained-call` - disabled
- Split one big config into three separate ones: general, React and Flow.

## [0.3.3] - 2017-05-12
### Changed
- `curry/arrow-parens` set to `requireForBlockBody: false`
- `import/prefer-default-export` - disabled

## [0.3.2] - 2017-05-11
### Added
- `no-var: error`

## [0.3.1] - 2017-05-02
### Added
- `eslint-plugin-curry`

## [0.3.0] - 2017-04-28
### Added
- `object-curly-spacing: always`
- Rules for Flow.
### Changed
- Allow parens in `no-confusing-arrow`

## [0.2.0] - 2017-04-14
### Changed
- Rules are now in Yaml.
24 changes: 22 additions & 2 deletions eslint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,27 @@ yarn add -D eslint-config-umbrellio
Install peer dependencies if you already haven't:

```
yarn add -D eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-node eslint-plugin-prefer-object-spread eslint-plugin-promise eslint-plugin-react eslint-plugin-flowtype eslint-plugin-curry
yarn add -D eslint-plugin-import eslint-plugin-node eslint-plugin-prefer-object-spread eslint-plugin-promise eslint-plugin-curry
```

Add `umbrellio` to "extends" section of ESLint config.
Add `umbrellio` to "extends" section of ESLint config:

```json
{
"extends": "umbrellio"
}
```

You can also enable optional configs:

```json
{
"extends": [
"umbrellio",
"umbrellio/flow",
"umbrellio/react"
]
}
```

Note that React config requires `eslint-plugin-react` and `eslint-plugin-jsx-a11y`, and Flow config requires `eslint-plugin-flowtype`.
5 changes: 5 additions & 0 deletions eslint/flow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: ['flowtype'],
extends: ['./rules/flowtype'].map(require.resolve),
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


20 changes: 3 additions & 17 deletions eslint/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
module.exports = {
plugins: [
'curry',
'flowtype',
'import',
'jsx-a11y',
'node',
'prefer-object-spread',
'promise',
'react',
],
extends: [
'./rules/es6',
'./rules/etc',
'./rules/import',
'./rules/react',
'./rules/flowtype',
].map(require.resolve),
plugins: ['curry', 'import', 'node', 'prefer-object-spread', 'promise'],
extends: ['./rules/es6', './rules/etc', './rules/import'].map(require.resolve),
}

17 changes: 5 additions & 12 deletions eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,18 @@
"eslint-plugin-curry": "^0.1.0",
"eslint-plugin-flowtype": "^2.32.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-jsx-a11y": "^5.0.1",
"eslint-plugin-node": "^4.2.2",
"eslint-plugin-prefer-object-spread": "^1.1.0",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-react": "^6.10.3",
"eslint-plugin-react": "^7.0.1",
"yamljs": "^0.2.9"
},
"peerDependencies": {
"eslint-plugin-curry": "^0.1.0",
"eslint-plugin-flowtype": "^2.32.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-node": "^4.2.2",
"eslint-plugin-prefer-object-spread": "^1.1.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-react": "^6.10.3"
"eslint": "^3.19.0"
},
"scripts": {
"build": "yaml2json rules -s",
"lint": "eslint index.js"
"lint": "eslint *.js"
}
}
5 changes: 5 additions & 0 deletions eslint/react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: ['react', 'jsx-a11y'],
extends: ['./rules/react'].map(require.resolve),
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


8 changes: 6 additions & 2 deletions eslint/rules/react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ rules:
react/jsx-no-duplicate-props: error
react/jsx-no-undef: error
react/jsx-pascal-case: error
react/jsx-space-before-closing: error
react/jsx-tag-spacing:
- error
- closingSlash: never
beforeSelfClosing: always
afterOpening: never
react/jsx-uses-react: error
react/jsx-uses-vars: error
react/jsx-wrap-multilines: error
Expand All @@ -49,7 +53,7 @@ rules:
- everything-else
- render

jsx-a11y/img-has-alt: error
jsx-a11y/alt-text: error
jsx-a11y/img-redundant-alt: error
jsx-a11y/aria-role: error
jsx-a11y/no-access-key: error
Loading