Skip to content

Commit 5627415

Browse files
authored
Merge pull request microsoft#1593 from microsoft/octogonz/eslint-migration
Migrate all projects to use ESLint+TypeScript instead of TSLint
2 parents 4845cef + ef74f9a commit 5627415

410 files changed

Lines changed: 2665 additions & 2090 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/api-documenter/.eslintrc.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2+
require("@rushstack/eslint-config/patch-eslint6");
3+
4+
module.exports = {
5+
extends: [ "@rushstack/eslint-config" ],
6+
parserOptions: { tsconfigRootDir: __dirname },
7+
};

‎apps/api-documenter/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"devDependencies": {
2929
"@microsoft/rush-stack-compiler-3.4": "0.3.0",
3030
"@microsoft/node-library-build": "6.3.0",
31+
"@rushstack/eslint-config": "0.4.0",
3132
"@types/jest": "23.3.11",
3233
"@types/js-yaml": "3.12.1",
3334
"@types/node": "8.10.54",

‎apps/api-documenter/src/cli/ApiDocumenterCommandLine.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { YamlAction } from './YamlAction';
77
import { GenerateAction } from './GenerateAction';
88

99
export class ApiDocumenterCommandLine extends CommandLineParser {
10-
constructor() {
10+
public constructor() {
1111
super({
1212
toolFilename: 'api-documenter',
1313
toolDescription: 'Reads *.api.json files produced by api-extractor, '

‎apps/api-documenter/src/cli/GenerateAction.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { FileSystem } from '@microsoft/node-core-library';
1313
import { MarkdownDocumenter } from '../documenters/MarkdownDocumenter';
1414

1515
export class GenerateAction extends BaseAction {
16-
constructor(parser: ApiDocumenterCommandLine) {
16+
public constructor(parser: ApiDocumenterCommandLine) {
1717
super({
1818
actionName: 'generate',
1919
summary: 'EXPERIMENTAL',

‎apps/api-documenter/src/cli/MarkdownAction.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { MarkdownDocumenter } from '../documenters/MarkdownDocumenter';
77
import { ApiModel } from '@microsoft/api-extractor-model';
88

99
export class MarkdownAction extends BaseAction {
10-
constructor(parser: ApiDocumenterCommandLine) {
10+
public constructor(parser: ApiDocumenterCommandLine) {
1111
super({
1212
actionName: 'markdown',
1313
summary: 'Generate documentation as Markdown files (*.md)',

‎apps/api-documenter/src/cli/YamlAction.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { ApiModel } from '@microsoft/api-extractor-model';
1515
export class YamlAction extends BaseAction {
1616
private _officeParameter: CommandLineFlagParameter;
1717

18-
constructor(parser: ApiDocumenterCommandLine) {
18+
public constructor(parser: ApiDocumenterCommandLine) {
1919
super({
2020
actionName: 'yaml',
2121
summary: 'Generate documentation as universal reference YAML files (*.yml)',

‎apps/api-documenter/src/documenters/DocumenterConfig.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export class DocumenterConfig {
2525
*/
2626
public static readonly FILENAME: string = 'api-documenter.json';
2727

28+
private constructor(filePath: string, configFile: IConfigFile) {
29+
this.configFilePath = filePath;
30+
this.configFile = configFile;
31+
}
32+
2833
/**
2934
* Load and validate an api-documenter.json file.
3035
*/
@@ -33,9 +38,4 @@ export class DocumenterConfig {
3338

3439
return new DocumenterConfig(path.resolve(configFilePath), configFile);
3540
}
36-
37-
private constructor(filePath: string, configFile: IConfigFile) {
38-
this.configFilePath = filePath;
39-
this.configFile = configFile;
40-
}
4141
}

‎apps/api-documenter/src/documenters/OfficeYamlDocumenter.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class OfficeYamlDocumenter extends YamlDocumenter {
3131
private _apiSetUrlDefault: string = '/office/dev/add-ins/reference/javascript-api-for-office';
3232

3333
// Hash set of API Set URLs based on product.
34-
private _apiSetUrls: Object = {
34+
private _apiSetUrls: Record<string, string> = {
3535
'Excel': '/office/dev/add-ins/reference/requirement-sets/excel-api-requirement-sets',
3636
'OneNote': '/office/dev/add-ins/reference/requirement-sets/onenote-api-requirement-sets',
3737
'Visio': '/office/dev/add-ins/reference/overview/visio-javascript-reference-overview',

‎apps/api-documenter/src/documenters/YamlDocumenter.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4-
// tslint:disable:member-ordering
5-
64
import * as path from 'path';
75

86
import yaml = require('js-yaml');

‎apps/api-documenter/src/plugin/MarkdownDocumenterAccessor.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class MarkdownDocumenterAccessor {
2121
private _implementation: IMarkdownDocumenterAccessorImplementation;
2222

2323
/** @internal */
24-
constructor (implementation: IMarkdownDocumenterAccessorImplementation) {
24+
public constructor (implementation: IMarkdownDocumenterAccessorImplementation) {
2525
this._implementation = implementation;
2626
}
2727

0 commit comments

Comments
 (0)