Skip to content

Commit

Permalink
Add imports for type generation
Browse files Browse the repository at this point in the history
Revert this commit when following TypeScript issue is fixed: microsoft/TypeScript#42873
  • Loading branch information
nix6839 committed Mar 10, 2024
1 parent 02d7879 commit 8ccc56e
Show file tree
Hide file tree
Showing 20 changed files with 160 additions and 0 deletions.
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
8 changes: 8 additions & 0 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
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
8 changes: 8 additions & 0 deletions src/rules/event-handlers.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, ASTUtils } from "@typescript-eslint/utils";
import { isDOMElementName } from "../utils";

Expand Down
8 changes: 8 additions & 0 deletions src/rules/jsx-no-duplicate-props.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 { jsxGetAllProps } from "../utils";

Expand Down
8 changes: 8 additions & 0 deletions src/rules/jsx-no-script-url.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 { ESLintUtils, ASTUtils } from "@typescript-eslint/utils";

const createRule = ESLintUtils.RuleCreator.withoutDocs;
Expand Down
8 changes: 8 additions & 0 deletions src/rules/jsx-no-undef.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 { isDOMElementName, formatList, appendImports, insertImports } from "../utils";

Expand Down
8 changes: 8 additions & 0 deletions src/rules/jsx-uses-vars.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";

const createRule = ESLintUtils.RuleCreator.withoutDocs;
Expand Down
8 changes: 8 additions & 0 deletions src/rules/no-array-handlers.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 { isDOMElementName, trace } from "../utils";

Expand Down
8 changes: 8 additions & 0 deletions src/rules/no-innerhtml.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 { ESLintUtils, ASTUtils } from "@typescript-eslint/utils";
import isHtml from "is-html";
import { jsxPropName } from "../utils";
Expand Down
8 changes: 8 additions & 0 deletions src/rules/no-proxy-apis.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 { isFunctionNode, trackImports, isPropsByName, trace } from "../utils";

Expand Down
8 changes: 8 additions & 0 deletions src/rules/no-react-deps.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 { ESLintUtils } from "@typescript-eslint/utils";
import { isFunctionNode, trace, trackImports } from "../utils";

Expand Down
8 changes: 8 additions & 0 deletions src/rules/no-unknown-namespaces.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 { ESLintUtils, TSESTree as T } from "@typescript-eslint/utils";
import { isDOMElementName } from "../utils";

Expand Down
8 changes: 8 additions & 0 deletions src/rules/prefer-classlist.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 { ESLintUtils, TSESTree as T } from "@typescript-eslint/utils";
import { jsxHasProp, jsxPropName } from "../utils";

Expand Down
8 changes: 8 additions & 0 deletions src/rules/prefer-for.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, ASTUtils } from "@typescript-eslint/utils";
import { isFunctionNode, isJSXElementOrFragment } from "../utils";

Expand Down
8 changes: 8 additions & 0 deletions src/rules/prefer-show.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 { isJSXElementOrFragment } from "../utils";

Expand Down
8 changes: 8 additions & 0 deletions src/rules/self-closing-comp.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 { isDOMElementName } from "../utils";

Expand Down
8 changes: 8 additions & 0 deletions src/rules/style-prop.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, ASTUtils } from "@typescript-eslint/utils";
import kebabCase from "kebab-case";
import { all as allCssProperties } from "known-css-properties";
Expand Down

0 comments on commit 8ccc56e

Please sign in to comment.