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

Scripts: Ensure the default Prettier config is used with `lint-js` when needed #20071

Merged
merged 2 commits into from Feb 7, 2020

Conversation

@gziolo
Copy link
Member

gziolo commented Feb 6, 2020

Description

Follow-up for #20036.

wp-scripts lint-js uses the default Prettier settings if no config is provided in the root of the project. It wasn't the case for Gutenberg because it has Prettier config for IDE integration.

This patch adds a fallback for projects who opt-out from defining their own Prettier config and reuses the default one used with wp-scripts format-js

How has this been tested?

I removed ESLint config and Prettier config from the root level of Gutenberg and executed:
npm run lint-js

There were 24 errors reported but they are silenced with the existing ESLint plugin. That confirms that this patch works as intended.

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.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.
@gziolo gziolo requested review from mkaz, jsnajdr and epiqueras Feb 6, 2020
@gziolo gziolo requested review from ajitbohra, nerrad, ntwb and youknowriad as code owners Feb 6, 2020
@gziolo gziolo self-assigned this Feb 6, 2020
packages/scripts/CHANGELOG.md Outdated Show resolved Hide resolved
packages/scripts/config/.eslintrc.js Outdated Show resolved Hide resolved
Co-Authored-By: Enrique Piqueras <epiqueras@users.noreply.github.com>
@gziolo gziolo merged commit c605373 into master Feb 7, 2020
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@gziolo gziolo deleted the fix/wp-scripts-lint-js-prettier branch Feb 7, 2020
@github-actions github-actions bot added this to the Gutenberg 7.5 milestone Feb 7, 2020
chipsnyder added a commit that referenced this pull request Feb 7, 2020
…en needed (#20071)

* Scripts: Ensure the default Prettier config is used with `lint-js` when necessary

* Apply suggestions from code review

Co-Authored-By: Enrique Piqueras <epiqueras@users.noreply.github.com>

Co-authored-by: Enrique Piqueras <epiqueras@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.