bcomnes / sublime-standard-format

:sparkles: Runs standard --fix against the javascript in your ST3 window on save or manually.
https://packagecontrol.io/packages/StandardFormat
MIT License
60 stars 21 forks source link

can't disable lint in html file #26

Closed zhea55 closed 9 years ago

zhea55 commented 9 years ago

I like the standard format, it makes my code beautiful

But my html file has some ugly javascripts.

i dont want standard-format to lint that

Can i disable lint in html, just work for js files?

qq 20150604112112

zhea55 commented 9 years ago
{
    "format_on_save": false,

    "PATH": [],

    // array of extensions to format on save
    "extensions": ["js"],

    "excludes": ["html"],

    // Array of command and flags to run against.
    // Content will be piped into this command
    // This is a string array that is passed to subprocess
    "command": ["standard-format", "--stdin"],

    // Pop up error window on formatting errors
    "loud_error": false
}

I add html to excludes, the lint error still there

how to remove these lint errors in html files?

Flet commented 9 years ago

Actually, I think functionality is part of SublimeLinter-contrib-standard

https://github.com/Flet/SublimeLinter-contrib-standard/blob/master/linter.py#L27

Flet commented 9 years ago

That being said, you can exclude all html files this way:

  1. In Sublime, go to Preferences > Package Settings > SublimeLinter > Settings - User (or via command pallate and type sublimelinter settings user)
  2. Find the standard key under linters and add an item to the excludes array:
"standard": {
  "@disable": false,
  "args": [],
  "excludes": ["*.html"]
}

That will ensure no html is linted!

bcomnes commented 9 years ago

:+1: Sounds right @Flet Thanks!

zhea55 commented 9 years ago

@Flet Thanks!!!