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

prettier still ignores .eslintrc.js with setting vetur.format.defaultFormatter.js to prettier-eslint #1038

Open
3 tasks done
752 opened this issue Dec 26, 2018 · 3 comments
Open
3 tasks done

Comments

@752
Copy link

752 commented Dec 26, 2018

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: Win
  • Vetur version: 0.14.3
  • VS Code version:1.30.1

Problem

I've seen many issues before, but none of them worked. i just want to formate .vue file based on rules in .eslintrc.js. Can anyone give me a clear answer on how to config?
my current vscode configuration:

  "eslint.run": "onSave",  
  "eslint.validate": ["javascript", "javascriptreact", "vue", "html"],  
  "prettier.eslintIntegration": true,  
  "vetur.format.defaultFormatter.js": "prettier-eslint"  

.eslintrc.js file (generated by vue cli 3.0):

module.exports = {
  root: true,
  env: {
    node: true,
  },
  extends: [
    'plugin:vue/essential',
    '@vue/airbnb',
  ],
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  },
  parserOptions: {
    parser: 'babel-eslint',
  },
};
@deangoku
Copy link

I have the same problem, any solutions?

@octref
Copy link
Member

octref commented Mar 14, 2019

Can you create a repo on GitHub where I can test this?

@SharakPL
Copy link

SharakPL commented Mar 16, 2020

Why there's no option to use eslint as formatter for js and stylelint for css/scss? With VSCode's new settings prettier is not required. One can simply use eslint and stylelint rules for that with

"editor.codeActionsOnSave": {
	"source.fixAll.eslint": true,
	"source.fixAll.stylelint": true,
}

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

No branches or pull requests

4 participants