Modular TSLint Configuration
Each module defines rules that are meant to be reasonable defaults and best practices, but you can easily extend or override any of the rules to suit your needs.
- eslint-config-modular - Modular ESLint configuration
npm install tslint tslint-modular --save-dev
Configuration presets are designed to work with the
extends feature of
tslint.yaml files. You can learn more about
configuration presets on the official TSLint website.
tslint-modular in your project, create a
tslint.yaml file with the following contents:
extends: # These modules would be good for a library that runs in Node.js and web browsers - tslint-modular/best-practices - tslint-modular/style - tslint-modular/node - tslint-modular/browser rules: # You can override or extend the rules here
tslint-modular includes the following modules. Mix-and-match them as applicable to your project.
Contains rules that prevent accidental bugs, insecure code, and bad coding practices. You can use this module directly, or use any/all of its sub-modules.
Prevents syntax that is likely to lead to accidental bugs or runtime errors. Examples include not duplicate variables, and using
=== instead of
== for comparisons. Most of the rules in this file will raise an error if violated, but some less-severe ones will only raise warnings.
Bans bad practices for web-based code, such as the
alert() statement and the jQuery global.
Contains code-styling and consistency rules. You can use this module directly, or use any/all of its sub-modules.
it.only() calls that may have accidentally been left in your test code.
Note: We recommend that you create a separate
tslint.yamlfile in your test folder. That way, it can use different modules and rules than the rest of your codebase.
Big Thanks To
Thanks to these awesome companies for their support of Open Source developers ❤