Expands the decorator validation rule to support blacklisting properties whose values match a pattern. This allows disabling things like inline styles.
After the switch to lettable operators, we had started importing all operators via `rxjs/operators`. These changes switch us back to only importing the individual ones and add some linting so it doesn't happen in the future.
* Reworks the `noViewEncapsulationRule` to turn into a more generic rule that allows us to validate multiple properties and decorators.
* Fixes a few components that were caught without a `moduleId` after implementing the new rule.
* Adds validation that all components have a `moduleId`.
Fixes#6778.
Fixes our custom tslint rules not executing IDEs, because they're written in TypeScript. This is the preferred option over switching them back to ES6, because some rules require access to TS files from other parts of the build (e.g. the Rollup globals rule).
Currently only variables that don't start with an underscore will be checked by TSLint.
This doesn't make sense, because variables get prefixed with an underscore to indicate that they are not part of the public API, but still need to be public in favor of AOT compilation for example. This means that those properties are having the public modifier set (explicitly or automatically) and therefore won't be treated as unused anyway.
**TL;DR**: With this change, prefixed variables will be checked by the `no-unused-variable` TSLint rule and those which are marked as `private` and are unused will be catched by TSLint.
Adds the `HostBinding` and `HostListener` decorators to the banned symbols list for consistency's sake. Refactors the handful of places that were using them.
Relates to #6304.
A few custom TSLint rules already accept an option array that can be used to whitelist specific files. These whitelists are based on normal Regular Expressions which do not work very well for path matching.
This commit changes the existing whitelists to use minimatch, which is a package that allows matching strings/paths against globs. For rules like `requireLicenseBanner` where the whitelist is hardcoded right now, the whitelist has been introduced as well.
* Now the rollup globals for the CDK secondary entry-points are no longer hard-coded. There is already a method called `getSecondaryEntryPointsForPackage` which can be used.
Adds a custom tslint rule that ensures that we've added all of the necessary external modules to the Rollup config. This is helpful, because forgetting to add a module will log a warning, but it won't break the build necessarily, which is why we occasionally need PRs like #5930.
* Now TSLint starts reporting unused variables again (Rule has been un-deprecated and now uses the type checker
* In favor of linting the whole project the tsconfig file inside of `src/` needs to live in the project root.
* At some point in tslint the `no-unused-variable` rule has been deprecated in favor of `noUnusedLocals` and `noUnusedParameters`. Since we don't want to have compilation errors for unused variables we re-implemented the `no-unused-variable` rule ourself and used it as a custom rule.
* Recently we switched to a newer version of TSLint and TypeScript and the custom tslint rule won't ever work again. (tslint now requires a type-checker to be enabled). The custom rule fails currently and causes TSLint to not work with some editors (e.g Webstorm).
* build: detect todos in public comments
* Creates a naive rule that checks all multi-line comments and reports failures once it detects TODOs inside of it.
* This means that TODOs always need to placed inside of single-line comments.
Fixes#4026
* chore: update tslint
* Updates TSLint to the latest version.
* Due to some breaking changes we had to temporary disable the `no-inferrable-types` rule. Need to revisit once https://github.com/palantir/tslint/issues/2158 is addressed.
References #2175
* Use custom tslint rule
execute tslint in travis ci build
- uses npm script until ng lint task is stable
- lints only the typescript in the src directory
- executes in before_script section of travis.yml to fail fast
chore(tslint): update no-unused-variable tslint rule
modify the no-unused-variable tslint rule to ignore
- ddescribe
- iit
style(button): resolves basic tslint errors
resolve the following tslint violations
- max-line-length
- whitespace
style(card): resolves basic tslint errors
resolve the following tslint violations
- max-line-length
style(progress-circle): resolves basic tslint errors
resolve the following tslint violations
- max-line-length
- whitespace
- eofline
- semicolon
style(sidenav): resolves basic tslint errors
resolve the following tslint violations
- no-inferrable-types
- max-line-length
- whitespace
- eofline
- semicolon
style(annotations): resolves basic tslint errors
resolve the following tslint violations
- semicolon
style(demo-app): resolves basic tslint errors
resolve the following tslint violations
- eofline
style(directives): resolves basic tslint errors
resolve the following tslint violations
- quotemark
style(sidenav): resolves unused variable tslint errors
remove the following unused imports
- Predicate
- PromiseWrapper
- TimerWrapper
remove the following unused variable
- let openPromise: Promise<void>
ignore rule no-unused-variable on the following functions
- closeModalSidenav_()
- isShowingBackdrop_()
- getMarginLeft_()
- getMarginRight_()
- getPositionLeft_()
- getPositionRight_()
style(progress-circle): resolves unused variable tslint errors
remove the following unused imports
- Attribute
- ElementRef
- ViewEncapsulation
style(button): resolves unused variable tslint errors
remove the following unused imports
- ComponentFixture
- beforeEachProviders
- provide
- DebugElement
- AsyncTestFn
ignore rule no-unused-variable on the following function
- testAsync()
style(one-of): resolves variable-name tslint errors
rename OneOf to oneOf (camelCase) in following files
- progress_circle.ts
- sidenav.ts
- one-of.ts
- dir.ts
style(test_injector): resolves variable tslint errors
remove the following unused import
- ExceptionHandler
ignore rule variable-name on the following variables
- _testInjector
- _providers
- _injector
- _instantiated
style(main): resolves variable tslint errors
remove the following unused imports
- HashLocationStrategy
- LocationStrategy
- provide
build(linting): update tslint version
Update to 3.5.0 to make user of ignore patterns
style(sidenav): remove individual tslint rule ignore statements
- remove all individual ignore statements for no-unused-variable on private class members
- add regex to no-unused-variable ignore-pattern
style(sidenav.spec): modify line break
- break after toEqual to improve readability
style(test_injector): resolves variable tslint errors
rename var to let
remove all individual ignore statements for variable-name
move _ to end of private var name
rename testInjector to testInjectorCache
- resolves no-shadowed-variable error in setBaseTestProviders()
- resolves no-shadowed-variable error in resetBaseTestProviders()
style(button.spec): remove unused testAsync function
- remove unused testAsync function
- remove now unused module imports
style(karma-test-shim): increase jasmine default timeout
increase jasmine.DEFAULT_TIMEOUT_INTERVAL from 2000 to 4000ms.
- Temporary resolution of Async callback timeouts in tests
style(button): fix whitespace
resolve whitespace issue in setClassList()
style(one-of): modified case of OneOf
- Fixed case for OneOf dec. factory
- Modified export in one-of.ts
Closes#134