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

Standardize linting: plugins #32795

Merged
merged 5 commits into from
Apr 29, 2022
Merged

Conversation

psealock
Copy link
Contributor

@psealock psealock commented Apr 27, 2022

All Submissions:

Changes proposed in this Pull Request:

Introduce lint:fix scripts to plugins/woocommerce and plugins/woocommerce-admin. This PR also modifies lint such that the entire project (php and js) get linted.

See here to view changes without whitespace.

In practice this isn't a reasonable thing a person would do. Not only are there massive amounts of violations, but the time required to perform this task renders it rather useless. I'm open to input on this as the motivation is simply to conform to the same linting constructs across the monorepo. In reality, linting files on commits via lint-staged is the more practical approach, which we are doing currently.

Also, this PR changes lint rules from WordPress to WooCommerce via @woocommerce/eslint-plugin.

Partial fixer upper for #32653

How to test the changes in this Pull Request:

  1. pnpm install
  2. cd plugins/woocommerce
  3. pnpm run lint

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Have you created a changelog file by running pnpm nx affected --target=changelog?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@github-actions github-actions bot added focus: react admin plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Apr 27, 2022
@psealock psealock force-pushed the fix/standardize-lint-woocommerce-plugin branch from 58d9e2c to b06b34d Compare April 27, 2022 23:04
@psealock psealock marked this pull request as ready for review April 28, 2022 00:02
@psealock psealock requested review from a team and roykho and removed request for a team April 28, 2022 00:02
@psealock psealock mentioned this pull request Apr 28, 2022
30 tasks
@psealock psealock changed the title Fix/standardize lint woocommerce plugin Standardize linting: plugins Apr 28, 2022
Copy link
Member

@roykho roykho left a comment

Choose a reason for hiding this comment

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

So the only criticism I have is since this is to lint plugins in the monorepo, how come we need to be in plugins/woocommerce to execute this command? Can we move it up a level?

@psealock
Copy link
Contributor Author

So the only criticism I have is since this is to lint plugins in the monorepo, how come we need to be in plugins/woocommerce to execute this command? Can we move it up a level?

Good question. The goal of standardizing these linting scripts is so that the same command can be executed for all projects from root level, ie pnpm nx lint:@woocommerce/components. Of course instead of an NX executor, we'll be doing it with Turbo, so it will need to wait.

Copy link
Member

@roykho roykho left a comment

Choose a reason for hiding this comment

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

LGTM. Works well. Good job.

@roykho roykho merged commit ad0d71d into trunk Apr 29, 2022
@roykho roykho deleted the fix/standardize-lint-woocommerce-plugin branch April 29, 2022 13:01
@github-actions github-actions bot added this to the 6.6.0 milestone Apr 29, 2022
@github-actions
Copy link
Contributor

Hi @roykho, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:

  • Add the release: add testing instructions label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants