admin管理员组文章数量:1312656
I used to use rxjs-tslint-rules
package to be aware of RxJS-related issues in my projects. It was added to devDependencies
section of my projects' package.json
files.
Now, there is rxjs-tslint
package which adds a few more rules specific to RxJS 6 and rxjs-5-to-6-migrate
tool.
After migration, if I still want those
rxjs-collapse-imports
rxjs-pipeable-operators-only
rxjs-no-static-observable-methods
rxjs-proper-imports
rules to be checked by TSLint, do I need to add them to my tslint.json
and rxjs-tslint
package to my devDependencies
? Or rxjs-tslint
package is intended to be a one time migration assistant and rules it currently provides are covered by the bigger rxjs-tslint-rules
package?
I used to use rxjs-tslint-rules
package to be aware of RxJS-related issues in my projects. It was added to devDependencies
section of my projects' package.json
files.
Now, there is rxjs-tslint
package which adds a few more rules specific to RxJS 6 and rxjs-5-to-6-migrate
tool.
After migration, if I still want those
rxjs-collapse-imports
rxjs-pipeable-operators-only
rxjs-no-static-observable-methods
rxjs-proper-imports
rules to be checked by TSLint, do I need to add them to my tslint.json
and rxjs-tslint
package to my devDependencies
? Or rxjs-tslint
package is intended to be a one time migration assistant and rules it currently provides are covered by the bigger rxjs-tslint-rules
package?
1 Answer
Reset to default 12At the moment, rxjs-tslint
is intended to be used as one-time migration mechanism to upgrade a RxJS v5 codebase to v6. Its distribution installs some scripts into node_modules/.bin
to facilitate this.
However, there is nothing to stop you from installing rxjs-tslint
as a devDependency
. If you do, you would also reference it from your tslint.json
file, just as you would with rxjs-tslint-rules
. Like this:
{
"extends": [
"rxjs-tslint",
"rxjs-tslint-rules"
],
"rules": {
}
}
Like rxjs-tslint-rules
, rxjs-tslint
is unopinionated and no rules are enabled by default. So if you want the rules listed in your question to be enabled, you will need to configure them in the file's rules
setting.
I'm the author of rxjs-tslint-rules
and I've had some conversations with the developers of the rxjs-tslint
package. It's likely that, sometime soon, some of the rules from my package will be included in rxjs-tslint
- to represent what's considered to be best practice. Until then - and perhaps afterwards - you can use rules from both packages.
本文标签: javascriptrxjstslint vs rxjstslintrules packagesStack Overflow
版权声明:本文标题:javascript - rxjs-tslint vs rxjs-tslint-rules packages - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741882456a2402826.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论