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 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 added [Type] Bug An existing feature does not function as intended [Package] Scripts /packages/scripts labels 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
@gziolo gziolo deleted the fix/wp-scripts-lint-js-prettier branch February 7, 2020 06:32
@github-actions github-actions bot added this to the Gutenberg 7.5 milestone Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Scripts /packages/scripts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants