Skip to content

Commit

Permalink
Merge pull request #1936 from microsoft/octogonz/upgrade-eslint
Browse files Browse the repository at this point in the history
[eslint-config] Upgrade to ESLint 7
  • Loading branch information
octogonz authored Jun 24, 2020
2 parents a754693 + 6798523 commit 4318009
Show file tree
Hide file tree
Showing 146 changed files with 1,714 additions and 289 deletions.
2 changes: 1 addition & 1 deletion apps/api-documenter/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('@rushstack/eslint-config/patch-eslint6');
require('@rushstack/eslint-config/patch/modern-module-resolution');

module.exports = {
extends: ['@rushstack/eslint-config'],
Expand Down
1 change: 0 additions & 1 deletion apps/api-documenter/src/plugin/PluginLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class PluginLoader {
});

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

if (!entryPoint) {
Expand Down
2 changes: 1 addition & 1 deletion apps/api-extractor-model/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('@rushstack/eslint-config/patch-eslint6');
require('@rushstack/eslint-config/patch/modern-module-resolution');

module.exports = {
extends: ['@rushstack/eslint-config'],
Expand Down
2 changes: 1 addition & 1 deletion apps/api-extractor-model/src/items/ApiDeclaredItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface IApiDeclaredItemJson extends IApiDocumentedItemJson {
*
* @public
*/
// eslint-disable-next-line @typescript-eslint/interface-name-prefix
// eslint-disable-next-line @typescript-eslint/naming-convention
export class ApiDeclaredItem extends ApiDocumentedItem {
private _excerptTokens: ExcerptToken[];
private _excerpt: Excerpt;
Expand Down
1 change: 0 additions & 1 deletion apps/api-extractor-model/src/items/ApiItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export class ApiItem {
public static deserialize(jsonObject: IApiItemJson, context: DeserializerContext): ApiItem {
// The Deserializer class is coupled with a ton of other classes, so we delay loading it
// to avoid ES5 circular imports.
// eslint-disable-next-line @typescript-eslint/no-var-requires
const deserializerModule: typeof import('../model/Deserializer') = require('../model/Deserializer');
return deserializerModule.Deserializer.deserialize(context, jsonObject);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const _membersByKind: unique symbol = Symbol('ApiItemContainerMixin._membersByKi
*
* @public
*/
// eslint-disable-next-line @typescript-eslint/interface-name-prefix
// eslint-disable-next-line @typescript-eslint/naming-convention
export interface ApiItemContainerMixin extends ApiItem {
/**
* Returns the members of this container, sorted alphabetically.
Expand Down
2 changes: 1 addition & 1 deletion apps/api-extractor-model/src/mixins/ApiNameMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const _name: unique symbol = Symbol('ApiNameMixin._name');
*
* @public
*/
// eslint-disable-next-line @typescript-eslint/interface-name-prefix
// eslint-disable-next-line @typescript-eslint/naming-convention
export interface ApiNameMixin extends ApiItem {
/**
* The exported name of this API item.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const _parameters: unique symbol = Symbol('ApiParameterListMixin._parameters');
*
* @public
*/
// eslint-disable-next-line @typescript-eslint/interface-name-prefix
// eslint-disable-next-line @typescript-eslint/naming-convention
export interface ApiParameterListMixin extends ApiItem {
/**
* When a function has multiple overloaded declarations, this zero-based integer index can be used to unqiuely
Expand Down
2 changes: 1 addition & 1 deletion apps/api-extractor-model/src/mixins/ApiReleaseTagMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const _releaseTag: unique symbol = Symbol('ApiReleaseTagMixin._releaseTag');
*
* @public
*/
// eslint-disable-next-line @typescript-eslint/interface-name-prefix
// eslint-disable-next-line @typescript-eslint/naming-convention
export interface ApiReleaseTagMixin extends ApiItem {
/**
* The effective release tag for this declaration. If it is not explicitly specified, the value may be
Expand Down
2 changes: 1 addition & 1 deletion apps/api-extractor-model/src/mixins/ApiReturnTypeMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const _returnTypeExcerpt: unique symbol = Symbol('ApiReturnTypeMixin._returnType
*
* @public
*/
// eslint-disable-next-line @typescript-eslint/interface-name-prefix
// eslint-disable-next-line @typescript-eslint/naming-convention
export interface ApiReturnTypeMixin extends ApiItem {
/**
* An {@link Excerpt} that describes the type of the function's return value.
Expand Down
2 changes: 1 addition & 1 deletion apps/api-extractor-model/src/mixins/ApiStaticMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const _isStatic: unique symbol = Symbol('ApiStaticMixin._isStatic');
*
* @public
*/
// eslint-disable-next-line @typescript-eslint/interface-name-prefix
// eslint-disable-next-line @typescript-eslint/naming-convention
export interface ApiStaticMixin extends ApiItem {
/**
* Whether the declaration has the TypeScript `static` keyword.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const _typeParameters: unique symbol = Symbol('ApiTypeParameterListMixin._typePa
*
* @public
*/
// eslint-disable-next-line @typescript-eslint/interface-name-prefix
// eslint-disable-next-line @typescript-eslint/naming-convention
export interface ApiTypeParameterListMixin extends ApiItem {
/**
* The type parameters.
Expand Down
2 changes: 1 addition & 1 deletion apps/api-extractor/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('@rushstack/eslint-config/patch-eslint6');
require('@rushstack/eslint-config/patch/modern-module-resolution');

module.exports = {
extends: ['@rushstack/eslint-config'],
Expand Down
4 changes: 2 additions & 2 deletions apps/api-extractor/src/generators/ApiReportGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { StringWriter } from './StringWriter';
import { DtsEmitHelpers } from './DtsEmitHelpers';

export class ApiReportGenerator {
private static _TrimSpacesRegExp: RegExp = / +$/gm;
private static _trimSpacesRegExp: RegExp = / +$/gm;

/**
* Compares the contents of two API files that were created using ApiFileGenerator,
Expand Down Expand Up @@ -170,7 +170,7 @@ export class ApiReportGenerator {
stringWriter.writeLine('\n```');

// Remove any trailing spaces
return stringWriter.toString().replace(ApiReportGenerator._TrimSpacesRegExp, '');
return stringWriter.toString().replace(ApiReportGenerator._trimSpacesRegExp, '');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion apps/heft/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('@rushstack/eslint-config/patch-eslint6');
require('@rushstack/eslint-config/patch/modern-module-resolution');

module.exports = {
extends: ['@rushstack/eslint-config'],
Expand Down
2 changes: 1 addition & 1 deletion apps/rush-buildxl/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('@rushstack/eslint-config/patch-eslint6');
require('@rushstack/eslint-config/patch/modern-module-resolution');

module.exports = {
extends: ['@rushstack/eslint-config'],
Expand Down
2 changes: 1 addition & 1 deletion apps/rush-lib/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('@rushstack/eslint-config/patch-eslint6');
require('@rushstack/eslint-config/patch/modern-module-resolution');

module.exports = {
extends: ['@rushstack/eslint-config'],
Expand Down
10 changes: 5 additions & 5 deletions apps/rush-lib/src/cli/actions/ListAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ export class ListAction extends BaseRushAction {

private _printJson(allPackages: Map<string, RushConfigurationProject>): void {
const projects: IJsonEntry[] = [];
allPackages.forEach((_config: RushConfigurationProject, name: string) => {
allPackages.forEach((config: RushConfigurationProject, name: string) => {
const project: IJsonEntry = {
name: name,
version: _config.packageJson.version,
path: _config.projectRelativeFolder,
fullPath: _config.projectFolder
version: config.packageJson.version,
path: config.projectRelativeFolder,
fullPath: config.projectFolder
};
projects.push(project);
});
Expand All @@ -94,7 +94,7 @@ export class ListAction extends BaseRushAction {
}

private _printList(allPackages: Map<string, RushConfigurationProject>): void {
allPackages.forEach((_config: RushConfigurationProject, name: string) => {
allPackages.forEach((config: RushConfigurationProject, name: string) => {
console.log(name);
});
}
Expand Down
1 change: 0 additions & 1 deletion apps/rush-lib/src/cli/test/RushCommandLineParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ interface IParserTestInstance {
* in `__mocks__/child_process.js`.
*/
function setSpawnMock(options?: ISpawnMockConfig): jest.Mock {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const cpMocked: IChildProcessModuleMock = require('child_process');
cpMocked.__setSpawnMockConfig(options);

Expand Down
2 changes: 1 addition & 1 deletion apps/rush-lib/src/logic/InstallManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import { InstallHelpers } from './InstallHelpers';
* As a temporary workaround, augment the type.
*/
declare module 'tar' {
// eslint-disable-next-line @typescript-eslint/interface-name-prefix
// eslint-disable-next-line @typescript-eslint/naming-convention
export interface CreateOptions {
/**
* "Set to true to omit writing mtime values for entries. Note that this prevents using other
Expand Down
14 changes: 7 additions & 7 deletions apps/rush-lib/src/logic/VersionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ export class VersionManager {
private _changeFiles: Map<string, ChangeFile>;

public constructor(
_rushConfiguration: RushConfiguration,
_userEmail: string,
_versionPolicyConfiguration?: VersionPolicyConfiguration
rushConfiguration: RushConfiguration,
userEmail: string,
versionPolicyConfiguration?: VersionPolicyConfiguration
) {
this._rushConfiguration = _rushConfiguration;
this._userEmail = _userEmail;
this._versionPolicyConfiguration = _versionPolicyConfiguration
? _versionPolicyConfiguration
this._rushConfiguration = rushConfiguration;
this._userEmail = userEmail;
this._versionPolicyConfiguration = versionPolicyConfiguration
? versionPolicyConfiguration
: this._rushConfiguration.versionPolicyConfiguration;

this._updatedProjects = new Map<string, IPackageJson>();
Expand Down
1 change: 0 additions & 1 deletion apps/rush-lib/src/logic/deploy/DeployManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export class DeployManager {
}

// (Used only by the legacy code fragment in the resolve.sync() hook below)
// eslint-disable-next-line @typescript-eslint/no-var-requires
const fs: typeof import('fs') = require('fs');

for (const dependencyPackageName of allDependencyNames) {
Expand Down
1 change: 0 additions & 1 deletion apps/rush-lib/src/logic/taskRunner/ProjectTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export class ProjectTask implements ITaskDefinition {

private _getPackageDependencies(writer: ITaskWriter): IPackageDependencies | undefined {
let deps: IPackageDependencies | undefined = undefined;
this._rushConfiguration = this._rushConfiguration;
try {
deps = {
files: this._packageChangeAnalyzer.getPackageDepsHash(this._rushProject.packageName)!.files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export abstract class VersionMismatchFinderEntity {
this.skipRushCheck = options.skipRushCheck;
}

public abstract filePath: string;
public abstract allDependencies: ReadonlyArray<PackageJsonDependency>;
public abstract get filePath(): string;
public abstract get allDependencies(): ReadonlyArray<PackageJsonDependency>;

public abstract tryGetDependency(packageName: string): PackageJsonDependency | undefined;
public abstract tryGetDevDependency(packageName: string): PackageJsonDependency | undefined;
Expand Down
2 changes: 1 addition & 1 deletion apps/rush/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('@rushstack/eslint-config/patch-eslint6');
require('@rushstack/eslint-config/patch/modern-module-resolution');

module.exports = {
extends: ['@rushstack/eslint-config'],
Expand Down
1 change: 0 additions & 1 deletion apps/rush/src/RushVersionSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export class RushVersionSelector {
require(path.join(expectedRushPath, 'node_modules', '@microsoft', 'rush', 'lib', 'start'));
} 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
2 changes: 1 addition & 1 deletion build-tests/node-library-build-eslint-test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('@rushstack/eslint-config/patch-eslint6');
require('@rushstack/eslint-config/patch/modern-module-resolution');

module.exports = {
extends: ['@rushstack/eslint-config'],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/api-documenter",
"comment": "",
"type": "none"
}
],
"packageName": "@microsoft/api-documenter",
"email": "4673363+octogonz@users.noreply.github.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/api-extractor-model",
"comment": "",
"type": "none"
}
],
"packageName": "@microsoft/api-extractor-model",
"email": "4673363+octogonz@users.noreply.github.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/api-extractor",
"comment": "",
"type": "none"
}
],
"packageName": "@microsoft/api-extractor",
"email": "4673363+octogonz@users.noreply.github.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/gulp-core-build-mocha",
"comment": "",
"type": "none"
}
],
"packageName": "@microsoft/gulp-core-build-mocha",
"email": "4673363+octogonz@users.noreply.github.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/gulp-core-build-sass",
"comment": "",
"type": "none"
}
],
"packageName": "@microsoft/gulp-core-build-sass",
"email": "4673363+octogonz@users.noreply.github.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/gulp-core-build-serve",
"comment": "",
"type": "none"
}
],
"packageName": "@microsoft/gulp-core-build-serve",
"email": "4673363+octogonz@users.noreply.github.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/gulp-core-build-typescript",
"comment": "",
"type": "none"
}
],
"packageName": "@microsoft/gulp-core-build-typescript",
"email": "4673363+octogonz@users.noreply.github.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/gulp-core-build-webpack",
"comment": "",
"type": "none"
}
],
"packageName": "@microsoft/gulp-core-build-webpack",
"email": "4673363+octogonz@users.noreply.github.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/gulp-core-build",
"comment": "",
"type": "none"
}
],
"packageName": "@microsoft/gulp-core-build",
"email": "4673363+octogonz@users.noreply.github.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/load-themed-styles",
"comment": "",
"type": "none"
}
],
"packageName": "@microsoft/load-themed-styles",
"email": "4673363+octogonz@users.noreply.github.com"
}
Loading

0 comments on commit 4318009

Please sign in to comment.