Skip to content

Fixes grunt check warnings in yoastseo#20952

Merged
mhkuu merged 16 commits intoreleasing-yoastseofrom
69-fix-grunt-check-warnings-in-packagesyoastseo
Dec 21, 2023
Merged

Fixes grunt check warnings in yoastseo#20952
mhkuu merged 16 commits intoreleasing-yoastseofrom
69-fix-grunt-check-warnings-in-packagesyoastseo

Conversation

@FAMarfuaty
Copy link
Copy Markdown
Contributor

@FAMarfuaty FAMarfuaty commented Dec 18, 2023

Context

Summary

This PR can be summarized in the following changelog entry:

  • [yoastseo] Fixes warnings from running yarn lint.

Relevant technical choices:

  • /* eslint-disable max-len */ statements are removed for strings and regexes. Adding the disabling statement is not relevant anymore. This is because in eslintrc.js the @stylistic/max-lex is disabled already for strings and regexes.
  • I fixed the complexity warning in packages/yoastseo/src/scoring/assessments/seo/KeyphraseLengthAssessment.js and in getTransliterations.js. I didn't fix all the complexity warnings since there is a separate issue to do it: https://github.com/Yoast/lingo-other-tasks/issues/73
  • I renamed transliterations.js to getTransliterations.js since it's actually a function. Hence naming the fnction with verb is better. I also added a spec file for it and added unit tests.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • QA testing shouldn't be necessary.
  • For Dev acceptance test:
    • Make sure to be on at least Node 16.
    • Run yarn to install all dependencies.
    • In packages/yoastseo, run yarn lint and make sure that the only warnings are related to complexity and back reference.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Block/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #

* \u061B - Arabic semicolon
*/
wordBoundary = "[ \\u00a0\\u2014\\u06d4\\u061f\\u060C\\u061B\\n\\r\\t\.,\(\)”“〝〞〟‟„\"\+\\-;!¡\?¿:\/»«‹›" + extraWordBoundary + "<>";
wordBoundary = "[ \\u00a0\\u2014\\u06d4\\u061f\\u060C\\u061B\\n\\r\\t.,()”“〝〞〟‟„\"+\\-;!¡?¿:/»«‹›" + extraWordBoundary + "<>";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed the useless escape. It looks like it's okay to do so. All specs are still passing

@FAMarfuaty FAMarfuaty added this to the Releasing yoastseo milestone Dec 18, 2023
@FAMarfuaty FAMarfuaty marked this pull request as ready for review December 18, 2023 14:26
@FAMarfuaty FAMarfuaty added the changelog: other Needs to be included in the 'Other' category in the changelog label Dec 18, 2023
Comment thread packages/yoastseo/package.json Outdated
"pretest": "grunt get-premium-configuration",
"test": "jest",
"lint": "eslint src",
"lint": "eslint src spec --max-warnings 12",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For now I set the maximum warnings to 12. But it can also be changed later

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm going to lower it to 10, given that we currently have 10 warnings! 👍

@mhkuu mhkuu self-requested a review December 21, 2023 14:07
Copy link
Copy Markdown
Contributor

@mhkuu mhkuu left a comment

Choose a reason for hiding this comment

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

CR: Great stuff, thanks so much @FAMarfuaty 🙌 I really appreciate you taking the time to clean up the package.

@mhkuu mhkuu changed the title 69 fix grunt check warnings in packagesyoastseo Fixes grunt check warnings in yoastseo Dec 21, 2023
@mhkuu
Copy link
Copy Markdown
Contributor

mhkuu commented Dec 21, 2023

ACC: works as advertised, lowered the number of warnings to 10 🎉
The GitHub actions do not pass because of the node version mismatch, I am going to blissfully ignore that for now 😅

@mhkuu mhkuu merged commit 4611e5b into releasing-yoastseo Dec 21, 2023
@mhkuu mhkuu deleted the 69-fix-grunt-check-warnings-in-packagesyoastseo branch December 21, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: other Needs to be included in the 'Other' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants