Skip to content

Commit

Permalink
Fix spelling error
Browse files Browse the repository at this point in the history
  • Loading branch information
octogonz committed Oct 5, 2020
1 parent ec72a6a commit 72b8ecf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions stack/eslint-plugin-packlets/src/DependencyAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -162,7 +162,7 @@ export class DependencyAnalyzer {
*/
public static checkEntryPointForCircularImport(
packletName: string,
packletAnalyzer: PacketAnalyzer,
packletAnalyzer: PackletAnalyzer,
program: ts.Program
): IPackletImport[] | undefined {
const refFileMap: Map<string, RefFile[]> = (program as any).getRefFileMap();
Expand Down
6 changes: 3 additions & 3 deletions stack/eslint-plugin-packlets/src/PackletAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface IAnalyzerError {
data?: Readonly<Record<string, unknown>>;
}

export class PacketAnalyzer {
export class PackletAnalyzer {
private static _validPackletName: RegExp = /^[a-z0-9]+(-[a-z0-9]+)*$/;

/**
Expand Down Expand Up @@ -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;
}
Expand All @@ -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 {
Expand Down
7 changes: 5 additions & 2 deletions stack/eslint-plugin-packlets/src/circular-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -39,7 +39,10 @@ const circularDeps: TSESLint.RuleModule<MessageIds, Options> = {
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 {};
}
Expand Down
7 changes: 5 additions & 2 deletions stack/eslint-plugin-packlets/src/mechanics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -52,7 +52,10 @@ const mechanics: TSESLint.RuleModule<MessageIds, Options> = {
context
).program.getCompilerOptions()['configFilePath'] as string;

const packletAnalyzer: PacketAnalyzer = PacketAnalyzer.analyzeInputFile(inputFilePath, tsconfigFilePath);
const packletAnalyzer: PackletAnalyzer = PackletAnalyzer.analyzeInputFile(
inputFilePath,
tsconfigFilePath
);
if (packletAnalyzer.nothingToDo) {
return {};
}
Expand Down

0 comments on commit 72b8ecf

Please sign in to comment.