ESLint-Formatter icon indicating copy to clipboard operation
ESLint-Formatter copied to clipboard

format_on_save

Open jerrychen1013 opened this issue 8 years ago • 3 comments

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

jerrychen1013 avatar Oct 10 '17 16:10 jerrychen1013

@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"
  ]

kevinmpowell avatar May 02 '18 21:05 kevinmpowell

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.

geoidesic avatar Jul 13 '19 20:07 geoidesic

Could this be due to #71?

skeggse avatar May 19 '20 19:05 skeggse