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

How to use ESLint Fixer in .vue:script #2026

Closed
ccforeverd opened this issue Jan 26, 2018 · 4 comments
Closed

How to use ESLint Fixer in .vue:script #2026

ccforeverd opened this issue Jan 26, 2018 · 4 comments
Assignees
Milestone

Comments

@ccforeverd
Copy link

require("js-beautify")(text, options)

I have my javascript files beautified with atom-beautify by engine ESLint Fixer, and also want to beautify the script tag in vue template files with ESLint Fixer to make the same javascript format.

How can I use? It's there some simple way?

Sorry to disturb you!

PS. I'm poor in English...

@stevenzeck
Copy link
Contributor

Can you provide sample code of what it looks like preformatted and what you expect?

@range3
Copy link
Contributor

range3 commented Feb 5, 2018

Hi, I can use ESLint Fixer engine in my .vue files so far, but in an ad hoc way...

  1. Install eslint-plugin-vue to make .vue files eslintable
  2. Configure atom-beautify.js.default_beautifier = "ESLint Fixer"
  3. Open your .vue file and exec atom-beautify:beautify-language-javascript using Atom command palette

configure keymap.cson if you want

# beautify
'atom-text-editor':
  'ctrl-i': 'atom-beautify:beautify-editor'

# force use ESLint Fixer engine provided atom-beautify for js in .vue files
"atom-text-editor[data-grammar='text html vue']":
  'ctrl-i': 'atom-beautify:beautify-language-javascript'

@range3
Copy link
Contributor

range3 commented Feb 6, 2018

I created a pull request to add an option:

"*":
  "atom-beautify":
    vue:
      default_beautifier: "ESLint Fixer"

Could you please review this PR ? 😊

@Glavin001
Copy link
Owner

Published to v0.32.0

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