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

chore: Upgrade Airbnb ESLint config versions #331

Merged
merged 8 commits into from
Aug 14, 2019
Merged

chore: Upgrade Airbnb ESLint config versions #331

merged 8 commits into from
Aug 14, 2019

Conversation

taion
Copy link
Contributor

@taion taion commented Aug 14, 2019

BREAKING CHANGE: This probably breaks something.

BREAKING CHANGE: This probably breaks something.
@taion taion requested a review from jquense August 14, 2019 00:48
},
"peerDependencies": {
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.3"
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^1.7.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should have been a peer dep all along

@@ -1,16 +1,6 @@
module.exports = {
// We put all styling imports at the end.
'import/first': 'off',
// Allow <Link to>.
// TODO: Remove this when airbnb includes this in next release.
'jsx-a11y/anchor-is-valid': [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed upstream

@@ -21,9 +11,6 @@ module.exports = {
depth: 25,
},
],
'jsx-a11y/label-has-for': 'off',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed upstream

@@ -21,9 +11,6 @@ module.exports = {
depth: 25,
},
],
'jsx-a11y/label-has-for': 'off',
'react-hooks/rules-of-hooks': 'error',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

included in upstream

Copy link
Member

Choose a reason for hiding this comment

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

nice

@@ -21,9 +11,6 @@ module.exports = {
depth: 25,
},
],
'jsx-a11y/label-has-for': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is an error upstream, but we don't allow errors in our pre-commit hooks mostly, so who cares

Copy link
Member

Choose a reason for hiding this comment

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

only frontend does the no warnings thing, which isn't tenable for telemed right now, it's got a lot of warning that are intentionally left there (e.g. alerts, console.logs)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, rather, it gets auto-fixed, so we still need to forcibly pragma it

@@ -61,6 +50,7 @@ module.exports = {
'getters',
'setters',
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/',
'instance-methods',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why not

Copy link
Member

Choose a reason for hiding this comment

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

does this make you need to group arrow functions and methods? That was one of the motivating reasons to override 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.

i thought we overrode this to insert the thing for type definitions

Copy link
Member

Choose a reason for hiding this comment

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

also that

@@ -23,7 +21,6 @@ module.exports = {
},
],
'no-plusplus': 'off',
'no-restricted-globals': ['error'].concat(restirctedGlobals),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAICT this was just to allow isNaN and isFinite? But they both legitimately are sort of crappy.

Copy link
Member

Choose a reason for hiding this comment

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

not sure i understand, this prevents you from using sketchy globals like name and event things that are likely local identifiers and you'd not get a "undef" warning for if you forgot to actually declare them in code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

o nice, 👍 didn't know that, just duplicated work then

@taion
Copy link
Contributor Author

taion commented Aug 14, 2019

Did we explicitly decide against array-type and no-this-alias for TS?

Copy link
Member

@jquense jquense left a comment

Choose a reason for hiding this comment

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

Did we explicitly decide against array-type and no-this-alias for TS?

like picking one? No, all the TS rules are open for debate i went with some standard set before i felt qualified to make choices myself

Copy link
Contributor Author

@taion taion left a comment

Choose a reason for hiding this comment

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

@jquense On those two TS rules, I ask because those are the things in the (new) recommended config that are most conspicuously missing here. If we don't explicitly want to avoid them, then we should consider extending the recommended TS ESLint config.

@taion
Copy link
Contributor Author

taion commented Aug 14, 2019

@jquense i changed the TS config to extend and override the base rule. let me know if this is gtg

@taion taion requested a review from jquense August 14, 2019 19:23
@jquense
Copy link
Member

jquense commented Aug 14, 2019

lgtm if the parser setup is the same i'm guessing in the base configs ?

@taion taion merged commit a59c6d5 into master Aug 14, 2019
@taion taion deleted the up branch August 14, 2019 21:56
@taion
Copy link
Contributor Author

taion commented Aug 14, 2019

i force reverted this because i don't want to major-bump everything. gah

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.

2 participants