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

Conversation

shaundon
Copy link
Contributor

Things to discuss:

  • Should this be a major release as it's likely to contain 'breaking' changes, i.e. consumer builds probably won't pass due to all the rule changes.
  • In our monorepo we've added a lot of rule opt-outs to .eslintrc. Should those be mirrored here? Or is it left up to consumers. Maybe we could put the opt-outs into the .eslintrc of backpack-react-scripts?

@matthewdavidson
Copy link
Contributor

@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.

@matthewdavidson
Copy link
Contributor

matthewdavidson commented Oct 25, 2017

Also can you incorporate the removal of np that i started in #4 please? 😇 (i'll close #4 in favor of this)

@shaundon shaundon force-pushed the bpk-964-upgrade-config branch 7 times, most recently from e044fd6 to 57e6924 Compare October 25, 2017 12:21
@shaundon shaundon force-pushed the bpk-964-upgrade-config branch from 57e6924 to e955d7e Compare October 25, 2017 12:30
@shaundon
Copy link
Contributor Author

New changes:

  • Fixed broken test.
  • Updated changelog.
  • Changed to a major release.
  • Migrated rule opt outs from monorepo to this one.
  • Removed np dev dependency (it was np)

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.
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.
Copy link
Contributor

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?

Copy link
Contributor Author

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 = {};
Copy link
Contributor

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",
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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).

Copy link
Contributor Author

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?

@shaundon shaundon force-pushed the bpk-964-upgrade-config branch 2 times, most recently from a7af91f to 133e8b5 Compare October 25, 2017 15:28
@shaundon shaundon force-pushed the bpk-964-upgrade-config branch from 133e8b5 to b44cfba Compare October 25, 2017 15:30
@shaundon shaundon dismissed matthewdavidson’s stale review October 25, 2017 15:33

Everything addressed.

Copy link
Contributor

@matteo-hertel matteo-hertel left a comment

Choose a reason for hiding this comment

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

🚀

@shaundon shaundon merged commit 47a62cf into master Oct 27, 2017
@shaundon shaundon deleted the bpk-964-upgrade-config branch October 27, 2017 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants