From 72b8ecfeb5635a997f4fb3f9aaf601cd8e5a5b7b Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Mon, 5 Oct 2020 15:08:07 -0700 Subject: [PATCH] Fix spelling error --- stack/eslint-plugin-packlets/src/DependencyAnalyzer.ts | 4 ++-- stack/eslint-plugin-packlets/src/PackletAnalyzer.ts | 6 +++--- stack/eslint-plugin-packlets/src/circular-deps.ts | 7 +++++-- stack/eslint-plugin-packlets/src/mechanics.ts | 7 +++++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/stack/eslint-plugin-packlets/src/DependencyAnalyzer.ts b/stack/eslint-plugin-packlets/src/DependencyAnalyzer.ts index bf227ace3a3..0f23fa4697d 100644 --- a/stack/eslint-plugin-packlets/src/DependencyAnalyzer.ts +++ b/stack/eslint-plugin-packlets/src/DependencyAnalyzer.ts @@ -5,7 +5,7 @@ import type * as ts from 'typescript'; import * as path from 'path'; import { Path } from './Path'; -import { PacketAnalyzer } from './PackletAnalyzer'; +import { PackletAnalyzer } from './PackletAnalyzer'; enum RefFileKind { Import, @@ -162,7 +162,7 @@ export class DependencyAnalyzer { */ public static checkEntryPointForCircularImport( packletName: string, - packletAnalyzer: PacketAnalyzer, + packletAnalyzer: PackletAnalyzer, program: ts.Program ): IPackletImport[] | undefined { const refFileMap: Map = (program as any).getRefFileMap(); diff --git a/stack/eslint-plugin-packlets/src/PackletAnalyzer.ts b/stack/eslint-plugin-packlets/src/PackletAnalyzer.ts index 785a0f9f802..4e0c1632722 100644 --- a/stack/eslint-plugin-packlets/src/PackletAnalyzer.ts +++ b/stack/eslint-plugin-packlets/src/PackletAnalyzer.ts @@ -22,7 +22,7 @@ export interface IAnalyzerError { data?: Readonly>; } -export class PacketAnalyzer { +export class PackletAnalyzer { private static _validPackletName: RegExp = /^[a-z0-9]+(-[a-z0-9]+)*$/; /** @@ -141,7 +141,7 @@ export class PacketAnalyzer { const thirdPartWithoutExtension: string = path.parse(thirdPart).name; if (thirdPartWithoutExtension.toUpperCase() === 'INDEX') { - if (!PacketAnalyzer._validPackletName.test(packletName)) { + if (!PackletAnalyzer._validPackletName.test(packletName)) { this.error = { messageId: 'invalid-packlet-name', data: { packletName } }; return; } @@ -156,7 +156,7 @@ export class PacketAnalyzer { } public static analyzeInputFile(inputFilePath: string, tsconfigFilePath: string | undefined) { - return new PacketAnalyzer(inputFilePath, tsconfigFilePath); + return new PackletAnalyzer(inputFilePath, tsconfigFilePath); } public analyzeImport(modulePath: string): IAnalyzerError | undefined { diff --git a/stack/eslint-plugin-packlets/src/circular-deps.ts b/stack/eslint-plugin-packlets/src/circular-deps.ts index 93ef4f050f4..b92daf90457 100644 --- a/stack/eslint-plugin-packlets/src/circular-deps.ts +++ b/stack/eslint-plugin-packlets/src/circular-deps.ts @@ -7,7 +7,7 @@ import * as path from 'path'; import type { ParserServices, TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; import { ESLintUtils } from '@typescript-eslint/experimental-utils'; -import { PacketAnalyzer } from './PackletAnalyzer'; +import { PackletAnalyzer } from './PackletAnalyzer'; import { DependencyAnalyzer, IPackletImport } from './DependencyAnalyzer'; export type MessageIds = 'circular-import'; @@ -39,7 +39,10 @@ const circularDeps: TSESLint.RuleModule = { const program: ts.Program = ESLintUtils.getParserServices(context).program; const tsconfigFilePath: string | undefined = program.getCompilerOptions()['configFilePath'] as string; - const packletAnalyzer: PacketAnalyzer = PacketAnalyzer.analyzeInputFile(inputFilePath, tsconfigFilePath); + const packletAnalyzer: PackletAnalyzer = PackletAnalyzer.analyzeInputFile( + inputFilePath, + tsconfigFilePath + ); if (packletAnalyzer.nothingToDo) { return {}; } diff --git a/stack/eslint-plugin-packlets/src/mechanics.ts b/stack/eslint-plugin-packlets/src/mechanics.ts index 43ee5273a83..ad1a2605663 100644 --- a/stack/eslint-plugin-packlets/src/mechanics.ts +++ b/stack/eslint-plugin-packlets/src/mechanics.ts @@ -4,7 +4,7 @@ import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/experimental-utils'; -import { PacketAnalyzer, IAnalyzerError, InputFileMessageIds, ImportMessageIds } from './PackletAnalyzer'; +import { PackletAnalyzer, IAnalyzerError, InputFileMessageIds, ImportMessageIds } from './PackletAnalyzer'; export type MessageIds = InputFileMessageIds | ImportMessageIds; type Options = []; @@ -52,7 +52,10 @@ const mechanics: TSESLint.RuleModule = { context ).program.getCompilerOptions()['configFilePath'] as string; - const packletAnalyzer: PacketAnalyzer = PacketAnalyzer.analyzeInputFile(inputFilePath, tsconfigFilePath); + const packletAnalyzer: PackletAnalyzer = PackletAnalyzer.analyzeInputFile( + inputFilePath, + tsconfigFilePath + ); if (packletAnalyzer.nothingToDo) { return {}; }