elicwhite / ESLint-Formatter

Sublime Text 3 Plugin to Autoformat with Eslint
MIT License
139 stars 20 forks source link

format_on_save #55

Open jerrychen1013 opened 7 years ago

jerrychen1013 commented 7 years ago

v2.3.1 is installed, after setting config: "format_on_save: true", it would only pop out Linter warning and not fixed. But if using hot key, it works perfectly.

My env: OS: Sierra 10.12 Sublime Text 3

Below is the debug message:

SublimeLinter: eslint: Hello.vue ['/Users/user/pwa/node_modules/.bin/eslint', '--format', 'compact', '--stdin', '--stdin-filename', '@'] 
SublimeLinter: eslint output:
/Users/user/pwa/src/components/Hello.vue: line 5, col 13, Error - Expected indentation of 6 spaces but found 8. (indent)

1 problem 

I still can not find out the reason. Has any idea? Thank you

kevinmpowell commented 6 years ago

@jerrychen1013 I believe you'll need to add the following to your ESLint-Formatter.sublime-settings - User file (accessed by Sublime Text > Preferences > Package Settings > ESLintFormatter > Settings menu)

  "format_on_save": true
  "format_on_save_extensions": [
    "js",
    "jsx",
    "es",
    "es6",
    "babel",
    "vue"
  ]
geoidesic commented 5 years ago

I did this and I can see in the console that EsLint is being run... but my file is not being formatted. It formats standard js files fine.. but not vue single file components.

If I run EsLint on the file from the command line it points out the errors just fine, but EsLint-Formatter doesn't apply the format to fix those issues.

skeggse commented 4 years ago

Could this be due to #71?