Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 3891467

Browse files
committed
Apply patches
1 parent 8616bc0 commit 3891467

15 files changed

+156
-317
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
"@types/eslint": "~8.44.0",
6969
"@types/json-schema": "~7.0.12",
7070
"@types/node": "~20.4.2",
71-
"@typescript-eslint/eslint-plugin": "~6.1.0",
72-
"@typescript-eslint/parser": "~6.1.0",
71+
"@typescript-eslint/eslint-plugin": "~5.62.0",
72+
"@typescript-eslint/parser": "~5.62.0",
7373
"change-case": "~4.1.2",
7474
"eslint": "~8.45.0",
7575
"eslint-config-prettier": "~8.8.0",

pnpm-lock.yaml

Lines changed: 104 additions & 177 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/generate-rule-files/diffs/rules/typescript-eslint/array-type.d.ts.diff

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
diff --git b/src/rules/typescript-eslint/array-type.d.ts a/src/rules/typescript-eslint/array-type.d.ts
2-
index 98cd312..fe661fc 100644
3-
--- b/src/rules/typescript-eslint/array-type.d.ts
4-
+++ a/src/rules/typescript-eslint/array-type.d.ts
1+
diff --git a/src/rules/typescript-eslint/array-type.d.ts b/src/rules/typescript-eslint/array-type.d.ts
2+
index 98cd312..e40ebb3 100644
3+
--- a/src/rules/typescript-eslint/array-type.d.ts
4+
+++ b/src/rules/typescript-eslint/array-type.d.ts
55
@@ -3,12 +3,16 @@ import type { RuleConfig } from '../rule-config';
66
/**
77
* Option.
@@ -17,7 +17,7 @@ index 98cd312..fe661fc 100644
1717
* Options.
1818
*/
1919
-export type ArrayTypeOptions = ArrayTypeOption;
20-
+export type ArrayTypeOptions = [ArrayTypeOption?];
20+
+export type ArrayTypeOptions = [ArrayTypeOption];
2121

2222
/**
2323
* Require consistently using either `T[]` or `Array<T>` for arrays.

scripts/generate-rule-files/diffs/rules/typescript-eslint/ban-ts-comment.d.ts.diff

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
diff --git b/src/rules/typescript-eslint/ban-ts-comment.d.ts a/src/rules/typescript-eslint/ban-ts-comment.d.ts
2-
index 111f9c9..5d489f8 100644
3-
--- b/src/rules/typescript-eslint/ban-ts-comment.d.ts
4-
+++ a/src/rules/typescript-eslint/ban-ts-comment.d.ts
1+
diff --git a/src/rules/typescript-eslint/ban-ts-comment.d.ts b/src/rules/typescript-eslint/ban-ts-comment.d.ts
2+
index 111f9c9..6015012 100644
3+
--- a/src/rules/typescript-eslint/ban-ts-comment.d.ts
4+
+++ b/src/rules/typescript-eslint/ban-ts-comment.d.ts
55
@@ -3,12 +3,42 @@ import type { RuleConfig } from '../rule-config';
66
/**
77
* Option.
@@ -43,7 +43,7 @@ index 111f9c9..5d489f8 100644
4343
* Options.
4444
*/
4545
-export type BanTsCommentOptions = BanTsCommentOption;
46-
+export type BanTsCommentOptions = [BanTsCommentOption?];
46+
+export type BanTsCommentOptions = [BanTsCommentOption];
4747

