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

Fix or improve eslint disable comments #15384

Merged
merged 1 commit into from May 3, 2019

Conversation

@talldan
Copy link
Contributor

commented May 2, 2019

Description

I noticed while working on some code that the eslint-disable comment in the WritingFlow component didn't have a correct corresponding closing comment (instead it had another eslint-disable comment).

I decided to have a quick look through the code base for other issues and tidy up the rules where I could. The changes:

  • Ensure eslint-disable comments have a corresponding eslint-enable comment (except for cases where the whole file was disabled).
  • Prefer eslint-disable-next-line where possible
  • Combine some adjacent eslint-disable comments
  • Some other general tidy-up of comments

How has this been tested?

  • Check disable rule still works

Types of changes

Code quality (non-breaking change)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@talldan talldan self-assigned this May 2, 2019

@talldan talldan marked this pull request as ready for review May 2, 2019

@aduth

aduth approved these changes May 2, 2019

Copy link
Member

left a comment

This is lovely ❤️

autoFocus={ Platform.OS === 'ios' }
/>
/* eslint-enable jsx-a11y/no-autofocus */ }
{ /* eslint-disable jsx-a11y/no-autofocus */ }

This comment has been minimized.

Copy link
@aduth

aduth May 2, 2019

Member

Is it possible for this to be framed as an // eslint-disable-next-line ? Unsure if it's captured at the opening tag or at the prop assignment.

This comment has been minimized.

Copy link
@talldan

talldan May 3, 2019

Author Contributor

Looks like it can't, unfortunately. Thanks for the review!

@talldan talldan merged commit e246157 into master May 3, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

@talldan talldan deleted the fix/incorrect-eslint-disable-comments branch May 3, 2019

@talldan talldan added this to the 5.7 (Gutenberg) milestone May 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.