Skip to content

Commit

Permalink
Fix ESLint issues for the rest of api-documenter, rush, and rush-buildxl
Browse files Browse the repository at this point in the history
  • Loading branch information
octogonz committed Oct 21, 2019
1 parent 1558d76 commit 1007ef3
Show file tree
Hide file tree
Showing 21 changed files with 38 additions and 27 deletions.
7 changes: 7 additions & 0 deletions apps/api-documenter/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require("@rushstack/eslint-config/patch-eslint6");

module.exports = {
extends: [ "@rushstack/eslint-config" ],
parserOptions: { tsconfigRootDir: __dirname },
};
2 changes: 1 addition & 1 deletion apps/api-documenter/src/cli/ApiDocumenterCommandLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { YamlAction } from './YamlAction';
import { GenerateAction } from './GenerateAction';

export class ApiDocumenterCommandLine extends CommandLineParser {
constructor() {
public constructor() {
super({
toolFilename: 'api-documenter',
toolDescription: 'Reads *.api.json files produced by api-extractor, '
Expand Down
2 changes: 1 addition & 1 deletion apps/api-documenter/src/cli/GenerateAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { FileSystem } from '@microsoft/node-core-library';
import { MarkdownDocumenter } from '../documenters/MarkdownDocumenter';

export class GenerateAction extends BaseAction {
constructor(parser: ApiDocumenterCommandLine) {
public constructor(parser: ApiDocumenterCommandLine) {
super({
actionName: 'generate',
summary: 'EXPERIMENTAL',
Expand Down
2 changes: 1 addition & 1 deletion apps/api-documenter/src/cli/MarkdownAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MarkdownDocumenter } from '../documenters/MarkdownDocumenter';
import { ApiModel } from '@microsoft/api-extractor-model';

export class MarkdownAction extends BaseAction {
constructor(parser: ApiDocumenterCommandLine) {
public constructor(parser: ApiDocumenterCommandLine) {
super({
actionName: 'markdown',
summary: 'Generate documentation as Markdown files (*.md)',
Expand Down
2 changes: 1 addition & 1 deletion apps/api-documenter/src/cli/YamlAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ApiModel } from '@microsoft/api-extractor-model';
export class YamlAction extends BaseAction {
private _officeParameter: CommandLineFlagParameter;

constructor(parser: ApiDocumenterCommandLine) {
public constructor(parser: ApiDocumenterCommandLine) {
super({
actionName: 'yaml',
summary: 'Generate documentation as universal reference YAML files (*.yml)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class OfficeYamlDocumenter extends YamlDocumenter {
private _apiSetUrlDefault: string = '/office/dev/add-ins/reference/javascript-api-for-office';

// Hash set of API Set URLs based on product.
private _apiSetUrls: Object = {
private _apiSetUrls: Record<string, string> = {
'Excel': '/office/dev/add-ins/reference/requirement-sets/excel-api-requirement-sets',
'OneNote': '/office/dev/add-ins/reference/requirement-sets/onenote-api-requirement-sets',
'Visio': '/office/dev/add-ins/reference/overview/visio-javascript-reference-overview',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class MarkdownDocumenterAccessor {
private _implementation: IMarkdownDocumenterAccessorImplementation;

/** @internal */
constructor (implementation: IMarkdownDocumenterAccessorImplementation) {
public constructor (implementation: IMarkdownDocumenterAccessorImplementation) {
this._implementation = implementation;
}

Expand Down
3 changes: 2 additions & 1 deletion apps/api-documenter/src/plugin/PluginLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ export class PluginLoader {
});

// Load the package
// eslint-disable-next-line @typescript-eslint/no-var-requires
const entryPoint: object | undefined = require(resolvedEntryPointPath);

if (!entryPoint) {
throw new Error('Invalid entry point');
}

const manifest: IApiDocumenterPluginManifest
// tslint:disable-next-line:no-string-literal
// eslint-disable-next-line dot-notation
= entryPoint['apiDocumenterPluginManifest'] as IApiDocumenterPluginManifest;

if (!manifest) {
Expand Down
6 changes: 0 additions & 6 deletions apps/api-documenter/tslint.json

This file was deleted.

7 changes: 7 additions & 0 deletions apps/rush-buildxl/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require("@rushstack/eslint-config/patch-eslint6");

module.exports = {
extends: [ "@rushstack/eslint-config" ],
parserOptions: { tsconfigRootDir: __dirname },
};
2 changes: 1 addition & 1 deletion apps/rush-buildxl/src/cli/RushBuildXLCommandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { GenerateAction } from './actions/GenerateAction';
export class RushBuildXLCommandLineParser extends CommandLineParser {
private _terminal: Terminal;

constructor(terminal: Terminal) {
public constructor(terminal: Terminal) {
super({
toolFilename: 'rush-buildlx',
toolDescription: 'This experimental tool allows Rush to interact with BuildXL.'
Expand Down
2 changes: 1 addition & 1 deletion apps/rush-buildxl/src/cli/actions/CleanAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { RushConfiguration } from '@microsoft/rush-lib';
export class CleanAction extends CommandLineAction {
private _terminal: Terminal;

constructor(terminal: Terminal) {
public constructor(terminal: Terminal) {
super({
actionName: 'clean',
summary: 'Cleans up generated BuildXL configuration for the current Rush repository.',
Expand Down
2 changes: 1 addition & 1 deletion apps/rush-buildxl/src/cli/actions/GenerateAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BxlModulesGenerator } from '../../logic/BxlModulesGenerator';
export class GenerateAction extends CommandLineAction {
private _terminal: Terminal;

constructor(terminal: Terminal) {
public constructor(terminal: Terminal) {
super({
actionName: 'generate',
summary: 'Generates a BuildXL configuration for the current Rush repository.',
Expand Down
2 changes: 1 addition & 1 deletion apps/rush-buildxl/src/logic/BxlConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class BxlConfig {
private _modules: BxlModule[];
private _commonRushConfigFolder: string;

constructor(bxlRoot: string, modulesFolder: string, modules: BxlModule[], commonRushConfigFolder: string) {
public constructor(bxlRoot: string, modulesFolder: string, modules: BxlModule[], commonRushConfigFolder: string) {
this._bxlRoot = bxlRoot;
this._modulesFolder = modulesFolder;
this._modules = modules;
Expand Down
2 changes: 1 addition & 1 deletion apps/rush-buildxl/src/logic/BxlModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class BxlModule {
private _projectFolder: string;
private _rushJsonPath: string;

constructor(name: string, projectFolder: string, rushJsonPath: string, moduleFolder: string) {
public constructor(name: string, projectFolder: string, rushJsonPath: string, moduleFolder: string) {
this._name = name;
this._projectFolder = projectFolder;
this._rushJsonPath = rushJsonPath;
Expand Down
2 changes: 1 addition & 1 deletion apps/rush-buildxl/src/logic/BxlModuleConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class BxlModuleConfig {
private _moduleFilePath: string;
private _moduleFolder: string;

constructor(name: string, moduleFolder: string, moduleFilePath: string) {
public constructor(name: string, moduleFolder: string, moduleFilePath: string) {
this._name = name;
this._moduleFolder = moduleFolder;
this._moduleFilePath = moduleFilePath;
Expand Down
2 changes: 1 addition & 1 deletion apps/rush-buildxl/src/logic/BxlModulesGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class BxlModulesGenerator {
private _rushConfiguration: RushConfiguration;
private _buildXLRoot: string;

constructor(rushConfiguration: RushConfiguration, buildXLRoot: string) {
public constructor(rushConfiguration: RushConfiguration, buildXLRoot: string) {
this._rushConfiguration = rushConfiguration;
this._buildXLRoot = this._normalizePathSeparator(buildXLRoot);
}
Expand Down
3 changes: 0 additions & 3 deletions apps/rush-buildxl/tslint.json

This file was deleted.

7 changes: 7 additions & 0 deletions apps/rush-lib/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require("@rushstack/eslint-config/patch-eslint6");

module.exports = {
extends: [ "@rushstack/eslint-config" ],
parserOptions: { tsconfigRootDir: __dirname },
};
3 changes: 2 additions & 1 deletion apps/rush/src/RushVersionSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class RushVersionSelector {
private _rushGlobalFolder: _RushGlobalFolder;
private _currentPackageVersion: string;

constructor(currentPackageVersion: string) {
public constructor(currentPackageVersion: string) {
this._rushGlobalFolder = new _RushGlobalFolder();
this._currentPackageVersion = currentPackageVersion;
}
Expand Down Expand Up @@ -111,6 +111,7 @@ export class RushVersionSelector {
));
} else {
// For newer rush-lib, RushCommandSelector can test whether "rushx" is supported or not
// eslint-disable-next-line @typescript-eslint/no-var-requires
const rushCliEntrypoint: { } = require(path.join(
expectedRushPath,
'node_modules',
Expand Down
3 changes: 0 additions & 3 deletions apps/rush/tslint.json

This file was deleted.

0 comments on commit 1007ef3

Please sign in to comment.