Skip to content

Fix prettier throw rule error #26071

Merged
mistic merged 1 commit intoelastic:masterfrom
mistic:fix-prettier-rule-throw-error
Nov 23, 2018
Merged

Fix prettier throw rule error #26071
mistic merged 1 commit intoelastic:masterfrom
mistic:fix-prettier-rule-throw-error

Conversation

@mistic
Copy link
Copy Markdown
Contributor

@mistic mistic commented Nov 22, 2018

This is a small PR in order to fix an error I'm watching a lot of times when merging with last master and running the pre-commit hook. The output of the error is the following:

The 'prettier' rule threw an error in '/Users/tiagocosta/elastic/kibana/x-pack/plugins/spaces/public/views/management/edit_space/space_identifier.tsx':
Error: Comment location overlaps with node location
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9525:11)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at decorateComment (/Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9499:7)
    at /Users/tiagocosta/elastic/kibana/node_modules/prettier/index.js:9566:5

This is happening due to a known bug on prettier and this PR solved the line that is causing the problem without changing the behaviour and the logic of it.

PS: I have also ran node scripts/tslint --fix over this file to fix a lot of errors that appear on it, after I solved the prettier problem.

@mistic mistic added review Team:Operations Kibana-Operations Team v7.0.0 v6.6.0 Feature:Security/Spaces Platform Security - Spaces feature labels Nov 22, 2018
@mistic mistic requested review from kobelb and spalger November 22, 2018 07:18
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-operations

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Copy link
Copy Markdown
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

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

I'm not sure which part of this fixes something, but I think this looks good to me.

@mistic
Copy link
Copy Markdown
Contributor Author

mistic commented Nov 22, 2018

@spalger this solution for the issue is being discussed here 😃

prettier/prettier#2347 (comment)

@mistic
Copy link
Copy Markdown
Contributor Author

mistic commented Nov 23, 2018

6.x: 696a4de

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Security/Spaces Platform Security - Spaces feature review Team:Operations Kibana-Operations Team v6.6.0 v7.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants