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

Better explanation about the Prettier recommendation (extension vs. NPM module) #50629

Merged

Conversation

afharo
Copy link
Member

@afharo afharo commented Nov 14, 2019

Summary

After the discussion in the Slack channel, extending the explanation about the Prettier recommendation in the contributing guidelines.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@afharo afharo added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes v7.5.0 backport:skip This commit does not require backporting labels Nov 14, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@afharo afharo added the review label Nov 14, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@afharo afharo added v8.0.0 and removed v7.5.0 labels Nov 14, 2019
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated
@@ -325,7 +325,7 @@ Note that for VSCode, to enable "live" linting of TypeScript (and other) file ty
"eslint.autoFixOnSave": true,
```

It is **not** recommended to use `prettier` plugin on Kibana project. Because settings are in `eslintrc.js` file and it is applied to too many files that shouldn't be prettier-ized.
:warning: It is **not** recommended to use the [`Prettier` extension/IDE plugin](https://prettier.io/) while maintaining the Kibana project. Formatting and styling roles are set in the multiple `.eslintrc.js` files across the project and some of them use the [NPM version of Prettier](https://www.npmjs.com/package/prettier). Using the IDE extension might cause conflicts, applying the formatting to too many files that shouldn't be prettier-ized.
Copy link
Member

Choose a reason for hiding this comment

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

Since I actually DO have Prettier enabled, and I've not noticed a problem, AND I'm pretty sure I've seen valid vscode errors labeled as coming from Prettier, that it's all that bad to have Prettier enabled. Also, especially since I don't believe I've run into a case where Prettier did it's thing when it shouldn't have.

I think it's worth keeping this in as a note though, since this seems to be common lore at this point, and I've not done any kind of exhaustive test on it. Definitely good to have some rationale as to why this is a warning, which we didn't have before.

Copy link
Member Author

@afharo afharo Nov 15, 2019

Choose a reason for hiding this comment

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

@pmuellr Thank you for your input, your experience with the plugin is very helpful. I've added the valid errors (yet Prettier highlighting them as wrong) to the line.

Copy link
Contributor

Choose a reason for hiding this comment

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

In some part of the code, I had linting issues between what prettier generates and what eslint expects. I think it's not everywhere, but regarding anonymous functions, prettier and eslint had different spacing rules in some folders:

eslint:

const a = function () {}

prettier

const a = function() {}

So I actually had to change my intellij watcher from prettier to eslint

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM, but think the :warning: thing should be changed to different markdown, unless that text is some special markdown thing I'm unaware of.

Sorry, should have left my comments under the review, somehow hit the wrong button on the first one though.

@pmuellr
Copy link
Member

pmuellr commented Nov 14, 2019

Should probably wait for another review before merging ... we've been requiring two reviews for Kibana Stack Services PRs, somehow now only one review seems like it's not enough. :-)

@afharo afharo added backport v7.4.3 v7.5.0 v7.6.0 and removed backport:skip This commit does not require backporting v7.4.3 v7.5.0 labels Nov 15, 2019
@afharo
Copy link
Member Author

afharo commented Nov 15, 2019

Following @pmuellr recommendations, added the backport label

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@afharo afharo requested a review from pmuellr November 15, 2019 16:00
@afharo afharo added the v7.5.1 label Nov 15, 2019
Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM

@afharo afharo merged commit 3026912 into elastic:master Nov 18, 2019
@afharo afharo deleted the contributing-prettier-use-recommendation branch November 18, 2019 16:04
afharo added a commit to afharo/kibana that referenced this pull request Nov 18, 2019
…PM module) (elastic#50629)

* Better explanation about the Prettier recommendation (extension vs. NPM module)

* Contributing docs: Add side effect from using the Prettier extension
afharo added a commit that referenced this pull request Nov 18, 2019
…PM module) (#50629) (#50936)

* Better explanation about the Prettier recommendation (extension vs. NPM module)

* Contributing docs: Add side effect from using the Prettier extension
jloleysens added a commit to jloleysens/kibana that referenced this pull request Nov 18, 2019
…-fallback

* 'master' of github.com:elastic/kibana: (116 commits)
  [Maps] move apply global filter settting from layer to source (elastic#50523)
  [SIEM] Fix: Empty `Source` / `Destination` shown when only ports are populated (elastic#50843)
  [Maps] Delay vector tile layer syncing until spritesheet is loaded (elastic#48955)
  [Maps] prevent users from overflowing URL when filtering by shape (elastic#50747)
  [DOCS] Mark Beats central management as discontinued (elastic#49423)
  [page_objects/common_page] convert to ts (elastic#50771)
  [NP Kibana Migrations ] kibana plugin home (elastic#50444)
  [DOCS] Shareables naming convention (elastic#50497)
  [ML] DF Analytics - auto-populate model_memory_limit (elastic#50714)
  Increase alerting test stability and reduce flakiness (elastic#50246)
  [ML] Remaning new_job_new folder (elastic#50917)
  [Telemetry] Show opt-in changes for OSS users (elastic#50831)
  [ML] Fix lat_long anomalies table links menu and value formatting (elastic#50916)
  [Dev] Fix serialising a really big string (elastic#50915)
  Better explanation about the Prettier recommendation (extension vs. NPM module) (elastic#50629)
  [Monitoring] Use a basic monitoring user for tests (elastic#47865)
  [Monitoring] Gracefully handle issue with filebeat indices (elastic#48929)
  [Monitoring] Improve permissions required around setup mode (elastic#50421)
  Additional validation for elasticsearch username (elastic#48247)
  Revert changes to use_kibana_ui_setting (elastic#50877)
  ...

# Conflicts:
#	src/legacy/core_plugins/console/server/request.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release_note:skip Skip the PR/issue when compiling release notes review Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.5.1 v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants