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

Using prettier-eslint-cli #42

Closed
mightyguava opened this issue Aug 16, 2017 · 17 comments
Closed

Using prettier-eslint-cli #42

mightyguava opened this issue Aug 16, 2017 · 17 comments

Comments

@mightyguava
Copy link

Can this be configured to use https://github.com/prettier/prettier-eslint-cli? We have some eslint rules that are incompatible with prettier that work great with the alternate CLI. It's also a great tool as we try to migrate to prettier without completely turning off eslint

@mitermayer
Copy link
Member

@mightyguava thanks for submitting this issue,

In the past we had also been requested to add support for other CLI's (prettier-standard-formatter (#20))

So maybe now it make sense to revisit this and enable it to be configurable for other CLI's.

cc @alex-shamshurin

@mitermayer
Copy link
Member

Still interested on working in this issue, will prioritize bumping vim-prettier to support the new prettier 1.6 features then get back to this issue

@mitermayer mitermayer added this to Backlog in vim-prettier 1.0 Sep 17, 2017
@dedoyle
Copy link

dedoyle commented Nov 15, 2017

can I use prettier-eslint-cli by this config
let g:prettier#config#config_precedence = 'prettier-eslint'

@mitermayer
Copy link
Member

Hi @dedoyle,

The configPrecedence option is basicly what prettier gives to use:

so if you do on the CLI prettier --help you can get more information on the available options:

  --config-precedence <cli-override|file-override|prefer-file>
                           Define in which order config files and CLI options should be evaluated.
                           Defaults to cli-override.

To answer your question, 'prettier-eslint' is not a valid option

@dedoyle
Copy link

dedoyle commented Nov 16, 2017

I'm looking forward to you to complete this issue. Atom has a prettier-atom, and I had tried it. It feels great. But I still hope I can do it in vim, do not want to leave vim to atom. Thank you very much for vim-prettier.

@mitermayer
Copy link
Member

Hi @dedoyle,

vim-prettier supports prettier custom configuration files (https://prettier.io/docs/en/configuration.html#basic-configuration) have thought about creating a prettier.config.js with the settings required for your project ? you could even add one of those to your home directory.

example of one (https://github.com/facebook/draft-js/blob/master/prettier.config.js):

module.exports = {
  singleQuote: true,
  trailingComma: 'all',
  bracketSpacing: false,
  jsxBracketSameLine: true,
  parser: 'flow',
};

@dedoyle
Copy link

dedoyle commented Nov 17, 2017

prettier doesn't have some config like space-before-function-paren. how to fix it

image

after prettier
image

image

@alex-shamshurin
Copy link

alex-shamshurin commented Jan 4, 2018

@dedoyle This is one reason as far as know to use prettier-eslint

Any plans to support prettier-eslint-cli?

@mitermayer
Copy link
Member

Hi @alex-shamshurin ,

It is on our roadmap for 1.0 release https://github.com/prettier/vim-prettier/projects/1, still trying to find time to action on it.

Before starting adding support for other CLI's I want to setup the automated testing infrastructure for vim-prettier to make sure no regressions will be introduce during the refactor. But hopeful to get into that soon!

@alex-shamshurin
Copy link

Hi, is there any update?

@mitermayer
Copy link
Member

Do people still think its worth integrating with other CLI's ? or is the prettier configuration settings via .prettierrc enough these days ?

@dedoyle
Copy link

dedoyle commented Jun 4, 2018

It will be great to support prettier-eslint-cli

@docwhat
Copy link
Contributor

docwhat commented Jun 5, 2018

I don't think you can get the functionality of prettier-eslint-cli from just a .prettierrc file. I'd love to be proven wrong though.

@alex-shamshurin
Copy link

If some option, like 'use_eslint_fix' is set then it should read one of eslint config files and run eslint --fix after prettier.

@docwhat
Copy link
Contributor

docwhat commented Jun 6, 2018

If some option, like 'use_eslint_fix' is set then it should read one of eslint config files and run eslint --fix after prettier.

Are you saying such an option exists and that it is the same as prettier-eslint?

Or that it would be good if such an option exists?

@Industrial
Copy link

It should not be limited to ESLint only (I use csslint as well and it acts on different file extensions), and instead should be configurable.

I think having a situation where the tools to be ran on which file-type much like lint-staged is preferrable; #148

@mitermayer
Copy link
Member

This is same as #148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

6 participants