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

[BPK-964] Upgrade eslint versions #6

Merged
merged 2 commits into from
Oct 27, 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
13 changes: 12 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 3.0.0 - Upgraded `esling-config-airbnb peer dependencies`

### Changed
- Upgraded the following peer dependencies:
- babel-eslint: `^7.2.3` -> `^8.0.1`
- [eslint](https://github.com/eslint/eslint/blob/master/CHANGELOG.md): `^3.17.1` -> `^4.9.0`
- [eslint-config-airbnb](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/CHANGELOG.md): `^14.1.0` -> `^16.1.0`
- [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md): `^2.2.0` -> `^2.8.0`
- [eslint-plugin-jsx-a11y](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/CHANGELOG.md): `^4.0.0` -> `^6.0.2`
- [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md): `^6.10.0` -> `^7.4.0`

## 2.0.0 - Changed parser to `babel-eslint`
## Changed
- Changed parser to `babel-eslint` to support dynamic `import()` statements used with Webpack 2
Expand Down
19 changes: 18 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@ module.exports = {
parser: 'babel-eslint',
extends: 'airbnb',
rules: {
'valid-jsdoc': ['error']
'valid-jsdoc': ['error'],

// Disabled whilst incompatibilities still exist with react/jsx-closing-tag-location, react/jsx-indent & max-len.
// See https://github.com/airbnb/javascript/issues/1584#issuecomment-335667272
"function-paren-newline": 0,

// Disabled whilst false positives still exist with custom propTypes + isRequired.
// See https://github.com/yannickcr/eslint-plugin-react/issues/1389
"react/no-typos": 0,

// Added 'to' as a specialLink property, which prevents react-router's
// 'Link' component from triggering this rule.
// See https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/339
"jsx-a11y/anchor-is-valid": ["error", {
"components": ["Link"],
"specialLink": ["to"],
"aspects": ["noHref", "invalidHref", "preferButton"],
}]
}
};
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@
"styleguide"
],
"peerDependencies": {
"babel-eslint": "^7.2.3",
"eslint": "^3.17.1",
"eslint-config-airbnb": "^14.1.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.10.0"
},
"devDependencies": {
"np": "^2.10.0"
"babel-eslint": "^8.0.1",
"eslint": "^4.9.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.4.0"
},
"scripts": {
"publish": "np",
Expand Down
30 changes: 6 additions & 24 deletions test/pass.jsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
import React, { Component } from 'react';
import React from 'react';
import PropTypes from 'prop-types';

class Banner extends Component {
/**
* Represents a book.
* @constructor
* @param {string} title - The title of the book.
* @param {string} author - The author of the book.
*/
constructor() {
super();

this.state = {
key: 'value',
};
}

render() {
return (
<div role="banner">
{ this.props.children }
</div>
);
}
}
const Banner = props => (
<div role="banner">
{ props.children }
</div>
);

Banner.propTypes = {
children: PropTypes.node.isRequired,
Expand Down