refactor(docs-infra): update docs examples tslint.json
to match CLI and fix failures (#38143)
This commit updates the `tslint.json` configuration file, that is used to lint the docs examples, to match the one generated for new Angular CLI apps. There are some minimal differences (marked with `TODO` comments) for things, such as component selector prefix, that would require extensive and/or difficult to validate changes in guides. This commit also includes the final adjustments to make the docs examples code compatible with the new tslint rules. (The bulk of the work has been done in previous commits.) PR Close #38143
This commit is contained in:

committed by
Alex Rickabaugh

parent
42f5770b7b
commit
9c5fc1693a
@ -90,7 +90,7 @@ function compileAndCreate() {
|
||||
* The (almost) same tests for both.
|
||||
* Only change: the way that the first hero is clicked
|
||||
*/
|
||||
function tests(heroClick: Function) {
|
||||
function tests(heroClick: () => void) {
|
||||
|
||||
it('should NOT have heroes before ngOnInit', () => {
|
||||
expect(comp.heroes.length).toBe(0,
|
||||
|
@ -147,7 +147,7 @@ describe('Angular async helper', () => {
|
||||
|
||||
// #docregion async-test-promise-then
|
||||
describe('test jsonp', () => {
|
||||
function jsonp(url: string, callback: Function) {
|
||||
function jsonp(url: string, callback: () => void) {
|
||||
// do a jsonp call which is not zone aware
|
||||
}
|
||||
// need to config __zone_symbol__supportWaitUnResolvedChainedPromise flag
|
||||
|
@ -1,3 +1,4 @@
|
||||
// tslint:disable-next-line: no-namespace
|
||||
declare namespace jasmine {
|
||||
interface Matchers<T> {
|
||||
toHaveText(actual: any, expectationFailOutput?: any): jasmine.CustomMatcher;
|
||||
|
@ -1,3 +1,4 @@
|
||||
// tslint:disable-next-line: no-reference
|
||||
/// <reference path="./jasmine-matchers.d.ts" />
|
||||
|
||||
//// Jasmine Custom Matchers ////
|
||||
|
Reference in New Issue
Block a user