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

Core Data: Fix ESLint warnings for the hooks directory #47811

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

Mamaduka
Copy link
Member

@Mamaduka Mamaduka commented Feb 7, 2023

What?

PR fixes ESLint warning for Code Data hooks.

Why?

Ideally, the project should not have any ESLint errors and warnings.

How?

npm run lint:js -- packages/core-data/src/hooks --fix

Testing Instructions

Running following lint command should return warnings

npm run lint:js -- packages/core-data/src/hooks

Screenshots or screencast

CleanShot 2023-02-07 at 10 13 22

@Mamaduka Mamaduka requested a review from nerrad as a code owner February 7, 2023 06:17
@Mamaduka Mamaduka self-assigned this Feb 7, 2023
@Mamaduka Mamaduka added [Type] Code Quality Issues or PRs that relate to code quality [Package] Core data /packages/core-data labels Feb 7, 2023
@Mamaduka Mamaduka requested review from adamziel and gziolo February 7, 2023 06:18
@github-actions
Copy link

github-actions bot commented Feb 7, 2023

Flaky tests detected in 3b25b6b.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4111109144
📝 Reported issues:

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Thank you for the fix.

Would it be a good idea to promote this warning to an error? People fix those warnings anyway, so why not enforce that on PR authors?

@Mamaduka
Copy link
Member Author

Mamaduka commented Feb 7, 2023

That makes sense and will match PHPCS standards.

You'll have to commit extra changes when working in the files with warnings. I think most of us have "format on save" enabled in the editors.

We can fix the remaining warning in a single go and add the commit to the .git-blame-ignore-revs.

@gziolo
Copy link
Member

gziolo commented Feb 7, 2023

You'll have to commit extra changes when working in the files with warnings. I think most of us have "format on save" enabled in the editors.

I think it requires running npm run lint -- --fix (plus the name of the rule that signals violations) because Prettier doesn't format code comments.

@Mamaduka
Copy link
Member Author

Mamaduka commented Feb 7, 2023

The ESLint extensions does, at least in VSCode.

@Mamaduka Mamaduka merged commit b66cf58 into trunk Feb 7, 2023
@Mamaduka Mamaduka deleted the fix/core-data-hooks-eslint branch February 7, 2023 09:34
@github-actions github-actions bot added this to the Gutenberg 15.2 milestone Feb 7, 2023
@tyxla
Copy link
Member

tyxla commented Feb 8, 2023

As initially brought up by @gziolo I'm suggesting that we change the jsdoc/check-line-alignment to error in #47878.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Core data /packages/core-data [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants