angular-extensions / lint-rules Goto Github PK
View Code? Open in Web Editor NEWtslint rules useful for angular projects
License: MIT License
tslint rules useful for angular projects
License: MIT License
running ng lint, shows the following error or lack of takeUntil
ERROR: /var/www/html/pwa-vimbo-new/src/@vimbo/directives/vimbo-perfect-scrollbar/vimbo-perfect-scrollbar.directive.ts:176:18 - subscribe within a component must be preceded by takeUntil
but you can see that in the line where the error is being accused, there is a pipe with takeUntil
Angular CLI: 8.3.23
Node: 10.15.3
OS: linux x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker
Package Version
--------------------------------------------------------------------
@angular-devkit/architect 0.803.23
@angular-devkit/build-angular 0.803.23
@angular-devkit/build-optimizer 0.803.20
@angular-devkit/build-webpack 0.803.23
@angular-devkit/core 8.3.23
@angular-devkit/schematics 8.3.23
@angular/cdk 8.2.3
@angular/cli 8.3.23
@angular/flex-layout 8.0.0-beta.27
@angular/material 8.2.3
@angular/material-moment-adapter 8.2.3
@ngtools/webpack 8.3.23
@nguniversal/express-engine 8.2.6
@nguniversal/module-map-ngfactory-loader 8.2.6
@schematics/angular 8.3.23
@schematics/update 0.803.23
rxjs 6.5.4
typescript 3.5.3
webpack 4.39.2
These rules need to be migrated to eslint.
Anyone wants to give a hand?
When the class that subscribes to an Observable extends a base class that handles the ngOnDestroy pattern, and this base class is from an external library, the rule emits a false error.
It works fine if the base class is in the same project
Some might need a reminder by tslint, to remind us in the console that our components or directives should have a ngOnDestroy method when it detects none.
We can add a custom rule to tslint to warn us in the console during linting and building if it finds no ngOnDestroy hook in our components:
Item #6 contains the code:
https://blog.bitsrc.io/6-ways-to-unsubscribe-from-observables-in-angular-ab912819a78f
I'm using a large project where we are use different type of operator in order to unsubscribe from observable.
for example take(1) operator or the Subscription
in this case this lint rules show me error.
I think this package is good but I can't use it as there more then one option for unsubscribe.
I be-live I'm not the only one how want to use it but can't as mention above.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.