Add rxjs-all-subjects-suffixed rule
See original GitHub issueI have another rule addition suggestion:
rxjs-all-subjects-suffixed
(or rxjs-no-unsuffixed-subjects
as per your naming convention), which enforces that subject names must be suffixed with Subject$
(also as per the Finnish notation rule).
e.g.
class Mock {
private property$ = new Rx.Subject<any>();
~~~~~~~~~ [Subject 'property$' must end with 'Subject$']
}
Let me know if this is also of interest to integrate. 😄
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
rxjs-suffix-subjects throws error in console · Issue #88 - GitHub
When run ng lint, this outputs in console for some files, all subjects have required suffix so at the end it succeed, but...
Read more >rxjs-tslint-rules
rxjs -suffix-subjects The rule takes an optional object with optional parameters , properties and variables properties. The properties are booleans and ...
Read more >rxjs-tslint-rules | Yarn - Package Manager
rxjs -no-explicit-generics, Disallows the explicit specification of generic type arguments when calling operators. Rely upon TypeScript's inference instead. None.
Read more >Create custom RxJs Subject - Stack Overflow
I have a need for a QueueSubject , i.e. a Subject that queues all values passed to its next method until there is...
Read more >On The Subject Of Subjects (in RxJS) | by Ben Lesh - Medium
Subjects in RxJS aren't much different. When you call subscribe with an observer on an Rx Subject, it will add that observer to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah. In general, I’m happy to have rules added to the package. They don’t have to conform to my opinions - e.g. I’m not a fan of Finnish notation. My only criteria is that they should do what they’re intended to do in all circumstances - or, at least, with as few exceptions as possible.
When writing your new rule, you might want to have a look at Craig’s
tsquery
package. I favour it over using a walker and I’ve used to for all of my most recent rules, e.g.:Search for
tsquery(
for more examples in this repo.Craig has written about it here.
Also, with this one, I think it’ll be important for the suffix to be configurable - i.e. via an option.
And I’d try to keep the rule name as short as possible. Maybe
rxjs-suffix-subjects
?