Vim-prettier: Using prettier-eslint-cli

Created on 16 Aug 2017  路  17Comments  路  Source: prettier/vim-prettier

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

enhancement

Most helpful comment

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

All 17 comments

@mightyguava thanks for submitting this issue,

In the past we had also been requested to add support for other CLI's (prettier-standard-formatter (https://github.com/prettier/vim-prettier/issues/20))

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

cc @alex-shamshurin

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

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

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

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.

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',
};

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

image

after prettier
image

image

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

Any plans to support prettier-eslint-cli?

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!

Hi, is there any update?

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

It will be great to support prettier-eslint-cli

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.

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

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?

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; https://github.com/prettier/vim-prettier/issues/148

Was this page helpful?
0 / 5 - 0 ratings

Related issues

christopherball picture christopherball  路  4Comments

andreiglingeanu picture andreiglingeanu  路  12Comments

Luobata picture Luobata  路  7Comments

rkulla picture rkulla  路  3Comments

mitermayer picture mitermayer  路  8Comments