Skip to content

Commit

Permalink
Fix rule generation (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Oct 7, 2023
1 parent 4e845f8 commit 801a126
Show file tree
Hide file tree
Showing 38 changed files with 269 additions and 2,436 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
diff --git a/src/rules/vitest/valid-title.d.ts b/src/rules/vitest/valid-title.d.ts
index 8bdfe9a..83c707b 100644
index 160be76..834ac9b 100644
--- a/src/rules/vitest/valid-title.d.ts
+++ b/src/rules/vitest/valid-title.d.ts
@@ -8,13 +8,7 @@ export interface ValidTitleOption {
@@ -7,15 +7,7 @@ export interface ValidTitleOption {
ignoreTypeOfDescribeName?: boolean;
allowArguments?: boolean;
disallowedWords?: string[];
/**
*/
- /**
- */
- [k: string]:
- | string
- | [string]
Expand Down
3 changes: 3 additions & 0 deletions scripts/generate-rule-files/src/json-schema-to-ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export async function generateTypeFromSchema(
schema: JSONSchema4,
typeName: string,
): Promise<string> {
schema = JSON.parse(
JSON.stringify(schema).replace(/#\/items\/0\/\$defs\//g, '#/$defs/'),
);
let result: string = await compile(schema, typeName, {
format: false,
bannerComment: '',
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-rule-files/src/rule-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export class RuleFile {
* Create the directory of the rule file if it doesn't exist.
*/
private createRuleDirectory(): void {
const subPath: string = dirname(this.rulePath.toLowerCase());
const subPath: string = dirname(this.rulePath);
if (!existsSync(subPath)) {
mkdirSync(subPath, { recursive: true });
}
Expand Down
22 changes: 0 additions & 22 deletions src/rules/testing-library/await-async-query.d.ts

This file was deleted.

22 changes: 0 additions & 22 deletions src/rules/testing-library/await-fire-event.d.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/rules/testing-library/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import type { AwaitAsyncEventsRule } from './await-async-events';
import type { AwaitAsyncQueriesRule } from './await-async-queries';
import type { AwaitAsyncQueryRule } from './await-async-query';
import type { AwaitAsyncUtilsRule } from './await-async-utils';
import type { AwaitFireEventRule } from './await-fire-event';
import type { ConsistentDataTestidRule } from './consistent-data-testid';
import type { NoAwaitSyncEventsRule } from './no-await-sync-events';
import type { NoAwaitSyncQueriesRule } from './no-await-sync-queries';
import type { NoAwaitSyncQueryRule } from './no-await-sync-query';
import type { NoContainerRule } from './no-container';
import type { NoDebuggingUtilsRule } from './no-debugging-utils';
import type { NoDomImportRule } from './no-dom-import';
Expand All @@ -15,9 +12,7 @@ import type { NoManualCleanupRule } from './no-manual-cleanup';
import type { NoNodeAccessRule } from './no-node-access';
import type { NoPromiseInFireEventRule } from './no-promise-in-fire-event';
import type { NoRenderInLifecycleRule } from './no-render-in-lifecycle';
import type { NoRenderInSetupRule } from './no-render-in-setup';
import type { NoUnnecessaryActRule } from './no-unnecessary-act';
import type { NoWaitForEmptyCallbackRule } from './no-wait-for-empty-callback';
import type { NoWaitForMultipleAssertionsRule } from './no-wait-for-multiple-assertions';
import type { NoWaitForSideEffectsRule } from './no-wait-for-side-effects';
import type { NoWaitForSnapshotRule } from './no-wait-for-snapshot';
Expand All @@ -28,21 +23,17 @@ import type { PreferQueryByDisappearanceRule } from './prefer-query-by-disappear
import type { PreferQueryMatchersRule } from './prefer-query-matchers';
import type { PreferScreenQueriesRule } from './prefer-screen-queries';
import type { PreferUserEventRule } from './prefer-user-event';
import type { PreferWaitForRule } from './prefer-wait-for';
import type { RenderResultNamingConventionRule } from './render-result-naming-convention';

/**
* All TestingLibrary rules.
*/
export type TestingLibraryRules = AwaitAsyncEventsRule &
AwaitAsyncQueriesRule &
AwaitAsyncQueryRule &
AwaitAsyncUtilsRule &
AwaitFireEventRule &
ConsistentDataTestidRule &
NoAwaitSyncEventsRule &
NoAwaitSyncQueriesRule &
NoAwaitSyncQueryRule &
NoContainerRule &
NoDebuggingUtilsRule &
NoDomImportRule &
Expand All @@ -51,9 +42,7 @@ export type TestingLibraryRules = AwaitAsyncEventsRule &
NoNodeAccessRule &
NoPromiseInFireEventRule &
NoRenderInLifecycleRule &
NoRenderInSetupRule &
NoUnnecessaryActRule &
NoWaitForEmptyCallbackRule &
NoWaitForMultipleAssertionsRule &
NoWaitForSideEffectsRule &
NoWaitForSnapshotRule &
Expand All @@ -64,5 +53,4 @@ export type TestingLibraryRules = AwaitAsyncEventsRule &
PreferQueryMatchersRule &
PreferScreenQueriesRule &
PreferUserEventRule &
PreferWaitForRule &
RenderResultNamingConventionRule;
22 changes: 0 additions & 22 deletions src/rules/testing-library/no-await-sync-query.d.ts

This file was deleted.

35 changes: 0 additions & 35 deletions src/rules/testing-library/no-render-in-setup.d.ts

This file was deleted.

Loading

0 comments on commit 801a126

Please sign in to comment.