Skip to content

Commit

Permalink
Merge pull request #129 from nix6839/type-generation
Browse files Browse the repository at this point in the history
Enable type generation
  • Loading branch information
joshwilsonvu authored Mar 20, 2024
2 parents 02d7879 + 1711e57 commit 39ca88e
Show file tree
Hide file tree
Showing 24 changed files with 216 additions and 54 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^14.1.0",
"@tsconfig/node16": "^16.1.0",
"@tsconfig/node20": "^20.1.2",
"@types/eslint": "^8.40.2",
"@types/estraverse": "^5.1.7",
"@types/fs-extra": "^9.0.13",
Expand Down Expand Up @@ -80,7 +80,7 @@
"rollup": "^2.79.1",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.1.6"
"typescript": "^5.4.2"
},
"peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
Expand Down
98 changes: 49 additions & 49 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

import { plugin } from "../plugin";

const recommended = {
Expand Down
8 changes: 8 additions & 0 deletions src/configs/typescript.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* FIXME: remove this comments and import when below issue is fixed.
* This import is necessary for type generation due to a bug in the TypeScript compiler.
* See: https://github.com/microsoft/TypeScript/issues/42873
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { TSESLint } from "@typescript-eslint/utils";

import recommended from "./recommended";

const typescript = {
Expand Down
13 changes: 11 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* FIXME: remove this comments and import when below issue is fixed.
* This import is necessary for type generation due to a bug in the TypeScript compiler.
* See: https://github.com/microsoft/TypeScript/issues/42873
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { TSESLint } from "@typescript-eslint/utils";

import { plugin } from "./plugin";
import recommendedConfig from "./configs/recommended";
import typescriptConfig from "./configs/typescript";
Expand Down Expand Up @@ -27,5 +35,6 @@ const pluginLegacy = {
},
},
};
// Must be module.exports for eslint to load everything
module.exports = pluginLegacy;

// Must be `export = ` for eslint to load everything
export = pluginLegacy;
8 changes: 8 additions & 0 deletions src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* FIXME: remove this comments and import when below issue is fixed.
* This import is necessary for type generation due to a bug in the TypeScript compiler.
* See: https://github.com/microsoft/TypeScript/issues/42873
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { TSESLint } from "@typescript-eslint/utils";

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

import { TSESTree as T, ESLintUtils } from "@typescript-eslint/utils";
import { getFunctionName, type FunctionNode } from "../utils";

Expand Down
Loading

0 comments on commit 39ca88e

Please sign in to comment.