Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ Before submitting your contribution though, please make sure to take a moment an
- `packages/utilities/var`: TSESTree AST utility module for static analysis of variables
- `packages/utilities/jsx`: TSESTree AST utility module for static analysis of JSX.
- `packages/core`: Utility module for static analysis of React core APIs and Patterns.
- `packages/types`: Type definitions.
- `packages/shared`: Shared constants and functions.
- `packages/shared`: Shared constants, types and functions.
- `website`: The documentation website for ESLint React.

### Developing Documentation
Expand Down
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"@eslint-react/eff": "workspace:*",
"@eslint-react/jsx": "workspace:*",
"@eslint-react/shared": "workspace:*",
"@eslint-react/types": "workspace:*",
"@eslint-react/var": "workspace:*",
"@typescript-eslint/scope-manager": "^8.19.1",
"@typescript-eslint/type-utils": "^8.19.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/component/component-collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as AST from "@eslint-react/ast";
import { _ } from "@eslint-react/eff";
import * as JSX from "@eslint-react/jsx";
import type { RuleContext } from "@eslint-react/types";
import type { RuleContext } from "@eslint-react/shared";
import type { TSESTree } from "@typescript-eslint/types";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
import type { ESLintUtils } from "@typescript-eslint/utils";
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/component/component-id.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as AST from "@eslint-react/ast";
import { _ } from "@eslint-react/eff";
import type { RuleContext } from "@eslint-react/types";
import type { RuleContext } from "@eslint-react/shared";
import type { TSESTree } from "@typescript-eslint/types";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/component/misc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as AST from "@eslint-react/ast";
import type { RuleContext } from "@eslint-react/types";
import type { RuleContext } from "@eslint-react/shared";

import { getFunctionComponentIdentifier } from "./component-id";
import { isComponentName } from "./component-name";
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/element/element-name.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as JSX from "@eslint-react/jsx";
import type { CustomComponentNormalized } from "@eslint-react/shared";
import type { RuleContext } from "@eslint-react/types";
import type { CustomComponentNormalized, RuleContext } from "@eslint-react/shared";
import * as VAR from "@eslint-react/var";
import type { TSESTree } from "@typescript-eslint/types";

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/element/hierarchy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as AST from "@eslint-react/ast";
import type { RuleContext } from "@eslint-react/types";
import type { RuleContext } from "@eslint-react/shared";
import type { TSESTree } from "@typescript-eslint/types";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/hook/is.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as AST from "@eslint-react/ast";
import { _, flip, returnFalse } from "@eslint-react/eff";
import type { RuleContext } from "@eslint-react/shared";
import { unsafeDecodeSettings } from "@eslint-react/shared";
import type { RuleContext } from "@eslint-react/types";
import type { TSESTree } from "@typescript-eslint/types";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/render-prop/is.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as AST from "@eslint-react/ast";
import * as JSX from "@eslint-react/jsx";
import type { RuleContext } from "@eslint-react/types";
import type { RuleContext } from "@eslint-react/shared";
import type { TSESTree } from "@typescript-eslint/types";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils/is-from-react.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as AST from "@eslint-react/ast";
import { dual } from "@eslint-react/eff";
import type { RuleContext } from "@eslint-react/shared";
import { unsafeDecodeSettings } from "@eslint-react/shared";
import type { RuleContext } from "@eslint-react/types";
import type { TSESTree } from "@typescript-eslint/types";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";

Expand Down
1 change: 0 additions & 1 deletion packages/plugins/eslint-plugin-react-debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@eslint-react/eff": "workspace:*",
"@eslint-react/jsx": "workspace:*",
"@eslint-react/shared": "workspace:*",
"@eslint-react/types": "workspace:*",
"@eslint-react/var": "workspace:*",
"@typescript-eslint/scope-manager": "^8.19.1",
"@typescript-eslint/type-utils": "^8.19.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useComponentCollectorLegacy } from "@eslint-react/core";
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";
import type { CamelCase } from "string-ts";

import { createRule } from "../utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DEFAULT_COMPONENT_HINT, ERFunctionComponentFlag, useComponentCollector } from "@eslint-react/core";
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";
import type { CamelCase } from "string-ts";

import { createRule } from "../utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useHookCollector } from "@eslint-react/core";
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";
import type { CamelCase } from "string-ts";

import { createRule } from "../utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isInitializedFromReact } from "@eslint-react/core";
import type { RuleFeature } from "@eslint-react/shared";
import { getSettingsFromContext } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import type { Scope } from "@typescript-eslint/scope-manager";
import type { TSESTree } from "@typescript-eslint/utils";
import { AST_NODE_TYPES as T } from "@typescript-eslint/utils";
Expand Down
1 change: 0 additions & 1 deletion packages/plugins/eslint-plugin-react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@eslint-react/eff": "workspace:*",
"@eslint-react/jsx": "workspace:*",
"@eslint-react/shared": "workspace:*",
"@eslint-react/types": "workspace:*",
"@eslint-react/var": "workspace:*",
"@typescript-eslint/scope-manager": "^8.19.1",
"@typescript-eslint/types": "^8.19.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as JSX from "@eslint-react/jsx";
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";
import type { TSESTree } from "@typescript-eslint/types";
import type { CamelCase } from "string-ts";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as JSX from "@eslint-react/jsx";
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";
import type { CamelCase } from "string-ts";

