-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
@shaundon the opt outs should be removed from backpack and placed in eslint-config-skyscanner as a source of truth. And yeah, it' defo a major release. |
e044fd6
to
57e6924
Compare
57e6924
to
e955d7e
Compare
New changes:
|
index.js
Outdated
'valid-jsdoc': ['error'] | ||
'valid-jsdoc': ['error'], | ||
|
||
// We've decided we don't want this for now as it makes writing JSX more painful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest "Disabled whilst incompatibilities still exist with react/jsx-closing-tag-location, react/jsx-indent & max-len."
index.js
Outdated
// See https://github.com/airbnb/javascript/issues/1584#issuecomment-335667272 | ||
"function-paren-newline": 0, | ||
|
||
// False positive on custom propTypes + isRequired. https://github.com/yannickcr/eslint-plugin-react/issues/1389 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest "Disabled whilst false positives still exist with custom propTypes + isRequired.".
Also can we put the "See jsx-eslint/eslint-plugin-react#1389" on a newline like the previous one.
index.js
Outdated
// False positive on custom propTypes + isRequired. https://github.com/yannickcr/eslint-plugin-react/issues/1389 | ||
"react/no-typos": 0, | ||
|
||
// See https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/339 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we explain this one a bit more? (similar to previous examples)
index.js
Outdated
}], | ||
|
||
// See https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/282 | ||
// We should probably change our code to adhere to the standard here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again can we explain what's going on here and why "we" aren't adhering to the standard here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think this rule should be inside the monorepo, not here.
Rather than fixing an incompatibility, it's just used to work around our own code which isn't fully adherent to this rule yet. It's probably not a great idea to make the rule this lax for every consumer as it's a generally good rule to have.
test/pass.jsx
Outdated
this.state = { | ||
key: 'value', | ||
}; | ||
this.state = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this ctor looks redundant now...?
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "eslint-config-skyscanner", | |||
"version": "2.0.0", | |||
"version": "3.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are you planning to publish this? Usually i'd use np
(installed as a global npm module) to publish it. This allows you too choose which version you want and it updates the package.json
for you.
Perhaps we should add publishing docs to the readme for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok - I wondered what np
was for!
changelog.md
Outdated
and this project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
## 3.0.0 - Upgraded `esling-config-airbnb peer dependencies` | ||
### Changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to dramatically improve the changelog here i think. I know you copied what I had put in #4, but i'll admit that it was rubbish! Essentially we need to itemise every major difference here (think of the things we had to fix in the backpack monorepo upgrade).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but my concern is that there are so many changes, new rules etc that we'll end up duplicating their changelog inside our own repo. I think it would be clearer if we just provided links to the official changelogs, e.g.:
### 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`
There are some substantial rule changes in this upgrade so you may find that your linter fails after upgrading. [eslint --fix](https://eslint.org/docs/user-guide/command-line-interface#--fix) should be able to fix the majority of these automatically. Anything else will need to be fixed manually.
What do you think?
a7af91f
to
133e8b5
Compare
133e8b5
to
b44cfba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Things to discuss:
.eslintrc
. Should those be mirrored here? Or is it left up to consumers. Maybe we could put the opt-outs into the.eslintrc
ofbackpack-react-scripts
?