Skip to content

Commit

Permalink
docs(docs-infra): enable tslint (angular#58961)
Browse files Browse the repository at this point in the history
PR Close angular#58961
  • Loading branch information
JeanMeche authored and alxhub committed Dec 6, 2024
1 parent fe40143 commit f15ccb9
Show file tree
Hide file tree
Showing 93 changed files with 620 additions and 92 deletions.
8 changes: 8 additions & 0 deletions adev/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

Expand Down
9 changes: 9 additions & 0 deletions adev/scripts/update-cli-help/index.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

//tslint:disable:no-console
import {execSync} from 'node:child_process';
import {readFile, writeFile, readdir, mkdtemp, realpath, copyFile, unlink} from 'node:fs/promises';
import {tmpdir} from 'node:os';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {ComponentFixture, TestBed} from '@angular/core/testing';

import {STORAGE_KEY_PREFIX, TopLevelBannerComponent} from './top-level-banner.component';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {ChangeDetectionStrategy, Component, inject, input, OnInit, signal} from '@angular/core';
import {ExternalLink} from '../../directives';
import {LOCAL_STORAGE} from '../../providers';
Expand Down
8 changes: 8 additions & 0 deletions adev/shared-docs/pipeline/api-gen/extraction/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {readFileSync, writeFileSync} from 'fs';
import path from 'path';
// @ts-ignore This compiles fine, but Webstorm doesn't like the ESM import in a CJS context.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

export class Version {
constructor(public sha: string = '') {}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

// @ts-ignore Intentionally nonexistent path for testing purposes.
import {Version} from '@angular/dummy-package';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

// @ts-ignore This compiles fine, but Webstorm doesn't like the ESM import in a CJS context.
import type {DocEntry, EntryCollection, JsDocTagEntry, FunctionEntry} from '@angular/compiler-cli';

Expand Down
8 changes: 8 additions & 0 deletions adev/shared-docs/pipeline/api-gen/manifest/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {readFileSync, writeFileSync} from 'fs';
import {generateManifest} from './generate_manifest';
import type {EntryCollection} from '@angular/compiler-cli';
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

export function superNavigate() {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

// @ts-ignore This compiles fine, but Webstorm doesn't like the ESM import in a CJS context.
import {DocEntry, EntryType, FunctionEntry, JsDocTagEntry} from '@angular/compiler-cli';
import {generateManifest, Manifest} from '../generate_manifest';
Expand Down
8 changes: 8 additions & 0 deletions adev/shared-docs/pipeline/api-gen/rendering/cli-entities.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

/** The JSON data file format for CLI reference info. */
export interface CliCommand {
name: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {
ClassEntry,
ConstantEntry,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {JsDocTagEntry, MemberEntry, ParameterEntry} from '../entities';

import {
Expand Down
8 changes: 8 additions & 0 deletions adev/shared-docs/pipeline/api-gen/rendering/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {existsSync, mkdirSync, readFileSync, writeFileSync} from 'fs';
import path from 'path';
import {CliCommand} from './cli-entities';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {marked} from 'marked';
import {renderer} from './renderer';

Expand Down
8 changes: 8 additions & 0 deletions adev/shared-docs/pipeline/api-gen/rendering/shiki/shiki.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

let highlighter: any;

export async function initHighlighter() {
Expand Down
8 changes: 8 additions & 0 deletions adev/shared-docs/pipeline/api-gen/rendering/symbol-context.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

/**
* API pages are generated each package at a time.
* This allows to use a global context to store the symbols and their corresponding module names.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ function commandName(entry: CliCommandRenderable, command: string) {
} else {
return command;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {h} from 'preact';
import {getModuleName} from '../symbol-context';
import {getLinkToModule} from '../transforms/url-transforms';
Expand Down
8 changes: 8 additions & 0 deletions adev/shared-docs/pipeline/api-gen/rendering/test/cli.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {runfiles} from '@bazel/runfiles';
import {readFile} from 'fs/promises';
import {JSDOM} from 'jsdom';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {runfiles} from '@bazel/runfiles';
import {readFile} from 'fs/promises';
import {JSDOM} from 'jsdom';
Expand Down Expand Up @@ -42,7 +50,6 @@ describe('markdown to html', () => {
expect(header).toBeDefined();
expect(header.outerHTML).not.toContain('```');

console.log(entries2.get('afterNextRender'));
const list = afterNextRenderEntry.querySelector('ul')!;
expect(list).toBeDefined();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {runfiles} from '@bazel/runfiles';
import {readFile} from 'fs/promises';
import {getRenderable} from '../processing';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {makeGenericsText} from '../../transforms/code-transforms';

describe('makeGenericsText', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {setCurrentSymbol, setSymbols} from '../../symbol-context';
import {addHtmlAdditionalLinks} from '../../transforms/jsdoc-transforms';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {InitializerApiFunctionEntry} from '../entities';

import {InitializerApiFunctionRenderable} from '../entities/renderables';
Expand Down
8 changes: 8 additions & 0 deletions adev/shared-docs/pipeline/examples/template/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {diffLines, Change as DiffChange} from 'diff';
import {CodeToken} from './index';
import {loadWorkspaceRelativeFile} from '../../../utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {decode} from 'html-entities';
import {CodeToken} from './index';
import {expandRangeStringValues} from './range';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {Tokens} from 'marked';
import {DiffMetadata, calculateDiff} from './diff';
import {highlightCode} from './highlight';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

/**
* Expand a provided set of range values into a singel array of all values in the range.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {CodeToken} from './index';
import {regionParser} from '../regions/region-parser';
import {FileType} from '../sanitizers/eslint';
Expand Down
8 changes: 8 additions & 0 deletions adev/shared-docs/pipeline/guides/mermaid/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {DocsCodeToken} from '../extensions/docs-code/docs-code';
import {chromium} from 'playwright-core';
import {Mermaid, MermaidConfig} from 'mermaid';
Expand Down
Loading

0 comments on commit f15ccb9

Please sign in to comment.