import { createRule } from "../utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
import type { CamelCase } from "string-ts";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getElementNameAndRepresentName } from "@eslint-react/core";
import type { RuleFeature } from "@eslint-react/shared";
import { getSettingsFromContext } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import type { CamelCase } from "string-ts";

import { createRule, getAdditionalAttributes, getAttributeStringValue } from "../utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getElementNameAndRepresentName } from "@eslint-react/core";
import type { RuleFeature } from "@eslint-react/shared";
import { getSettingsFromContext } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import type { CamelCase } from "string-ts";

import { createRule, getAdditionalAttributes, getAttributeStringValue } from "../utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as JSX from "@eslint-react/jsx";
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";
import type { CamelCase } from "string-ts";

import { createRule } from "../utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as AST from "@eslint-react/ast";
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
import type { CamelCase } from "string-ts";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as JSX from "@eslint-react/jsx";
import type { RuleFeature } from "@eslint-react/shared";
import { RE_JAVASCRIPT_PROTOCOL } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import * as VAR from "@eslint-react/var";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
import type { CamelCase } from "string-ts";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { getSettingsFromContext } from "@eslint-react/shared";
import { createRule } from "../utils";
import { compare, compareVersions } from "compare-versions";
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";

// ------------------------------------------------------------------------------
// Constants
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getElementNameAndRepresentName } from "@eslint-react/core";
import type { RuleFeature } from "@eslint-react/shared";
import { getSettingsFromContext } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import type { CamelCase } from "string-ts";

import { createRule, getAdditionalAttributes, getAttributeStringValue } from "../utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getElementNameAndRepresentName } from "@eslint-react/core";
import type { _ } from "@eslint-react/eff";
import type { RuleFeature } from "@eslint-react/shared";
import { getSettingsFromContext } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import type { TSESTree } from "@typescript-eslint/utils";
import type { CamelCase } from "string-ts";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as JSX from "@eslint-react/jsx";
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";
import type { CamelCase } from "string-ts";

import { createRule } from "../utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { _, identity } from "@eslint-react/eff";
import * as JSX from "@eslint-react/jsx";
import type { CustomComponentNormalized } from "@eslint-react/shared";
import type { RuleContext } from "@eslint-react/types";
import type { CustomComponentNormalized, RuleContext } from "@eslint-react/shared";
import * as VAR from "@eslint-react/var";
import type { TSESTree } from "@typescript-eslint/types";
import { match, P } from "ts-pattern";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"@eslint-react/eff": "workspace:*",
"@eslint-react/jsx": "workspace:*",
"@eslint-react/shared": "workspace:*",
"@eslint-react/types": "workspace:*",
"@eslint-react/var": "workspace:*",
"@typescript-eslint/scope-manager": "^8.19.1",
"@typescript-eslint/type-utils": "^8.19.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as AST from "@eslint-react/ast";
import { isReactHookCallWithNameAlias } from "@eslint-react/core";
import { _, getOrUpdate } from "@eslint-react/eff";
import type { RuleFeature } from "@eslint-react/shared";
import { getSettingsFromContext } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import * as VAR from "@eslint-react/var";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
import type { TSESTree } from "@typescript-eslint/utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as AST from "@eslint-react/ast";
import { isReactHookCallWithNameAlias } from "@eslint-react/core";
import { _, getOrUpdate } from "@eslint-react/eff";
import type { RuleFeature } from "@eslint-react/shared";
import { getSettingsFromContext } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import * as VAR from "@eslint-react/var";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
import type { TSESTree } from "@typescript-eslint/utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as AST from "@eslint-react/ast";
import { isReactHookCall, isReactHookCallWithNameLoose, isUseCallbackCall } from "@eslint-react/core";
import { _, identity } from "@eslint-react/eff";
import type { RuleFeature } from "@eslint-react/shared";
import { getSettingsFromContext } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import * as VAR from "@eslint-react/var";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
import type { CamelCase } from "string-ts";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as AST from "@eslint-react/ast";
import { isReactHookCall, isReactHookCallWithNameLoose, isUseMemoCall } from "@eslint-react/core";
import { _, identity } from "@eslint-react/eff";
import type { RuleFeature } from "@eslint-react/shared";
import { getSettingsFromContext } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import * as VAR from "@eslint-react/var";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
import type { CamelCase } from "string-ts";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as AST from "@eslint-react/ast";
import { useHookCollector } from "@eslint-react/core";
import type { RuleContext, RuleFeature } from "@eslint-react/types";
import type { RuleContext, RuleFeature } from "@eslint-react/shared";
import type { TSESTree } from "@typescript-eslint/types";
import type { CamelCase } from "string-ts";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Ported from https://github.com/jsx-eslint/eslint-plugin-react/pull/3579/commits/ebb739a0fe99a2ee77055870bfda9f67a2691374
import * as AST from "@eslint-react/ast";
import { isReactHookCall, isReactHookCallWithNameLoose, isUseStateCall } from "@eslint-react/core";
import type { RuleFeature } from "@eslint-react/shared";
import { getSettingsFromContext } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import type { CamelCase } from "string-ts";

