Gridsome: Prettier applied to page-query static-query

Created on 8 Nov 2018  路  22Comments  路  Source: gridsome/gridsome

Hi, I'm a big fan of Gridsome.

Prettier has parser 'graphql'.
page-query and static-query is GraphQL syntax.

So I want to format code in page-query and static-query block.

All 22 comments

I see you are working on eslint rules for page-query :) Is it possible to test it locally somehow?

Thanks for the reply!!!

Please give me a moment. I'm almost ready to use my rule for Gridsome馃槉

@hjvedvik
OK.
eslint-plugin-gridsome for guys 馃帀
https://www.npmjs.com/package/eslint-plugin-gridsome

// hoge.vue

<template>
  <div>aaaa</div>
</template>
<script>
const script = 111;
</script>

<page-query>
query Blog {
                    allWordPressPost(limit: 5) {
              edges {
            node {
        id
                title
                }
                  }
      }
            }
</page-query>

<style lang="scss" scoped>
div {
  font-size: 2rem;
  padding: 10px;
}
</style>

yarn eslint --fix hoge.vue

<template>
  <div>aaaa</div>
</template>
<script>
const script = 111;
</script>

<page-query>
query Blog {
  allWordPressPost(limit: 5) {
    edges {
      node {
        id
        title
      }
    }
  }
}
</page-query>

<style lang="scss" scoped>
div {
  font-size: 2rem;
  padding: 10px;
}
</style>

This package is my first original eslint rule.
So,this package include only 1 rule.
page-query rule is format code in <page-query>.
This rule is using prettier.
https://prettier.io/docs/en/options.html#parser

Awesome! Just tested it and it works very well! I really like this plugin and it could be the official ESlint plugin for Gridsome. So you can consider if you want to maintain the repository under the Gridsome organization instead :)

@hjvedvik
I鈥檓 glad to hear that馃槉
I made this ESlint plugin for Gridsome.
Could you transfer this package to gridsome official GitHub repository?
I wanna see gridsome / eslint-plugin-gridsome馃槒

eslint-plugin-gridsome is updated just now!馃帀馃帀馃帀
page-query rule was deleted.
format-query-block rule is fix format <page-query> and<static-query>

@hjvedvik
Please reply 馃槄馃憢

Hi 馃槄 Yes, we can move it to this organization. I'll accept and give you the necessary permissions if you transfer the ownership to gridsome :)

@hjvedvik
OK :)
What can I do to transfer my repository?

I haven't done this much myself, but I think you can follow this guide.

@hjvedvik
Um...
I tryed transfer follow the guide.
The following error message appears.

You don鈥檛 have the permission to create repositories on gridsome

I want the permission

I'll just create a new empty repository and give you access. You should then be able to push all your commits to that repository.

@hjvedvik
The following error message appears.馃槀

gridsome/eslint-plugin-gridsome already exists and You don鈥檛 have the permission to create repositories on gridsome

I've sent you an invite to the repository :) Accept it, edit your remote git address and push to that repository instead. I think that will work.

@hjvedvik
thanks.
I succeeded !! XD
https://github.com/gridsome/eslint-plugin-gridsome

@hjvedvik
How do I setup of Travis CI?
eslint-plugin-gridsome was deployed by Travis CI :(

@hjvedvik
When I had worked in tyankatsu0105/eslint-plugin-gridsome,
eslint-plugin-gridsome was deployed by Travis CI.
Now this npm package is don't deploy by my Travis CI account.
If you invite me to Gridsome organization,I may be able to setup Travis.
Or could you setup Travis CI?

@hjvedvik
I'm sorry, I misunderstood. :(
Please permission level admin of gridsome/eslint-plugin-gridsome for me.
https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/

Will you be able to set up Travis CI again for that repo if you're an admin? I have added my email and a token in Travis. But You might have to add me as collaborators for the package on npm. Not sure how it works :)

Now I add you to npm owner.
https://www.npmjs.com/package/eslint-plugin-gridsome
I suppose Travis is work.
I'm try.

It works! 1.0.1 was just published :)

@hjvedvik
Yeah!!!
Thank you for all your help!!
Let's keep in touch :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SteveEdson picture SteveEdson  路  19Comments

eleijonmarck picture eleijonmarck  路  18Comments

gongph picture gongph  路  42Comments

kai-oswald picture kai-oswald  路  18Comments

stowball picture stowball  路  26Comments