Skip to content

Commit

Permalink
Merge branch 'main' into no-use-in-try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Rel1cx authored Feb 26, 2025
2 parents da59b14 + 514b856 commit 3c5339e
Show file tree
Hide file tree
Showing 41 changed files with 89 additions and 283 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Before submitting your contribution though, please make sure to take a moment an

## Pull Request Guidelines

- You have to [sign your commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits).
- **You have to [sign your commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)**.

- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.28.1-beta.1
1.28.1-beta.2
55 changes: 4 additions & 51 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,106 +6,59 @@
"node",
"html",
"typescript",
"csharp",
"scala",
"fonts",
"filetypes",
"misc"
],
"ignorePaths": [
".vscode/**/*",
"**/*.spec.ts",
"**/*.svg",
"**/*/docs/**/*",
".vscode/**/*",
"apps/website/public/**/*",
"assets/**/*",
"bun.lockb",
"package.json",
"pnpm-lock.yaml",
"README.md",
"test/fixtures",
"apps/website/public/**/*",
"THIRD-PARTY-LICENSE",
"README.md"
"THIRD-PARTY-LICENSE"
],
"useGitignore": true,
"words": [
"adrs",
"aile",
"arrs",
"bimap",
"birecord",
"clippy",
"codemod",
"consequents",
"declarators",
"deepmerge",
"dprint",
"er",
"fastpaths",
"flexsearch",
"frontmatter",
"greenlighted",
"hatchpath",
"hoistable",
"hrefs",
"iifes",
"imjordanxd",
"importx",
"innerhtml",
"knip",
"lefthook",
"lifecycles",
"linebreak",
"linting",
"lockb",
"mantine",
"metas",
"monaspace",
"neovov",
"nocheck",
"noninteractive",
"noto",
"oentries",
"opengraph",
"pantajoe",
"pathe",
"pattycake",
"picomatch",
"preact",
"prevs",
"purry",
"quasis",
"reactdom",
"reactjs",
"reactx",
"rehype",
"remeda",
"ress",
"rizzzse",
"setstate",
"shiki",
"shuding",
"signoff",
"sonarjs",
"superbytes",
"susisu",
"tanstack",
"tascript",
"taze",
"textnode",
"textnodes",
"tinyglobby",
"todos",
"treeshake",
"tses",
"tsesast",
"tseslint",
"tsup",
"twoslash",
"typeclass",
"uentries",
"uncast",
"undeprecate",
"unoptimized",
"valibot",
"weakref"
]
Expand Down
2 changes: 1 addition & 1 deletion examples/dual-react-dom-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"peerDependencies": {
"react": "^19.0.0"
},
"packageManager": "pnpm@10.5.0",
"packageManager": "pnpm@10.5.1",
"engines": {
"node": ">=18.18.0"
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/monorepo",
"version": "1.28.1-beta.1",
"version": "1.28.1-beta.2",
"private": true,
"description": "Monorepo for eslint-plugin-react-[x, dom, web-api, hooks-extra, naming-convention].",
"keywords": [
Expand Down Expand Up @@ -110,7 +110,7 @@
"typescript-eslint": "^8.25.0",
"vitest": "^3.0.7"
},
"packageManager": "pnpm@10.5.0",
"packageManager": "pnpm@10.5.1",
"engines": {
"node": ">=18.18.0"
},
Expand Down
4 changes: 0 additions & 4 deletions packages/core/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
- [isChildrenForEachCall](functions/isChildrenForEachCall.md)
- [isChildrenMap](functions/isChildrenMap.md)
- [isChildrenMapCall](functions/isChildrenMapCall.md)
- [isChildrenOfCreateElement](functions/isChildrenOfCreateElement.md)
- [isChildrenOnly](functions/isChildrenOnly.md)
- [isChildrenOnlyCall](functions/isChildrenOnlyCall.md)
- [isChildrenToArray](functions/isChildrenToArray.md)
Expand All @@ -80,7 +79,6 @@
- [isCreateRef](functions/isCreateRef.md)
- [isCreateRefCall](functions/isCreateRefCall.md)
- [isDeclaredInRenderPropLoose](functions/isDeclaredInRenderPropLoose.md)
- [isDisplayNameAssignment](functions/isDisplayNameAssignment.md)
- [isForwardRef](functions/isForwardRef.md)
- [isForwardRefCall](functions/isForwardRefCall.md)
- [isFromReact](functions/isFromReact.md)
Expand All @@ -95,8 +93,6 @@
- [isGetDerivedStateFromError](functions/isGetDerivedStateFromError.md)
- [isGetDerivedStateFromProps](functions/isGetDerivedStateFromProps.md)
- [isInitializedFromReact](functions/isInitializedFromReact.md)
- [isInsideCreateElementProps](functions/isInsideCreateElementProps.md)
- [isInsideReactHook](functions/isInsideReactHook.md)
- [isInsideRenderMethod](functions/isInsideRenderMethod.md)
- [isInversePhase](functions/isInversePhase.md)
- [isMemo](functions/isMemo.md)
Expand Down
31 changes: 0 additions & 31 deletions packages/core/docs/functions/isChildrenOfCreateElement.md

This file was deleted.

25 changes: 0 additions & 25 deletions packages/core/docs/functions/isDisplayNameAssignment.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

### node

[`Node`](../-internal-/type-aliases/Node.md)
`undefined` | [`Node`](../-internal-/type-aliases/Node.md)

## Returns

Expand Down
31 changes: 0 additions & 31 deletions packages/core/docs/functions/isInsideCreateElementProps.md

This file was deleted.

19 changes: 0 additions & 19 deletions packages/core/docs/functions/isInsideReactHook.md

This file was deleted.

8 changes: 1 addition & 7 deletions packages/core/docs/functions/useComponentCollector.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Function: useComponentCollector()

> **useComponentCollector**(`context`, `hint`, `options`): [`ReturnType`](../namespaces/useComponentCollector/type-aliases/ReturnType.md)
> **useComponentCollector**(`context`, `options`): [`ReturnType`](../namespaces/useComponentCollector/type-aliases/ReturnType.md)
Get a ctx and listeners for the rule to collect function components

Expand All @@ -18,12 +18,6 @@ Get a ctx and listeners for the rule to collect function components

The ESLint rule context

### hint

`bigint` = `DEFAULT_COMPONENT_HINT`

The hint to use

### options

[`Options`](../namespaces/useComponentCollector/type-aliases/Options.md) = `{}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@
### collectHookCalls?

> `optional` **collectHookCalls**: `boolean`
### hint?

> `optional` **hint**: [`ERComponentHint`](../../../type-aliases/ERComponentHint.md)
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/core",
"version": "1.28.1-beta.1",
"version": "1.28.1-beta.2",
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and Patterns.",
"homepage": "https://github.com/Rel1cx/eslint-react",
"bugs": {
Expand Down
12 changes: 8 additions & 4 deletions packages/core/src/component/component-collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import type { TSESTree } from "@typescript-eslint/types";
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
import type { ESLintUtils } from "@typescript-eslint/utils";

import { DISPLAY_NAME_ASSIGNMENT_SELECTOR } from "../constants";
import { isReactHookCall } from "../hook";
import { DISPLAY_NAME_ASSIGNMENT_SELECTOR } from "../utils";
import type { ERComponentHint } from "./component-collector-hint";
import { DEFAULT_COMPONENT_HINT } from "./component-collector-hint";
import { ERComponentFlag } from "./component-flag";
import { getFunctionComponentIdentifier } from "./component-id";
Expand All @@ -27,6 +28,7 @@ export declare namespace useComponentCollector {
type Options = {
collectDisplayName?: boolean;
collectHookCalls?: boolean;
hint?: ERComponentHint;
};
type ReturnType = {
ctx: {
Expand All @@ -41,16 +43,18 @@ export declare namespace useComponentCollector {
/**
* Get a ctx and listeners for the rule to collect function components
* @param context The ESLint rule context
* @param hint The hint to use
* @param options The options to use
* @returns The component collector
*/
export function useComponentCollector(
context: RuleContext,
hint = DEFAULT_COMPONENT_HINT,
options: useComponentCollector.Options = {},
): useComponentCollector.ReturnType {
const { collectDisplayName = false, collectHookCalls = false } = options;
const {
collectDisplayName = false,
collectHookCalls = false,
hint = DEFAULT_COMPONENT_HINT,
} = options;

const jsxCtx = { getScope: (node: TSESTree.Node) => context.sourceCode.getScope(node) } as const;
const components = new Map<string, ERFunctionComponent>();
Expand Down
Loading

0 comments on commit 3c5339e

Please sign in to comment.