Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to enable immutability rules only in certain files? #25

Closed
MichaelTontchev opened this issue May 6, 2017 · 2 comments
Closed
Labels

Comments

@MichaelTontchev
Copy link

I'm fine with most of my interfaces allowing mutation - I just want my Redux state definition to enforce recursive mutability. Can the reaonly interface rule be turned on only in that file?

@jonaskello
Copy link
Owner

jonaskello commented May 7, 2017

Yes, there are several ways to run tslint rules for only a specific set of files.

The CLI version of tslint has this syntax:

tslint [options] [file ...]

So you can just specify the files you want it to run for. For example in a package.json script.

Another way is to have nested tslint.json files. Say that you have one tslint.json in the root that contains your normal rules, and then you put another tslint.json in the subfolder that contains your Redux interface declarations that has the extra readonly rules. Then that tslint.json overrides the one on the root level. So you can run tslint once and get different rules in different folders.

@jonaskello
Copy link
Owner

I'm closing this now as it is answered but feel free to re-open should there be follow up questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants