Commit Graph

39 Commits

Author SHA1 Message Date
Kristiyan Kostadinov b6e7174f62 build: add tslint rule to enforce deletion targets (#9881)
Adds a tslint rule that will mark any deletion targets that are due to be deleted.
2018-02-13 07:51:57 -08:00
Juliano c306297b89 build: tslint rule to enforce html tags escaping in comments (#8200) 2018-01-25 16:48:28 -08:00
Rafael Santana 151e58142c docs: ensure jsdocs are properly set (#9390) 2018-01-18 10:41:39 -08:00
Kristiyan Kostadinov 74d906a598 build: add lint rule to prevent binding to class attribute directly (#9289)
Adds a lint rule that prevents us from binding to `[class]` directly.

Fixes #8340.
2018-01-12 09:40:32 -08:00
Kristiyan Kostadinov 55ec5ff36c build: disallow namespace usage and bump stylelint (#9022) 2017-12-22 07:27:12 -08:00
Joey Perrott 1121d53af7 chore: create cdk-experimental package (#9059) 2017-12-19 16:45:54 -08:00
Kristiyan Kostadinov dc045967d8 build: expand validateDecoratorsRule to support blacklisting (#8897)
Expands the decorator validation rule to support blacklisting properties whose values match a pattern. This allows disabling things like inline styles.
2017-12-14 15:33:34 -08:00
Paul Gschwendtner 043ca352e3 build: lint material-experimental package (#8757)
* All custom TSLint rules should check the `material-experimental` package as well.
2017-12-05 15:08:11 -08:00
Jeremy Elbourn ea54edb7ef fix: replace extendObject utility w/ object spread (#7372) 2017-11-20 10:19:37 -08:00
Jeremy Elbourn 262c23b840 chore: add license to demo-app (#8440) 2017-11-14 12:59:25 -08:00
Kristiyan Kostadinov de8c6e2881 fix: import individual rx operators (#8160)
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.
2017-10-31 16:05:10 -07:00
Joey Perrott 473b1dfafd chore: create tslint rule to allow @HostListener and @HostBinding in abstract classes (#8036) 2017-10-27 10:18:36 -07:00
Kristiyan Kostadinov c2c6e04ed6 fix(stepper): switch to OnPush change detection (#7119) 2017-10-04 14:53:55 -07:00
Jeremy Elbourn 2b0315d3a2 feat: add preserveWhitespaces: false to all components (#7115)
Also adds lint check to enforce its presence
2017-09-20 15:58:55 -07:00
Kristiyan Kostadinov d3abd726e2 build: add tslint rule for validating decorators (#6800)
* 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.
2017-09-06 11:13:01 -07:00
Kristiyan Kostadinov 001001cb37 build: custom tslint rules not executing in IDEs (#6817)
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).
2017-09-06 10:12:13 -07:00
Paul Gschwendtner 28ede304fb build: stricter unused variable checking (#6633)
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.
2017-09-01 08:05:46 -07:00
Paul Gschwendtner 6b9c936fe4 build: use minimatch for no-view-encapsulation rule (#6621) 2017-08-24 10:19:39 -07:00
Kristiyan Kostadinov 2fc6a4c782 refactor: turn off view encapsulation for all components (#6563)
Fixes #6037.
2017-08-22 17:44:18 -07:00
Kristiyan Kostadinov 18c668952e build: disallow usage of HostBinding and HostListener (#6307)
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.
2017-08-07 14:24:13 -07:00
Jeremy Elbourn b0db9122c4 chore: block use of public access modifier outside constructors (#6261) 2017-08-04 14:01:30 -07:00
Paul Gschwendtner 991c1e0d90 chore(tslint): use globs for custom rule source file filtering (#6235)
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.
2017-08-04 14:00:29 -07:00
Paul Gschwendtner 4168fb39db build: stop hardcoding rollup globals for CDK entry points (#6150)
* 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.
2017-08-02 14:31:31 -07:00
Kristiyan Kostadinov d9e6f7502a build: add tslint rule to verify rollup globals config (#5963)
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.
2017-07-31 11:13:33 -07:00
Paul Gschwendtner 589dc05149 build: enable no-unused-variable lint rule (#5184)
* 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.
2017-07-07 11:42:52 -07:00
Paul Gschwendtner 58aa0e2c1f chore: enforce whitespace before the opening brace of a block (#5409)
* Enforces whitespace before the opening brace of a block. This makes sure that the code is consistent is everywhere.
2017-06-29 10:31:08 -07:00
Kristiyan Kostadinov f89261eea6 build: add lint rule to prevent rxjs patch imports (#5344)
Adds a rule that will ensure that we don't use patch imports in the library and cdk files.
2017-06-24 05:45:44 -07:00
Paul Gschwendtner d45d37ae20 build: tslint rule to ensure license banners are set (#5133) 2017-06-14 14:16:40 -07:00
Paul Gschwendtner 1328307bb8 build: remove outdated tslint rule (#4121)
* 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).
2017-04-18 09:24:33 -07:00
Paul Gschwendtner a773515c56 build: detect todos in public comments (#4059)
* 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
2017-04-14 13:06:38 -07:00
Paul Gschwendtner f526c9de87 build(tslint): disallow var keyword (#3625)
* Disallows the var-keyboard in the source files. `var` mostly causes issues with variables, and can be safely replaced with `let`.
2017-03-17 11:15:50 -07:00
Paul Gschwendtner 06fd08d822 build: replace forbidden-identifiers with tslint (#3579)
* Replaces the big `forbidden-identifiers` script with TSLint rules.

Closes #2175
2017-03-13 14:26:13 -07:00
Paul Gschwendtner 902edd0213 chore: update tslint to latest version (#2952)
* 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
2017-02-10 02:33:35 +08:00
Jeremy Elbourn fb6e580eab chore: remove ddescribe and iit completely 2016-03-21 17:33:39 -07:00
Jeremy Elbourn f513be83b4 style(): use only leading underscores 2016-03-09 15:51:09 -08:00
d3viant0ne 425db8aef5 build(linting): execute tslint in travis
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
2016-03-09 13:50:32 -08:00
Hans Larsen cd5be81a50 fix(): fix a lot of dartanalyzer errors (not all). 2016-02-09 12:03:33 -08:00
Jeremy Elbourn 9dcb2bc50f chore(): remove triple-equals lint rule & make some lint fixes to karma
config.
2016-01-20 17:34:45 -08:00
Jeremy Elbourn 63d27a31e5 chore(): add tslint.json 2016-01-19 10:52:04 -08:00