Excluding node_modules in TSLint

March 18, 2019

Personally I think TSLint shouldn't look at anything inside of node_modules by default, however this is not the case out-of-the-box.

For some libraries this can cause an issue, for instance when using Angular, there could be many packages that are being imported into your bundle that do not necessarily follow your custom TSLint rules.

What can you do to fix that? Easy...

Exclude node_modules from TSLint reviewed directories

{
	"linterOptions": {
		"exclude": [
			"node_modules/**"
		]
	},
	"rules": {
		...
	}
}