Skip to content

Commit 39ca88e

Browse files
authored
Merge pull request #129 from nix6839/type-generation
Enable type generation
2 parents 02d7879 + 1711e57 commit 39ca88e

24 files changed

+216
-54
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@rollup/plugin-commonjs": "^22.0.2",
5252
"@rollup/plugin-json": "^4.1.0",
5353
"@rollup/plugin-node-resolve": "^14.1.0",
54-
"@tsconfig/node16": "^16.1.0",
54+
"@tsconfig/node20": "^20.1.2",
5555
"@types/eslint": "^8.40.2",
5656
"@types/estraverse": "^5.1.7",
5757
"@types/fs-extra": "^9.0.13",
@@ -80,7 +80,7 @@
8080
"rollup": "^2.79.1",
8181
"ts-jest": "^29.1.1",
8282
"ts-node": "^10.9.1",
83-
"typescript": "^5.1.6"
83+
"typescript": "^5.4.2"
8484
},
8585
"peerDependencies": {
8686
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"

pnpm-lock.yaml

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

src/configs/recommended.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* FIXME: remove this comments and import when below issue is fixed.
3+
* This import is necessary for type generation due to a bug in the TypeScript compiler.
4+
* See: https://github.com/microsoft/TypeScript/issues/42873
5+
*/
6+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7+
import type { TSESLint } from "@typescript-eslint/utils";
8+
19
import { plugin } from "../plugin";
210

311
const recommended = {

src/configs/typescript.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* FIXME: remove this comments and import when below issue is fixed.
3+
* This import is necessary for type generation due to a bug in the TypeScript compiler.
4+
* See: https://github.com/microsoft/TypeScript/issues/42873
5+
*/
6+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7+
import type { TSESLint } from "@typescript-eslint/utils";
8+
19
import recommended from "./recommended";
210

311
const typescript = {

src/index.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* FIXME: remove this comments and import when below issue is fixed.
3+
* This import is necessary for type generation due to a bug in the TypeScript compiler.
4+
* See: https://github.com/microsoft/TypeScript/issues/42873
5+
*/
6+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7+
import type { TSESLint } from "@typescript-eslint/utils";
8+
19
import { plugin } from "./plugin";
210
import recommendedConfig from "./configs/recommended";
311
import typescriptConfig from "./configs/typescript";
@@ -27,5 +35,6 @@ const pluginLegacy = {
2735
},
2836
},
2937
};
30-
// Must be module.exports for eslint to load everything
31-
module.exports = pluginLegacy;
38+
39+
// Must be `export = ` for eslint to load everything
40+
export = pluginLegacy;

src/plugin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* FIXME: remove this comments and import when below issue is fixed.
3+
* This import is necessary for type generation due to a bug in the TypeScript compiler.
4+
* See: https://github.com/microsoft/TypeScript/issues/42873
5+
*/
6+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7+
import type { TSESLint } from "@typescript-eslint/utils";
8+
19
import componentsReturnOnce from "./rules/components-return-once";
210
import eventHandlers from "./rules/event-handlers";
311
import imports from "./rules/imports";

src/rules/components-return-once.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* FIXME: remove this comments and import when below issue is fixed.
3+
* This import is necessary for type generation due to a bug in the TypeScript compiler.
4+
* See: https://github.com/microsoft/TypeScript/issues/42873
5+
*/
6+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7+
import type { TSESLint } from "@typescript-eslint/utils";
8+
19
import { TSESTree as T, ESLintUtils } from "@typescript-eslint/utils";
210
import { getFunctionName, type FunctionNode } from "../utils";
311

0 commit comments

Comments
 (0)