Undistraction
Undistraction

Reputation: 43390

Stop Sublime Linter from linting my .erb files

How can I prevent the Sublime Linter package for Sublime Text linting files with an erb extension?

Upvotes: 1

Views: 1757

Answers (2)

anr78
anr78

Reputation: 1318

Linting can be disabled by extension in the current version of SublimeLinter. Check the docs at http://www.sublimelinter.com/en/latest/settings.html#user-settings.

Example: I've chosen to highlight bitbake files with python highlighting, and changed the flake8 linter in Packages/User/SublimeLinter.sublime-settings.

"flake8": {
    "@disable": false,
    "args": [],
    "builtins": "",
    "excludes": ["*/*.bb", "*/*.bbappend"],
    "ignore": "",
    "max-complexity": -1,
    "max-line-length": null,
    "select": ""
},

Upvotes: 2

aanton
aanton

Reputation: 5572

A trick based on changing the syntax associated to ERB files.

  1. Clone the current syntax file of your ERB files. Look for the the .tmLanguage files (i suppose you are using one located in Packages/Rails or Packages/Ruby folders) and copy it to the Packages/User folder. Edit the copied file, look for "name" and change the following line to change the displayed name (pe. User ERB). My advice is rename the file too :)
  2. Change the syntax associated to your ERB files. Map them to the new syntax created.

The new syntax is not mapped into the SublimeLinter settings so the linter will not run.

I have tested the trick and works for me.

Upvotes: 1

Related Questions