-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Add opt-in prettier #15106
Add opt-in prettier #15106
Changes from 2 commits
a4eaf9f
0f9ffb0
8fbb538
a3938b7
13d64de
95790f2
b093d13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
node_modules | ||
.git | ||
package.json | ||
|
||
/bin/* | ||
/config/* | ||
/data/* | ||
/docs/* | ||
/optimize/* | ||
/packages/* | ||
/plugins/* | ||
/scripts/* | ||
/style_guides/* | ||
/tasks/* | ||
/test/* | ||
/ui_framework/* | ||
/utilities/* | ||
/webpackShims/* | ||
/GruntFile.js | ||
|
||
/src/babel-preset/* | ||
/src/babel-register/* | ||
/src/cli/* | ||
/src/cli_keystore/* | ||
/src/cli_plugin/* | ||
/src/deprecation/* | ||
/src/dev/* | ||
/src/docs/* | ||
/src/es_archiver/* | ||
/src/fixtures/* | ||
/src/functional_test_runner/* | ||
/src/jest/* | ||
/src/optimize/* | ||
/src/server/* | ||
/src/test_utils/* | ||
/src/ui/* | ||
/src/utils/* | ||
|
||
/src/core_plugins/console/* | ||
/src/core_plugins/dev_mode/* | ||
/src/core_plugins/elasticsearch/* | ||
/src/core_plugins/input_control_vis/* | ||
/src/core_plugins/kbn_doc_views/* | ||
/src/core_plugins/kbn_vislib_vis_types/* | ||
/src/core_plugins/kibana/* | ||
/src/core_plugins/markdown_vis/* | ||
/src/core_plugins/metric_vis/* | ||
/src/core_plugins/region_map/* | ||
/src/core_plugins/spy_modes/* | ||
/src/core_plugins/state_session_storage_redirect/* | ||
/src/core_plugins/status_page/* | ||
/src/core_plugins/table_vis/* | ||
/src/core_plugins/tagcloud/* | ||
/src/core_plugins/testbed/* | ||
/src/core_plugins/tests_bundle/* | ||
/src/core_plugins/tile_map/* | ||
/src/core_plugins/timelion/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"semi": true | ||
} |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,15 +1,8 @@ | ||||
{ | ||||
"name": "kibana", | ||||
"description": "Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elasticsearch.", | ||||
"keywords": [ | ||||
"kibana", | ||||
"elasticsearch", | ||||
"logstash", | ||||
"analytics", | ||||
"visualizations", | ||||
"dashboards", | ||||
"dashboarding" | ||||
], | ||||
"description": | ||||
"Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elasticsearch.", | ||||
"keywords": ["kibana", "elasticsearch", "logstash", "analytics", "visualizations", "dashboards", "dashboarding"], | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: revert these changes ^? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heh yea sorry, this was prettier running on the file before I added it to the ignore list lol |
||||
"private": false, | ||||
"version": "7.0.0-alpha1", | ||||
"branch": "master", | ||||
|
@@ -21,6 +14,10 @@ | |||
"bugs": { | ||||
"url": "http://github.com/elastic/kibana/issues" | ||||
}, | ||||
"pre-commit": ["pre-commit"], | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kibana already has a precommit setup that's triggered a bit further down in this file: Line 57 in b31f736
It ends up running this file: https://github.com/elastic/kibana/blob/master/src/dev/run_precommit_hook.js I think we should probably add this prettier setup there so we don't have multiple precommit setups (That might mean that we should create a cc @spalger, who knows all about this setup There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This I did intentionally so as we finish the migration the mass of stuff needed for eslint could be removed in favor of something simpler and also the generally accepted community recommended setup for prettier. However if this is not desired here I’m happy to change that attack plan. @spalger ? |
||||
"lint-staged": { | ||||
"*.js": ["prettier --write", "git add"] | ||||
}, | ||||
"license": "Apache-2.0", | ||||
"author": "Rashid Khan <rashid.khan@elastic.co>", | ||||
"contributors": [ | ||||
|
@@ -54,6 +51,7 @@ | |||
"build": "grunt build", | ||||
"release": "grunt release", | ||||
"start": "sh ./bin/kibana --dev", | ||||
"prettier": "./node_modules/prettier/bin/prettier.js \"./**/*.js\" --write", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you have
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct me if I’m wrong, but if someone has another version installed globally, won’t it use the global version first if you do that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will use the local first, then the global if no local exists. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gtk thanks! |
||||
"precommit": "node scripts/precommit_hook", | ||||
"karma": "karma start", | ||||
"elasticsearch": "grunt esvm:dev:keepalive", | ||||
|
@@ -62,6 +60,7 @@ | |||
"makelogs": "echo 'use `node scripts/makelogs`' && false", | ||||
"mocha": "echo 'use `node scripts/mocha`' && false", | ||||
"sterilize": "grunt sterilize", | ||||
"pre-commit": "lint-staged", | ||||
"uiFramework:start": "grunt uiFramework:start", | ||||
"uiFramework:build": "grunt uiFramework:build", | ||||
"uiFramework:createComponent": "yo ./ui_framework/generator-kui/app/component.js", | ||||
|
@@ -215,6 +214,8 @@ | |||
"yauzl": "2.7.0" | ||||
}, | ||||
"devDependencies": { | ||||
"lint-staged": "5.0.0", | ||||
"prettier": "1.8.2", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw, if you use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bah! I thought yarn did this even if you pasted in once you installed it. NPM used to right? Idk oh well yea that needs to be correctly sorted. |
||||
"@elastic/eslint-config-kibana": "0.14.0", | ||||
"@elastic/eslint-import-resolver-kibana": "0.9.0", | ||||
"@elastic/eslint-plugin-kibana-custom": "1.1.0", | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just go with the defaults here? (#14810 (comment))
However, I'm +1 on having the
.prettierrc
though, even if it just becomesfor now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah cool, yea I missed that comment.