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

Run Prettier for JS files #16338

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
dist
target
/.node_binaries
/.github

/build
/data
/docs
/optimize
/plugins
/scripts
/style_guides
/tasks
/test
/ui_framework
/utilities
/webpackShims
/Gruntfile.js

/packages/eslint-config-kibana
/packages/eslint-plugin-kibana-custom
/packages/kbn-build

/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/optimize
/src/plugin_discovery
/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/metrics
/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
/src/core_plugins/vega

5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "es5"
}

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
],
"scripts": {
"kbn": "node scripts/kbn",
"prettier": "prettier --write '**/*.js'",
"test": "grunt test",
"test:dev": "grunt test:dev",
"test:quick": "grunt test:quick",
Expand Down Expand Up @@ -291,6 +292,7 @@
"nock": "8.0.0",
"node-sass": "4.5.3",
"pixelmatch": "4.0.2",
"prettier": "^1.10.2",
"proxyquire": "1.7.10",
"sass-loader": "6.0.6",
"simple-git": "1.37.0",
Expand Down
8 changes: 8 additions & 0 deletions tasks/config/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ module.exports = function (grunt) {
]
},

prettier: {
cmd: 'node_modules/.bin/prettier',
args: [
'--list-different',
'**/*.js',
]
},

testServer: {
options: {
wait: false,
Expand Down
1 change: 1 addition & 0 deletions tasks/jenkins.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = function (grunt) {
'rejectRejFiles',

'run:eslint',
'run:prettier',
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

ah, i see #16339

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Yeah, that was just to keep the PR clean as we squash commit this stuff.

'licenses',
'test:server',
'test:jest',
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9083,6 +9083,10 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"

prettier@^1.10.2:
version "1.10.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.2.tgz#1af8356d1842276a99a5b5529c82dd9e9ad3cc93"

pretty-bytes@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
Expand Down