import { createRule } from "../utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { isReactHookCallWithNameAlias } from "@eslint-react/core";
import { returnTrue } from "@eslint-react/eff";
import type { ESLintReactSettings, REACT_BUILD_IN_HOOKS } from "@eslint-react/shared";
import type { RuleContext } from "@eslint-react/types";
import type { ESLintReactSettings, REACT_BUILD_IN_HOOKS, RuleContext } from "@eslint-react/shared";
import * as VAR from "@eslint-react/var";
import type { TSESTree } from "@typescript-eslint/types";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { ESLintReactSettings } from "@eslint-react/shared";
import type { RuleContext } from "@eslint-react/types";
import type { ESLintReactSettings, RuleContext } from "@eslint-react/shared";
import type { TSESTree } from "@typescript-eslint/types";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { ESLintReactSettings } from "@eslint-react/shared";
import type { RuleContext } from "@eslint-react/types";
import type { ESLintReactSettings, RuleContext } from "@eslint-react/shared";
import * as VAR from "@eslint-react/var";
import type { TSESTree } from "@typescript-eslint/types";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@eslint-react/eff": "workspace:*",
"@eslint-react/jsx": "workspace:*",
"@eslint-react/shared": "workspace:*",
"@eslint-react/types": "workspace:*",
"@typescript-eslint/scope-manager": "^8.19.1",
"@typescript-eslint/type-utils": "^8.19.1",
"@typescript-eslint/types": "^8.19.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useComponentCollector, useComponentCollectorLegacy } from "@eslint-reac
import type { _ } from "@eslint-react/eff";
import { returnFalse } from "@eslint-react/eff";
import * as JSX from "@eslint-react/jsx";
import type { RuleFeature } from "@eslint-react/shared";
import { RE_CONSTANT_CASE, RE_PASCAL_CASE } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import type { JSONSchema4 } from "@typescript-eslint/utils/json-schema";
import type { CamelCase } from "string-ts";
import { match } from "ts-pattern";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isObject } from "@eslint-react/eff";
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";
import type { JSONSchema4 } from "@typescript-eslint/utils/json-schema";

import { createRule } from "../utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from "node:path";

import type { RuleFeature } from "@eslint-react/shared";
import { RE_CAMEL_CASE, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import type { JSONSchema4 } from "@typescript-eslint/utils/json-schema";
import { camelCase, kebabCase, pascalCase, snakeCase } from "string-ts";
import { match } from "ts-pattern";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
isUseStateCall,
useComponentCollector,
} from "@eslint-react/core";
import type { RuleFeature } from "@eslint-react/shared";
import { getSettingsFromContext } from "@eslint-react/shared";
import type { RuleFeature } from "@eslint-react/types";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
import type { CamelCase } from "string-ts";
import { capitalize } from "string-ts";
Expand Down
1 change: 0 additions & 1 deletion packages/plugins/eslint-plugin-react-web-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@eslint-react/eff": "workspace:*",
"@eslint-react/jsx": "workspace:*",
"@eslint-react/shared": "workspace:*",
"@eslint-react/types": "workspace:*",
"@eslint-react/var": "workspace:*",
"@typescript-eslint/scope-manager": "^8.19.1",
"@typescript-eslint/types": "^8.19.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { EREffectMethodKind, ERLifecycleMethodKind, ERPhaseKind } from "@es
import { ERPhaseRelevance, isInversePhase } from "@eslint-react/core";
import { _ } from "@eslint-react/eff";
import * as JSX from "@eslint-react/jsx";
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";
import * as VAR from "@eslint-react/var";
import type { Scope } from "@typescript-eslint/scope-manager";
import type { TSESTree } from "@typescript-eslint/utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type * as AST from "@eslint-react/ast";
import type { EREffectMethodKind, ERLifecycleMethodKind, ERPhaseKind } from "@eslint-react/core";
import { ERPhaseRelevance } from "@eslint-react/core";
import type { RuleFeature } from "@eslint-react/types";
import type { RuleFeature } from "@eslint-react/shared";
import * as VAR from "@eslint-react/var";
import type { TSESTree } from "@typescript-eslint/utils";
import { AST_NODE_TYPES as T } from "@typescript-eslint/utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as AST from "@eslint-react/ast";
import type { EREffectMethodKind, ERPhaseKind } from "@eslint-react/core";
import { ERPhaseRelevance } from "@eslint-react/core";
import { _, or } from "@eslint-react/eff";
import type { RuleContext, RuleFeature } from "@eslint-react/types";
import type { RuleContext, RuleFeature } from "@eslint-react/shared";
import * as VAR from "@eslint-react/var";
import type { TSESTree } from "@typescript-eslint/utils";
import { AST_NODE_TYPES as T } from "@typescript-eslint/utils";
Expand Down
Loading
Loading