4848
/**
4949
* Disallow `@ts-<directive>` comments or require descriptions after directives.

scripts/generate-rule-files/diffs/rules/typescript-eslint/explicit-member-accessibility.d.ts.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
diff --git b/src/rules/typescript-eslint/explicit-member-accessibility.d.ts a/src/rules/typescript-eslint/explicit-member-accessibility.d.ts
1+
diff --git a/src/rules/typescript-eslint/explicit-member-accessibility.d.ts b/src/rules/typescript-eslint/explicit-member-accessibility.d.ts
22
index b585e26..1711d51 100644
3-
--- b/src/rules/typescript-eslint/explicit-member-accessibility.d.ts
4-
+++ a/src/rules/typescript-eslint/explicit-member-accessibility.d.ts
3+
--- a/src/rules/typescript-eslint/explicit-member-accessibility.d.ts
4+
+++ b/src/rules/typescript-eslint/explicit-member-accessibility.d.ts
55
@@ -3,13 +3,24 @@ import type { RuleConfig } from '../rule-config';
66
/**
77
* Option.

scripts/generate-rule-files/diffs/rules/typescript-eslint/lines-between-class-members.d.ts.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
diff --git b/src/rules/typescript-eslint/lines-between-class-members.d.ts a/src/rules/typescript-eslint/lines-between-class-members.d.ts
1+
diff --git a/src/rules/typescript-eslint/lines-between-class-members.d.ts b/src/rules/typescript-eslint/lines-between-class-members.d.ts
22
index 46caad7..afdd87e 100644
3-
--- b/src/rules/typescript-eslint/lines-between-class-members.d.ts
4-
+++ a/src/rules/typescript-eslint/lines-between-class-members.d.ts
3+
--- a/src/rules/typescript-eslint/lines-between-class-members.d.ts
4+
+++ b/src/rules/typescript-eslint/lines-between-class-members.d.ts
55
@@ -1,16 +1,23 @@
66
+import type {
77
+ LinesBetweenClassMembersConfig as BaseConfig,

scripts/generate-rule-files/diffs/rules/typescript-eslint/parameter-properties.d.ts.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
diff --git b/src/rules/typescript-eslint/parameter-properties.d.ts a/src/rules/typescript-eslint/parameter-properties.d.ts
1+
diff --git a/src/rules/typescript-eslint/parameter-properties.d.ts b/src/rules/typescript-eslint/parameter-properties.d.ts
22
index 6b0f176..591a9a4 100644
3-
--- b/src/rules/typescript-eslint/parameter-properties.d.ts
4-
+++ a/src/rules/typescript-eslint/parameter-properties.d.ts
3+
--- a/src/rules/typescript-eslint/parameter-properties.d.ts
4+
+++ b/src/rules/typescript-eslint/parameter-properties.d.ts
55
@@ -3,12 +3,37 @@ import type { RuleConfig } from '../rule-config';
66
/**
77
* Option.

scripts/generate-rule-files/diffs/rules/unicorn/import-index.d.ts.diff

Lines changed: 0 additions & 58 deletions
This file was deleted.

scripts/generate-rule-files/diffs/rules/unicorn/prefer-node-protocol.d.ts.diff

Lines changed: 0 additions & 51 deletions
This file was deleted.

scripts/generate-rule-files/index.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@ import { RuleFile } from './src/rule-file';
1313

1414
const __dirname: string = fileURLToPath(new URL('.', import.meta.url));
1515

16+
interface FailedRule {
17+
ruleName: string;
18+
err: unknown;
19+
}
20+
1621
/**
1722
* Generate the `index.d.ts` file for the plugin's rules that will re-export all rules.
1823
*/
1924
async function generateRuleIndexFile(
2025
pluginDirectory: string,
2126
{ rules, name }: Plugin,
22-
failedRules: string[],
27+
failedRules: FailedRule[],
2328
): Promise<void> {
2429
if (!rules) {
2530
throw new Error(
@@ -28,7 +33,8 @@ async function generateRuleIndexFile(
2833
}
2934

3035
const generatedRules: string[] = Object.keys(rules).filter(
31-
(ruleName) => !failedRules.includes(ruleName),
36+
(ruleName) =>
37+
!failedRules.some((failedRule) => failedRule.ruleName === ruleName),
3238
);
3339

3440
/**
@@ -68,7 +74,7 @@ async function generateRuleIndexFile(
6874
*/
6975
function printGenerationReport(
7076
rules: Array<[string, Rule.RuleModule]>,
71-
failedRules: string[],
77+
failedRules: FailedRule[],
7278
): void {
7379
const msg: string = ` ✅ Generated ${
7480
rules.length - failedRules.length
@@ -78,6 +84,9 @@ function printGenerationReport(
7884

7985
if (failedRules.length) {
8086
logger.log(logger.colors.red(` ❌ Failed ${failedRules.length} rules`));
87+
failedRules.forEach(({ ruleName, err }) => {
88+
logger.log(logger.colors.red(` - ${ruleName}: ${String(err)}`));
89+
});
8190
}
8291

8392
logger.log('');
@@ -89,8 +98,8 @@ function printGenerationReport(
8998
async function generateRulesFiles(
9099
plugin: Plugin,
91100
pluginDirectory: string,
92-
): Promise<{ failedRules: string[] }> {
93-
const failedRules: string[] = [];
101+
): Promise<{ failedRules: FailedRule[] }> {
102+
const failedRules: FailedRule[] = [];
94103

95104
const pluginRules: PluginRules | undefined = plugin.rules;
96105
if (!pluginRules) {
@@ -114,7 +123,7 @@ async function generateRulesFiles(
114123
ruleFile.writeGeneratedContent();
115124
ruleFile.applyPatch();
116125
} catch (err) {
117-
failedRules.push(ruleName);
126+
failedRules.push({ ruleName, err });
118127
}
119128
}
120129

0 commit comments

Comments
 (0)