Skip to content

Instantly share code, notes, and snippets.

@julianpoemp
Created February 17, 2019 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julianpoemp/24651452280d247db62d2101bb33bab8 to your computer and use it in GitHub Desktop.
Save julianpoemp/24651452280d247db62d2101bb33bab8 to your computer and use it in GitHub Desktop.
Allow leading underscores in tslint.config. Very helpful for WebStorm/PHPStorm users.

How to allow leading underscores in tslint.config

Add the following rule at the end of your tslint.config. If it does already exist, change it :)

"variable-name": [
true,
"allow-leading-underscore"
]

Why?

Because the new tslint.config created e.g. by angular/cli does not allow underscores. Some IDEs like WebStorm or PHPStorm change the variable names automatically when creating getter/setters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment