diff --git a/VERSION b/VERSION index 035784d4fe..08cf96d148 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.24.0-next.9 +1.24.0-next.10 diff --git a/examples/next-app/package.json b/examples/next-app/package.json index 25ec27a420..1aa45586fe 100644 --- a/examples/next-app/package.json +++ b/examples/next-app/package.json @@ -17,7 +17,7 @@ }, "devDependencies": { "@eslint-react/eslint-plugin": "^1.23.2", - "@eslint/config-inspector": "^0.7.1", + "@eslint/config-inspector": "^1.0.0", "@eslint/js": "^9.18.0", "@next/eslint-plugin-next": "^15.1.4", "@types/negotiator": "^0.6.3", diff --git a/examples/vite-react-dom-app/package.json b/examples/vite-react-dom-app/package.json index 0b6cc09573..361c70fa40 100644 --- a/examples/vite-react-dom-app/package.json +++ b/examples/vite-react-dom-app/package.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@eslint-react/eslint-plugin": "^1.23.2", - "@eslint/config-inspector": "^0.7.1", + "@eslint/config-inspector": "^1.0.0", "@eslint/js": "^9.18.0", "@tsconfig/node22": "^22.0.0", "@tsconfig/strictest": "^2.0.5", diff --git a/examples/vite-react-dom-js-app/package.json b/examples/vite-react-dom-js-app/package.json index 4b950b55c4..77c3a6514c 100644 --- a/examples/vite-react-dom-js-app/package.json +++ b/examples/vite-react-dom-js-app/package.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@eslint-react/eslint-plugin": "^1.23.2", - "@eslint/config-inspector": "^0.7.1", + "@eslint/config-inspector": "^1.0.0", "@eslint/js": "^9.18.0", "@types/react": "^19.0.7", "@types/react-dom": "^19.0.3", diff --git a/examples/vite-react-dom-js-with-babel-app/package.json b/examples/vite-react-dom-js-with-babel-app/package.json index fb5589ca21..902c8f8a36 100644 --- a/examples/vite-react-dom-js-with-babel-app/package.json +++ b/examples/vite-react-dom-js-with-babel-app/package.json @@ -20,7 +20,7 @@ "@babel/preset-env": "^7.26.0", "@babel/preset-react": "^7.26.3", "@eslint-react/eslint-plugin": "^1.23.2", - "@eslint/config-inspector": "^0.7.1", + "@eslint/config-inspector": "^1.0.0", "@eslint/js": "^9.18.0", "@types/babel__core": "~7.20.5", "@types/babel__preset-env": "~7.9.7", diff --git a/package.json b/package.json index eb4b68ec6e..9a2c448d24 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/monorepo", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "private": true, "description": "Monorepo for eslint-plugin-react-[x, dom, web-api, hooks-extra, naming-convention].", "keywords": [ @@ -52,7 +52,7 @@ }, "devDependencies": { "@changesets/cli": "^2.27.11", - "@eslint/config-inspector": "^0.7.1", + "@eslint/config-inspector": "^1.0.0", "@eslint/js": "^9.18.0", "@eslint/markdown": "^6.2.1", "@napi-rs/canvas": "^0.1.65", @@ -88,8 +88,8 @@ "eslint-plugin-vitest": "^0.5.4", "fixpkg": "^1.0.2", "jiti": "^2.4.2", - "lefthook": "^1.10.4", - "markdownlint": "^0.37.3", + "lefthook": "^1.10.5", + "markdownlint": "^0.37.4", "ofetch": "^1.4.1", "picocolors": "^1.1.1", "publint": "^0.3.2", diff --git a/packages/core/docs/README.md b/packages/core/docs/README.md index 7cdbff55dc..4d5903af32 100644 --- a/packages/core/docs/README.md +++ b/packages/core/docs/README.md @@ -42,7 +42,6 @@ ## Functions - [getComponentNameFromIdentifier](functions/getComponentNameFromIdentifier.md) -- [getElementNameOnJsxAndHtml](functions/getElementNameOnJsxAndHtml.md) - [getFunctionComponentIdentifier](functions/getFunctionComponentIdentifier.md) - [getId](functions/getId.md) - [hasNoneOrValidComponentName](functions/hasNoneOrValidComponentName.md) diff --git a/packages/core/docs/functions/getElementNameOnJsxAndHtml.md b/packages/core/docs/functions/getElementNameOnJsxAndHtml.md deleted file mode 100644 index 5eedb4cab9..0000000000 --- a/packages/core/docs/functions/getElementNameOnJsxAndHtml.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@eslint-react/core**](../README.md) - -*** - -[@eslint-react/core](../README.md) / getElementNameOnJsxAndHtml - -# Function: getElementNameOnJsxAndHtml() - -> **getElementNameOnJsxAndHtml**(`node`, `context`, `polymorphicPropName`?, `additionalComponents`?): \[`string`, `string`\] - -## Parameters - -### node - -`JSXOpeningElement` - -### context - -`Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> - -### polymorphicPropName? - -`string` - -### additionalComponents? - -`object`[] = `[]` - -## Returns - -\[`string`, `string`\] diff --git a/packages/core/package.json b/packages/core/package.json index 7f6b0d2768..25cd021244 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/core", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "ESLint React's ESLint utility module for static analysis of React core APIs and Patterns.", "homepage": "https://github.com/Rel1cx/eslint-react", "bugs": { diff --git a/packages/core/src/element/index.ts b/packages/core/src/element/index.ts index 15aa700ded..ed51f4bfbd 100644 --- a/packages/core/src/element/index.ts +++ b/packages/core/src/element/index.ts @@ -1,2 +1 @@ -export * from "./element-name"; export * from "./hierarchy"; diff --git a/packages/plugins/eslint-plugin-react-debug/package.json b/packages/plugins/eslint-plugin-react-debug/package.json index d8559169b1..bd5297edd8 100644 --- a/packages/plugins/eslint-plugin-react-debug/package.json +++ b/packages/plugins/eslint-plugin-react-debug/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-debug", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "ESLint React's ESLint plugin for debugging related rules.", "keywords": [ "react", diff --git a/packages/plugins/eslint-plugin-react-dom/package.json b/packages/plugins/eslint-plugin-react-dom/package.json index 2935acc6d0..b8b0c4bcea 100644 --- a/packages/plugins/eslint-plugin-react-dom/package.json +++ b/packages/plugins/eslint-plugin-react-dom/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-dom", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "ESLint React's ESLint plugin for React DOM related rules.", "keywords": [ "react", diff --git a/packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-button-type.spec.ts b/packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-button-type.spec.ts index 9964fcd2a2..27136a0f56 100644 --- a/packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-button-type.spec.ts +++ b/packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-button-type.spec.ts @@ -62,7 +62,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "Button", as: "button", - attributes: [ + props: [ { name: "type", as: "type", diff --git a/packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-button-type.ts b/packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-button-type.ts index 58c989167d..e7f33f302a 100644 --- a/packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-button-type.ts +++ b/packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-button-type.ts @@ -1,9 +1,9 @@ -import { getElementNameOnJsxAndHtml } from "@eslint-react/core"; +import * as JSX from "@eslint-react/jsx"; import type { RuleFeature } from "@eslint-react/shared"; import { getSettingsFromContext } from "@eslint-react/shared"; import type { CamelCase } from "string-ts"; -import { createRule, getAdditionalAttributes, getAttributeNodeAndStringValue } from "../utils"; +import { createRule, findCustomComponent, findCustomComponentProp, getElementNameOnJsxAndDom } from "../utils"; export const RULE_NAME = "no-missing-button-type"; @@ -30,26 +30,43 @@ export default createRule<[], MessageID>({ const settings = getSettingsFromContext(context); const polymorphicPropName = settings.polymorphicPropName; const additionalComponents = settings.additionalComponents.filter((c) => c.as === "button"); + return { JSXElement(node) { - const [elementNameOnJsx, elementNameOnHtml] = getElementNameOnJsxAndHtml( + const [elementNameOnJsx, elementNameOnDom] = getElementNameOnJsxAndDom( node.openingElement, context, polymorphicPropName, additionalComponents, ); - if (elementNameOnHtml !== "button") return; - const { attributeNode, attributeValue } = getAttributeNodeAndStringValue( - "type", - node, - context, - getAdditionalAttributes(elementNameOnJsx, additionalComponents), + if (elementNameOnDom !== "button") return; + + const elementScope = context.sourceCode.getScope(node); + const customComponent = findCustomComponent(elementNameOnJsx, additionalComponents); + const customComponentProp = findCustomComponentProp("type", customComponent?.props ?? []); + const propNameOnJsx = customComponentProp?.name ?? "type"; + const attributeNode = JSX.getAttributeNode( + propNameOnJsx, + elementScope, + node.openingElement.attributes, ); - if (typeof attributeValue !== "string") { + if (attributeNode != null) { + const attributeScope = context.sourceCode.getScope(attributeNode); + const attributeStaticValue = JSX.getAttributeStaticValue(attributeNode, attributeScope); + const attributeStringValue = JSX.toResolvedAttributeValue(propNameOnJsx, attributeStaticValue); + if (typeof attributeStringValue !== "string") { + context.report({ + messageId: "noMissingButtonType", + node: attributeNode, + }); + } + return; + } + if (typeof customComponentProp?.defaultValue !== "string") { context.report({ messageId: "noMissingButtonType", - node: attributeNode ?? node, + node, }); } }, diff --git a/packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-iframe-sandbox.ts b/packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-iframe-sandbox.ts index 95e5763240..3b0131e86b 100644 --- a/packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-iframe-sandbox.ts +++ b/packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-iframe-sandbox.ts @@ -1,9 +1,10 @@ -import { getElementNameOnJsxAndHtml } from "@eslint-react/core"; +import type { _ } from "@eslint-react/eff"; +import * as JSX from "@eslint-react/jsx"; import type { RuleFeature } from "@eslint-react/shared"; import { getSettingsFromContext } from "@eslint-react/shared"; import type { CamelCase } from "string-ts"; -import { createRule, getAdditionalAttributes, getAttributeNodeAndStringValue } from "../utils"; +import { createRule, findCustomComponent, findCustomComponentProp, getElementNameOnJsxAndDom } from "../utils"; export const RULE_NAME = "no-missing-iframe-sandbox"; @@ -32,6 +33,13 @@ const validTypes = [ "allow-top-navigation-to-custom-protocols", ] as const; +function hasValidSandBox(value: string | _) { + return typeof value === "string" + && value + .split(" ") + .every((value) => validTypes.some((valid) => valid === value)); +} + export default createRule<[], MessageID>({ meta: { type: "problem", @@ -51,29 +59,41 @@ export default createRule<[], MessageID>({ const additionalComponents = settings.additionalComponents.filter((c) => c.as === "iframe"); return { JSXElement(node) { - const [elementNameOnJsx, elementNameOnHtml] = getElementNameOnJsxAndHtml( + const [elementNameOnJsx, elementNameOnDom] = getElementNameOnJsxAndDom( node.openingElement, context, polymorphicPropName, additionalComponents, ); - if (elementNameOnHtml !== "iframe") return; - const { attributeNode, attributeValue } = getAttributeNodeAndStringValue( - "sandbox", - node, - context, - getAdditionalAttributes(elementNameOnJsx, additionalComponents), + if (elementNameOnDom !== "iframe") return; + + const elementScope = context.sourceCode.getScope(node); + const customComponent = findCustomComponent(elementNameOnJsx, additionalComponents); + const customComponentProp = findCustomComponentProp("sandbox", customComponent?.props ?? []); + const propNameOnJsx = customComponentProp?.name ?? "sandbox"; + const attributeNode = JSX.getAttributeNode( + propNameOnJsx, + elementScope, + node.openingElement.attributes, ); - const hasValidSandboxValue = typeof attributeValue === "string" - && attributeValue - .split(" ") - .every((value) => validTypes.some((valid) => valid === value)); - if (hasValidSandboxValue) return; - context.report({ - messageId: "noMissingIframeSandbox", - node: attributeNode ?? node.openingElement, - }); + if (attributeNode != null) { + const attributeScope = context.sourceCode.getScope(attributeNode); + const attributeStaticValue = JSX.getAttributeStaticValue(attributeNode, attributeScope); + const attributeStringValue = JSX.toResolvedAttributeValue(propNameOnJsx, attributeStaticValue); + if (hasValidSandBox(attributeStringValue)) return; + context.report({ + messageId: "noMissingIframeSandbox", + node: attributeNode, + }); + return; + } + if (!hasValidSandBox(customComponentProp?.defaultValue)) { + context.report({ + messageId: "noMissingIframeSandbox", + node, + }); + } }, }; }, diff --git a/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-iframe-sandbox.ts b/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-iframe-sandbox.ts index 6aa83e979b..08a32579ac 100644 --- a/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-iframe-sandbox.ts +++ b/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-iframe-sandbox.ts @@ -1,9 +1,10 @@ -import { getElementNameOnJsxAndHtml } from "@eslint-react/core"; +import type { _ } from "@eslint-react/eff"; +import * as JSX from "@eslint-react/jsx"; import type { RuleFeature } from "@eslint-react/shared"; import { getSettingsFromContext } from "@eslint-react/shared"; import type { CamelCase } from "string-ts"; -import { createRule, getAdditionalAttributes, getAttributeNodeAndStringValue } from "../utils"; +import { createRule, findCustomComponent, findCustomComponentProp, getElementNameOnJsxAndDom } from "../utils"; export const RULE_NAME = "no-unsafe-iframe-sandbox"; @@ -13,11 +14,17 @@ export const RULE_FEATURES = [ export type MessageID = CamelCase; -const unsafeCombinations = [ +const unsafeSandboxValues = [ ["allow-scripts", "allow-same-origin"], ] as const; -// TODO: Use the information in `settings["react-x"].additionalComponents` to add support for user-defined components that add the 'sandbox' attribute internally. +function hasNoneOrSafeSandbox(value: string | _) { + if (value == null) return true; + return !unsafeSandboxValues.some((values) => { + return values.every((v) => value.includes(v)); + }); +} + export default createRule<[], MessageID>({ meta: { type: "problem", @@ -37,26 +44,41 @@ export default createRule<[], MessageID>({ const additionalComponents = settings.additionalComponents.filter((c) => c.as === "iframe"); return { JSXElement(node) { - const [elementNameOnJsx, elementNameOnHtml] = getElementNameOnJsxAndHtml( + const [elementNameOnJsx, elementNameOnDom] = getElementNameOnJsxAndDom( node.openingElement, context, polymorphicPropName, additionalComponents, ); - if (elementNameOnHtml !== "iframe") return; - const { attributeNode, attributeValue } = getAttributeNodeAndStringValue( - "sandbox", - node, - context, - getAdditionalAttributes(elementNameOnJsx, additionalComponents), + if (elementNameOnDom !== "iframe") return; + + const elementScope = context.sourceCode.getScope(node); + const customComponent = findCustomComponent(elementNameOnJsx, additionalComponents); + const customComponentProp = findCustomComponentProp("sandbox", customComponent?.props ?? []); + const propNameOnJsx = customComponentProp?.name ?? "sandbox"; + const attributeNode = JSX.getAttributeNode( + propNameOnJsx, + elementScope, + node.openingElement.attributes, ); - if (attributeValue == null) return; - if (!unsafeCombinations.some((c) => c.every((v) => attributeValue.includes(v)))) return; - context.report({ - messageId: "noUnsafeIframeSandbox", - node: attributeNode ?? node.openingElement, - }); + if (attributeNode != null) { + const attributeScope = context.sourceCode.getScope(attributeNode); + const attributeStaticValue = JSX.getAttributeStaticValue(attributeNode, attributeScope); + const attributeStringValue = JSX.toResolvedAttributeValue(propNameOnJsx, attributeStaticValue); + if (hasNoneOrSafeSandbox(attributeStringValue)) return; + context.report({ + messageId: "noUnsafeIframeSandbox", + node: attributeNode, + }); + return; + } + if (!hasNoneOrSafeSandbox(customComponentProp?.defaultValue)) { + context.report({ + messageId: "noUnsafeIframeSandbox", + node, + }); + } }, }; }, diff --git a/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-target-blank.spec.ts b/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-target-blank.spec.ts index 6d7e86ef5d..03f481d501 100644 --- a/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-target-blank.spec.ts +++ b/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-target-blank.spec.ts @@ -80,7 +80,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "Link", as: "a", - attributes: [ + props: [ { name: "to", as: "href", @@ -110,7 +110,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "Link", as: "a", - attributes: [{ + props: [{ name: "rel", defaultValue: "noopener", }], @@ -118,7 +118,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "LinkButton", as: "a", - attributes: [ + props: [ { name: "relation", as: "rel", @@ -142,7 +142,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "Link", as: "a", - attributes: [{ + props: [{ name: "rel", defaultValue: "noreferrer", }], @@ -150,7 +150,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "LinkButton", as: "a", - attributes: [ + props: [ { name: "relation", as: "rel", @@ -173,7 +173,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "Link", as: "a", - attributes: [ + props: [ { name: "target", defaultValue: "_blank", @@ -260,7 +260,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "LinkButton", as: "a", - attributes: [{ + props: [{ name: "rel", defaultValue: "noreferrer", }], @@ -277,7 +277,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "LinkButton", as: "a", - attributes: [{ + props: [{ name: "rel", defaultValue: "noreferrer", }], @@ -285,7 +285,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "LinkButton", as: "a", - attributes: [ + props: [ { name: "to", as: "href", @@ -309,7 +309,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "LinkButton", as: "a", - attributes: [ + props: [ { name: "to", as: "href", @@ -336,7 +336,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "Link", as: "a", - attributes: [{ + props: [{ name: "rel", defaultValue: "noreferrer noopener", }], @@ -344,7 +344,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "LinkButton", as: "a", - attributes: [ + props: [ { name: "relation", as: "rel", @@ -366,7 +366,7 @@ ruleTester.run(RULE_NAME, rule, { { name: "Link", as: "a", - attributes: [ + props: [ { name: "target", defaultValue: "_blank", @@ -392,7 +392,7 @@ ruleTester.run(RULE_NAME, rule, { // { // name: "Button", // as: "a", - // attributes: [ + // props: [ // { // name: "target", // defaultValue: "_blank", @@ -415,7 +415,7 @@ ruleTester.run(RULE_NAME, rule, { // { // name: "*", // as: "a", - // attributes: [ + // props: [ // { // name: "target", // defaultValue: "_blank", diff --git a/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-target-blank.ts b/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-target-blank.ts index b87c387743..657967e791 100644 --- a/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-target-blank.ts +++ b/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-target-blank.ts @@ -1,11 +1,11 @@ -import { getElementNameOnJsxAndHtml } from "@eslint-react/core"; import type { _ } from "@eslint-react/eff"; +import * as JSX from "@eslint-react/jsx"; import type { RuleFeature } from "@eslint-react/shared"; import { getSettingsFromContext } from "@eslint-react/shared"; -import type { TSESTree } from "@typescript-eslint/utils"; +import type { TSESTree } from "@typescript-eslint/types"; import type { CamelCase } from "string-ts"; -import { createRule, getAdditionalAttributes, getAttributeNodeAndStringValue } from "../utils"; +import { createRule, findCustomComponent, findCustomComponentProp, getElementNameOnJsxAndDom } from "../utils"; export const RULE_NAME = "no-unsafe-target-blank"; @@ -45,24 +45,31 @@ export default createRule<[], MessageID>({ const settings = getSettingsFromContext(context); const polymorphicPropName = settings.polymorphicPropName; const additionalComponents = settings.additionalComponents.filter((c) => c.as === "a"); + return { JSXElement(node: TSESTree.JSXElement) { - const [elementNameOnJsx, elementNameOnHtml] = getElementNameOnJsxAndHtml( + const [elementNameOnJsx, elementNameOnDom] = getElementNameOnJsxAndDom( node.openingElement, context, polymorphicPropName, additionalComponents, ); - - if (elementNameOnHtml !== "a") return; + if (elementNameOnDom !== "a") return; + const elementScope = context.sourceCode.getScope(node); + const customComponent = findCustomComponent(elementNameOnJsx, additionalComponents); const getAttributeValue = (name: string) => { - return getAttributeNodeAndStringValue( - name, - node, - context, - getAdditionalAttributes(elementNameOnJsx, additionalComponents), - ).attributeValue; + const customComponentProp = findCustomComponentProp(name, customComponent?.props ?? []); + const propNameOnJsx = customComponentProp?.name ?? name; + const attributeNode = JSX.getAttributeNode( + propNameOnJsx, + elementScope, + node.openingElement.attributes, + ); + if (attributeNode == null) return customComponentProp?.defaultValue; + const attributeScope = context.sourceCode.getScope(attributeNode); + const attributeStaticValue = JSX.getAttributeStaticValue(attributeNode, attributeScope); + return JSX.toResolvedAttributeValue(propNameOnJsx, attributeStaticValue); }; if (getAttributeValue("target") !== "_blank") { diff --git a/packages/plugins/eslint-plugin-react-dom/src/utils/attribute.ts b/packages/plugins/eslint-plugin-react-dom/src/utils/attribute.ts deleted file mode 100644 index 80f07b3c46..0000000000 --- a/packages/plugins/eslint-plugin-react-dom/src/utils/attribute.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { _ } from "@eslint-react/eff"; -import * as JSX from "@eslint-react/jsx"; -import type { CustomAttributeNormalized, CustomComponentNormalized, RuleContext } from "@eslint-react/shared"; -import type { TSESTree } from "@typescript-eslint/types"; - -export function getAdditionalAttributes(componentName: string, additionalComponents: CustomComponentNormalized[]) { - return additionalComponents - .findLast((c) => c.name === componentName || c.re.test(componentName)) - ?.attributes - ?? []; -} - -/** - * Get the metadata of an attribute from the additional attributes. - * @param name The intrinsic name of the attribute. - * @param attributes The additional attributes of the user-defined component. - * @returns The metadata of the attribute. - */ -export function getAttributeMetaData( - name: string, - attributes: CustomComponentNormalized["attributes"], -) { - const settings = attributes - .findLast((a) => a.as === name); - - return { - name: settings?.name ?? name, - controlled: settings?.controlled ?? false, - defaultValue: settings?.defaultValue, - }; -} - -export function getAttributeNodeAndStringValue( - name: string, - element: TSESTree.JSXElement, - context: RuleContext, - additionalAttributes: CustomAttributeNormalized[], -) { - const attributeMetaData = getAttributeMetaData(name, additionalAttributes); - const attributeNameOnElement = attributeMetaData.name; - const attributeNode = JSX.getAttributeNode( - attributeNameOnElement, - context.sourceCode.getScope(element), - element.openingElement.attributes, - ); - if (attributeNode == null) { - return { - attributeNode: _, - attributeValue: attributeMetaData.defaultValue, - } as const; - } - const attributeScope = context.sourceCode.getScope(attributeNode); - const attributeValue = JSX.getAttributeStringValue( - attributeNameOnElement, - attributeNode, - attributeScope, - ); - return { attributeNode, attributeValue } as const; -} diff --git a/packages/plugins/eslint-plugin-react-dom/src/utils/find-custom-component.ts b/packages/plugins/eslint-plugin-react-dom/src/utils/find-custom-component.ts new file mode 100644 index 0000000000..8a44e0e6ed --- /dev/null +++ b/packages/plugins/eslint-plugin-react-dom/src/utils/find-custom-component.ts @@ -0,0 +1,11 @@ +import type { CustomComponentNormalized, CustomComponentPropNormalized } from "@eslint-react/shared"; + +export function findCustomComponent(name: string, components: CustomComponentNormalized[]) { + return components + .findLast((c) => c.name === name || c.re.test(name)); +} + +export function findCustomComponentProp(name: string, props: CustomComponentPropNormalized[]) { + return props + .findLast((a) => a.as === name); +} diff --git a/packages/core/src/element/element-name.ts b/packages/plugins/eslint-plugin-react-dom/src/utils/get-element-name-on-jsx-and-dom.ts similarity index 96% rename from packages/core/src/element/element-name.ts rename to packages/plugins/eslint-plugin-react-dom/src/utils/get-element-name-on-jsx-and-dom.ts index 42e9352824..60f68cbbf8 100644 --- a/packages/core/src/element/element-name.ts +++ b/packages/plugins/eslint-plugin-react-dom/src/utils/get-element-name-on-jsx-and-dom.ts @@ -3,7 +3,7 @@ import type { CustomComponentNormalized, RuleContext } from "@eslint-react/share import * as VAR from "@eslint-react/var"; import type { TSESTree } from "@typescript-eslint/types"; -export function getElementNameOnJsxAndHtml( +export function getElementNameOnJsxAndDom( node: TSESTree.JSXOpeningElement, context: RuleContext, polymorphicPropName?: string, diff --git a/packages/plugins/eslint-plugin-react-dom/src/utils/index.ts b/packages/plugins/eslint-plugin-react-dom/src/utils/index.ts index 940c0e56ba..6f83f8eb50 100644 --- a/packages/plugins/eslint-plugin-react-dom/src/utils/index.ts +++ b/packages/plugins/eslint-plugin-react-dom/src/utils/index.ts @@ -1,2 +1,3 @@ -export * from "./attribute"; export * from "./create-rule"; +export * from "./find-custom-component"; +export * from "./get-element-name-on-jsx-and-dom"; diff --git a/packages/plugins/eslint-plugin-react-hooks-extra/package.json b/packages/plugins/eslint-plugin-react-hooks-extra/package.json index c2c21ffe40..64945445d6 100644 --- a/packages/plugins/eslint-plugin-react-hooks-extra/package.json +++ b/packages/plugins/eslint-plugin-react-hooks-extra/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-hooks-extra", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "ESLint React's ESLint plugin for React Hooks related rules.", "keywords": [ "react", diff --git a/packages/plugins/eslint-plugin-react-naming-convention/package.json b/packages/plugins/eslint-plugin-react-naming-convention/package.json index 67effa60f0..f1b64ab5ce 100644 --- a/packages/plugins/eslint-plugin-react-naming-convention/package.json +++ b/packages/plugins/eslint-plugin-react-naming-convention/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-naming-convention", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "ESLint React's ESLint plugin for naming convention related rules.", "keywords": [ "react", diff --git a/packages/plugins/eslint-plugin-react-web-api/package.json b/packages/plugins/eslint-plugin-react-web-api/package.json index 9fdeeb23e5..4ec8c27a1c 100644 --- a/packages/plugins/eslint-plugin-react-web-api/package.json +++ b/packages/plugins/eslint-plugin-react-web-api/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-web-api", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "ESLint React's ESLint plugin for interacting with Web APIs", "keywords": [ "react", diff --git a/packages/plugins/eslint-plugin-react-x/package.json b/packages/plugins/eslint-plugin-react-x/package.json index b9b203e3b5..dcadea4320 100644 --- a/packages/plugins/eslint-plugin-react-x/package.json +++ b/packages/plugins/eslint-plugin-react-x/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-x", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.", "keywords": [ "react", diff --git a/packages/plugins/eslint-plugin/package.json b/packages/plugins/eslint-plugin/package.json index 3476853d82..d2644ce889 100644 --- a/packages/plugins/eslint-plugin/package.json +++ b/packages/plugins/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/eslint-plugin", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.", "keywords": [ "react", diff --git a/packages/shared/docs/README.md b/packages/shared/docs/README.md index 2fd2a1f8e1..92c15687cd 100644 --- a/packages/shared/docs/README.md +++ b/packages/shared/docs/README.md @@ -4,13 +4,16 @@ # @eslint-react/shared +## Interfaces + +- [CustomComponentNormalized](interfaces/CustomComponentNormalized.md) +- [CustomComponentPropNormalized](interfaces/CustomComponentPropNormalized.md) + ## Type Aliases -- [CustomAttribute](type-aliases/CustomAttribute.md) -- [CustomAttributeNormalized](type-aliases/CustomAttributeNormalized.md) - [CustomComponent](type-aliases/CustomComponent.md) -- [CustomComponentNormalized](type-aliases/CustomComponentNormalized.md) -- [CustomHook](type-aliases/CustomHook.md) +- [CustomComponentProp](type-aliases/CustomComponentProp.md) +- [CustomHooks](type-aliases/CustomHooks.md) - [ESLintReactSettings](type-aliases/ESLintReactSettings.md) - [ESLintSettings](type-aliases/ESLintSettings.md) - [RuleContext](type-aliases/RuleContext.md) @@ -22,8 +25,7 @@ ## Variables -- [CustomAttributeNormalizedSchema](variables/CustomAttributeNormalizedSchema.md) -- [CustomComponentNormalizedSchema](variables/CustomComponentNormalizedSchema.md) +- [CustomHooksSchema](variables/CustomHooksSchema.md) - [DEFAULT\_ESLINT\_REACT\_SETTINGS](variables/DEFAULT_ESLINT_REACT_SETTINGS.md) - [GITHUB\_URL](variables/GITHUB_URL.md) - [NPM\_SCOPE](variables/NPM_SCOPE.md) diff --git a/packages/shared/docs/functions/defineSettings.md b/packages/shared/docs/functions/defineSettings.md index 1aca8136c8..7e7959401d 100644 --- a/packages/shared/docs/functions/defineSettings.md +++ b/packages/shared/docs/functions/defineSettings.md @@ -36,7 +36,7 @@ This is used to inform the ESLint React plugins how to treat these components du \{ `use`: `string`[]; `useActionState`: `string`[]; `useCallback`: `string`[]; `useContext`: `string`[]; `useDebugValue`: `string`[]; `useDeferredValue`: `string`[]; `useEffect`: `string`[]; `useFormStatus`: `string`[]; `useId`: `string`[]; `useImperativeHandle`: `string`[]; `useInsertionEffect`: `string`[]; `useLayoutEffect`: `string`[]; `useMemo`: `string`[]; `useOptimistic`: `string`[]; `useReducer`: `string`[]; `useRef`: `string`[]; `useState`: `string`[]; `useSyncExternalStore`: `string`[]; `useTransition`: `string`[]; \} = `...` -A object of aliases for React built-in hooks. +A object to define additional hooks that are equivalent to the built-in React Hooks. **Description** @@ -231,7 +231,7 @@ This is used to inform the ESLint React plugins how to treat these components du > `optional` **additionalHooks**: `object` -A object of aliases for React built-in hooks. +A object to define additional hooks that are equivalent to the built-in React Hooks. #### Description @@ -319,9 +319,9 @@ ESLint React will recognize these aliases as equivalent to the built-in hooks in > `optional` **useTransition**: `string`[] -### importSource? +### importSource -> `optional` **importSource**: `string` +> **importSource**: `string` The source where React is imported from. @@ -339,9 +339,9 @@ This allows to specify a custom import location for React when not using the off `"@pika/react"` ``` -### ~~jsxPragma?~~ +### ~~jsxPragma~~ -> `optional` **jsxPragma**: `string` +> **jsxPragma**: `string` The identifier that’s used for JSX Element creation. @@ -351,9 +351,9 @@ The identifier that’s used for JSX Element creation. #### Deprecated -### ~~jsxPragmaFrag?~~ +### ~~jsxPragmaFrag~~ -> `optional` **jsxPragmaFrag**: `string` +> **jsxPragmaFrag**: `string` The identifier that’s used for JSX fragment elements. @@ -367,9 +367,9 @@ This should not be a member expression (i.e. use "Fragment" instead of "React.Fr #### Deprecated -### polymorphicPropName? +### polymorphicPropName -> `optional` **polymorphicPropName**: `string` +> **polymorphicPropName**: `string` The name of the prop that is used for polymorphic components. @@ -383,9 +383,9 @@ This is used to determine the type of the component. `"as"` ``` -### version? +### version -> `optional` **version**: `string` +> **version**: `string` React version to use, "detect" means auto detect React version from the project’s dependencies. If `importSource` is specified, an equivalent version of React should be provided here. diff --git a/packages/shared/docs/interfaces/CustomComponentNormalized.md b/packages/shared/docs/interfaces/CustomComponentNormalized.md new file mode 100644 index 0000000000..f301499487 --- /dev/null +++ b/packages/shared/docs/interfaces/CustomComponentNormalized.md @@ -0,0 +1,31 @@ +[**@eslint-react/shared**](../README.md) + +*** + +[@eslint-react/shared](../README.md) / CustomComponentNormalized + +# Interface: CustomComponentNormalized + +## Properties + +### as + +> **as**: `string` + +*** + +### name + +> **name**: `string` + +*** + +### props + +> **props**: [`CustomComponentPropNormalized`](CustomComponentPropNormalized.md)[] + +*** + +### re + +> **re**: `RegExp` diff --git a/packages/shared/docs/interfaces/CustomComponentPropNormalized.md b/packages/shared/docs/interfaces/CustomComponentPropNormalized.md new file mode 100644 index 0000000000..f86f3eab54 --- /dev/null +++ b/packages/shared/docs/interfaces/CustomComponentPropNormalized.md @@ -0,0 +1,25 @@ +[**@eslint-react/shared**](../README.md) + +*** + +[@eslint-react/shared](../README.md) / CustomComponentPropNormalized + +# Interface: CustomComponentPropNormalized + +## Properties + +### as + +> **as**: `string` + +*** + +### defaultValue? + +> `optional` **defaultValue**: `string` + +*** + +### name + +> **name**: `string` diff --git a/packages/shared/docs/type-aliases/CustomAttribute.md b/packages/shared/docs/type-aliases/CustomAttribute.md deleted file mode 100644 index 645c029241..0000000000 --- a/packages/shared/docs/type-aliases/CustomAttribute.md +++ /dev/null @@ -1,9 +0,0 @@ -[**@eslint-react/shared**](../README.md) - -*** - -[@eslint-react/shared](../README.md) / CustomAttribute - -# Type Alias: CustomAttribute - -> **CustomAttribute**: `InferOutput`\<*typeof* `CustomAttributeSchema`\> diff --git a/packages/shared/docs/type-aliases/CustomAttributeNormalized.md b/packages/shared/docs/type-aliases/CustomAttributeNormalized.md deleted file mode 100644 index f1eace8e32..0000000000 --- a/packages/shared/docs/type-aliases/CustomAttributeNormalized.md +++ /dev/null @@ -1,9 +0,0 @@ -[**@eslint-react/shared**](../README.md) - -*** - -[@eslint-react/shared](../README.md) / CustomAttributeNormalized - -# Type Alias: CustomAttributeNormalized - -> **CustomAttributeNormalized**: `InferOutput`\<*typeof* [`CustomAttributeNormalizedSchema`](../variables/CustomAttributeNormalizedSchema.md)\> diff --git a/packages/shared/docs/type-aliases/CustomComponentNormalized.md b/packages/shared/docs/type-aliases/CustomComponentNormalized.md deleted file mode 100644 index b0ea8f1c1c..0000000000 --- a/packages/shared/docs/type-aliases/CustomComponentNormalized.md +++ /dev/null @@ -1,9 +0,0 @@ -[**@eslint-react/shared**](../README.md) - -*** - -[@eslint-react/shared](../README.md) / CustomComponentNormalized - -# Type Alias: CustomComponentNormalized - -> **CustomComponentNormalized**: `InferOutput`\<*typeof* [`CustomComponentNormalizedSchema`](../variables/CustomComponentNormalizedSchema.md)\> diff --git a/packages/shared/docs/type-aliases/CustomComponentProp.md b/packages/shared/docs/type-aliases/CustomComponentProp.md new file mode 100644 index 0000000000..10ab595749 --- /dev/null +++ b/packages/shared/docs/type-aliases/CustomComponentProp.md @@ -0,0 +1,9 @@ +[**@eslint-react/shared**](../README.md) + +*** + +[@eslint-react/shared](../README.md) / CustomComponentProp + +# Type Alias: CustomComponentProp + +> **CustomComponentProp**: `InferOutput`\<*typeof* `CustomComponentPropSchema`\> diff --git a/packages/shared/docs/type-aliases/CustomHook.md b/packages/shared/docs/type-aliases/CustomHook.md deleted file mode 100644 index 36dead9bc5..0000000000 --- a/packages/shared/docs/type-aliases/CustomHook.md +++ /dev/null @@ -1,9 +0,0 @@ -[**@eslint-react/shared**](../README.md) - -*** - -[@eslint-react/shared](../README.md) / CustomHook - -# Type Alias: CustomHook - -> **CustomHook**: `InferOutput`\<*typeof* `CustomHookSchema`\> diff --git a/packages/shared/docs/type-aliases/CustomHooks.md b/packages/shared/docs/type-aliases/CustomHooks.md new file mode 100644 index 0000000000..23ed89b887 --- /dev/null +++ b/packages/shared/docs/type-aliases/CustomHooks.md @@ -0,0 +1,9 @@ +[**@eslint-react/shared**](../README.md) + +*** + +[@eslint-react/shared](../README.md) / CustomHooks + +# Type Alias: CustomHooks + +> **CustomHooks**: `InferOutput`\<*typeof* [`CustomHooksSchema`](../variables/CustomHooksSchema.md)\> diff --git a/packages/shared/docs/variables/CustomAttributeNormalizedSchema.md b/packages/shared/docs/variables/CustomAttributeNormalizedSchema.md deleted file mode 100644 index 41881c8be4..0000000000 --- a/packages/shared/docs/variables/CustomAttributeNormalizedSchema.md +++ /dev/null @@ -1,9 +0,0 @@ -[**@eslint-react/shared**](../README.md) - -*** - -[@eslint-react/shared](../README.md) / CustomAttributeNormalizedSchema - -# Variable: CustomAttributeNormalizedSchema - -> `const` **CustomAttributeNormalizedSchema**: `ObjectSchema`\<\{ `as`: `StringSchema`\<`undefined`\>; `controlled`: `OptionalSchema`\<`BooleanSchema`\<`undefined`\>, `undefined`\>; `defaultValue`: `OptionalSchema`\<`StringSchema`\<`undefined`\>, `undefined`\>; `name`: `StringSchema`\<`undefined`\>; \}, `undefined`\> diff --git a/packages/shared/docs/variables/CustomComponentNormalizedSchema.md b/packages/shared/docs/variables/CustomComponentNormalizedSchema.md deleted file mode 100644 index 22c1825e58..0000000000 --- a/packages/shared/docs/variables/CustomComponentNormalizedSchema.md +++ /dev/null @@ -1,9 +0,0 @@ -[**@eslint-react/shared**](../README.md) - -*** - -[@eslint-react/shared](../README.md) / CustomComponentNormalizedSchema - -# Variable: CustomComponentNormalizedSchema - -> `const` **CustomComponentNormalizedSchema**: `ObjectSchema`\<\{ `as`: `StringSchema`\<`undefined`\>; `attributes`: `OptionalSchema`\<`ArraySchema`\<`ObjectSchema`\<\{ `as`: `StringSchema`\<`undefined`\>; `controlled`: `OptionalSchema`\<`BooleanSchema`\<`undefined`\>, `undefined`\>; `defaultValue`: `OptionalSchema`\<`StringSchema`\<`undefined`\>, `undefined`\>; `name`: `StringSchema`\<`undefined`\>; \}, `undefined`\>, `undefined`\>, readonly \[\]\>; `name`: `StringSchema`\<`undefined`\>; `re`: `InstanceSchema`\<`RegExpConstructor`, `undefined`\>; `selector`: `OptionalSchema`\<`StringSchema`\<`undefined`\>, `undefined`\>; \}, `undefined`\> diff --git a/packages/shared/docs/variables/CustomHooksSchema.md b/packages/shared/docs/variables/CustomHooksSchema.md new file mode 100644 index 0000000000..c5e50842f0 --- /dev/null +++ b/packages/shared/docs/variables/CustomHooksSchema.md @@ -0,0 +1,9 @@ +[**@eslint-react/shared**](../README.md) + +*** + +[@eslint-react/shared](../README.md) / CustomHooksSchema + +# Variable: CustomHooksSchema + +> `const` **CustomHooksSchema**: `ObjectSchema`\<\{ `use`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useActionState`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useCallback`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useContext`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useDebugValue`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useDeferredValue`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useEffect`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useFormStatus`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useId`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useImperativeHandle`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useInsertionEffect`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useLayoutEffect`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useMemo`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useOptimistic`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useReducer`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useRef`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useState`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useSyncExternalStore`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; `useTransition`: `OptionalSchema`\<`ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\>, `undefined`\>; \}, `undefined`\> diff --git a/packages/shared/docs/variables/DEFAULT_ESLINT_REACT_SETTINGS.md b/packages/shared/docs/variables/DEFAULT_ESLINT_REACT_SETTINGS.md index ae8d31cec5..3bc11c7788 100644 --- a/packages/shared/docs/variables/DEFAULT_ESLINT_REACT_SETTINGS.md +++ b/packages/shared/docs/variables/DEFAULT_ESLINT_REACT_SETTINGS.md @@ -12,6 +12,22 @@ The default ESLint settings for "react-x". ## Type declaration +### additionalComponents? + +> `readonly` `optional` **additionalComponents**: `object`[] + +An array of user-defined components + +#### Description + +This is used to inform the ESLint React plugins how to treat these components during checks. + +#### Example + +```ts +`[{ name: "Link", as: "a", attributes: [{ name: "to", as: "href" }, { name: "rel", defaultValue: "noopener noreferrer" }] }]` +``` + ### additionalHooks > `readonly` **additionalHooks**: `object` @@ -20,14 +36,83 @@ The default ESLint settings for "react-x". > `readonly` **useLayoutEffect**: \[`"useIsomorphicLayoutEffect"`\] +### importSource + +> `readonly` **importSource**: `string` + +The source where React is imported from. + +#### Description + +This allows to specify a custom import location for React when not using the official distribution. + +#### Default + +`"react"` + +#### Example + +```ts +`"@pika/react"` +``` + +### ~~jsxPragma~~ + +> `readonly` **jsxPragma**: `string` + +The identifier that’s used for JSX Element creation. + +#### Default + +`"createElement"` + +#### Deprecated + +### ~~jsxPragmaFrag~~ + +> `readonly` **jsxPragmaFrag**: `string` + +The identifier that’s used for JSX fragment elements. + +#### Description + +This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment"). + +#### Default + +`"Fragment"` + +#### Deprecated + ### polymorphicPropName -> `readonly` **polymorphicPropName**: `"as"` = `"as"` +> `readonly` **polymorphicPropName**: `string` + +The name of the prop that is used for polymorphic components. + +#### Description -### strictImportCheck +This is used to determine the type of the component. -> `readonly` **strictImportCheck**: `false` = `false` +#### Example + +```ts +`"as"` +``` ### version -> `readonly` **version**: `"detect"` = `"detect"` +> `readonly` **version**: `string` + +React version to use, "detect" means auto detect React version from the project’s dependencies. +If `importSource` is specified, an equivalent version of React should be provided here. + +#### Example + +```ts +`"18.3.1"` +``` + +#### Default + +`"detect"` diff --git a/packages/shared/package.json b/packages/shared/package.json index f0b5d6c8d3..1e92eebb99 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/shared", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "ESLint React's Shared constants and functions.", "homepage": "https://github.com/Rel1cx/eslint-react", "bugs": { diff --git a/packages/shared/src/schemas.ts b/packages/shared/src/schemas.ts index 2a8ea36115..f4a48a47dc 100644 --- a/packages/shared/src/schemas.ts +++ b/packages/shared/src/schemas.ts @@ -1,40 +1,30 @@ import type { InferOutput } from "valibot"; -import { array, boolean, instance, object, optional, string } from "valibot"; +import { array, boolean, object, optional, parse, string } from "valibot"; /** * @internal - * @description - * This allows the rule to know some key information before checking for user-defined hooks. - * For example, the position of the `deps` argument for the user-defined `useCustomEffect` hook that represents the built-in `useEffect` hook. */ -export const CustomHookSchema = object({ - // TODO: Define the schema for custom Hooks -}); - -/** - * @internal - */ -export const CustomAttributeSchema = object({ +export const CustomComponentPropSchema = object({ /** - * The name of the attribute in the user-defined component. + * The name of the prop in the user-defined component. * @example * "to" */ name: string(), /** - * The name of the attribute in the built-in component. + * The name of the prop in the built-in component. * @example * "href" */ as: optional(string()), /** - * Whether the attribute is controlled or not in the user-defined component. + * Whether the prop is controlled or not in the user-defined component. * @example * `true` */ controlled: optional(boolean()), /** - * The default value of the attribute in the user-defined component. + * The default value of the prop in the user-defined component. * @example * `"/"` */ @@ -47,8 +37,7 @@ export const CustomAttributeSchema = object({ * @description * This will provide some key information to the rule before checking for user-defined components. * For example: - * Which attribute is used as the `href` prop for the user-defined `Link` component that represents the built-in `a` element. - * Which attributes are used as `children` props for a user-defined `Button` component to receive children of that component. + * Which prop is used as the `href` prop for the user-defined `Link` component that represents the built-in `a` element. */ export const CustomComponentSchema = object({ /** @@ -59,6 +48,7 @@ export const CustomComponentSchema = object({ name: string(), /** * The ESQuery selector to select the component precisely. + * @internal * @example * `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])` */ @@ -70,30 +60,42 @@ export const CustomComponentSchema = object({ */ as: optional(string()), /** - * Pre-defined attributes that are used in the user-defined component. + * Props mapping between the user-defined component and the built-in component. * @example * `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`. */ - attributes: optional(array(CustomAttributeSchema)), -}); -/* eslint-enable perfectionist/sort-objects */ - -export const CustomAttributeNormalizedSchema = object({ - name: string(), - as: string(), - controlled: optional(boolean()), - defaultValue: optional(string()), + props: optional(array(CustomComponentPropSchema)), + /** + * Attributes mapping between the user-defined component and the built-in component. + * @example + * `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`. + * @deprecated Use `props` instead + */ + attributes: optional(array(CustomComponentPropSchema)), }); -export const CustomComponentNormalizedSchema = object({ - name: string(), - as: string(), - attributes: optional(array(CustomAttributeNormalizedSchema), []), - re: instance(RegExp), - selector: optional(string()), +export const CustomHooksSchema = object({ + use: optional(array(string())), + useActionState: optional(array(string())), + useCallback: optional(array(string())), + useContext: optional(array(string())), + useDebugValue: optional(array(string())), + useDeferredValue: optional(array(string())), + useEffect: optional(array(string())), + useFormStatus: optional(array(string())), + useId: optional(array(string())), + useImperativeHandle: optional(array(string())), + useInsertionEffect: optional(array(string())), + useLayoutEffect: optional(array(string())), + useMemo: optional(array(string())), + useOptimistic: optional(array(string())), + useReducer: optional(array(string())), + useRef: optional(array(string())), + useState: optional(array(string())), + useSyncExternalStore: optional(array(string())), + useTransition: optional(array(string())), }); -/* eslint-disable perfectionist/sort-objects */ /** * @internal */ @@ -104,41 +106,41 @@ export const ESLintReactSettingsSchema = object({ * @default `"react"` * @example `"@pika/react"` */ - importSource: optional(string()), + importSource: optional(string(), "react"), /** * The identifier that’s used for JSX Element creation. * @default `"createElement"` * @deprecated */ - jsxPragma: optional(string()), + jsxPragma: optional(string(), "createElement"), /** * The identifier that’s used for JSX fragment elements. * @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment"). * @default `"Fragment"` * @deprecated */ - jsxPragmaFrag: optional(string()), + jsxPragmaFrag: optional(string(), "Fragment"), /** * The name of the prop that is used for polymorphic components. * @description This is used to determine the type of the component. * @example `"as"` */ - polymorphicPropName: optional(string()), + polymorphicPropName: optional(string(), "as"), /** * @internal */ - strict: optional(boolean()), + strict: optional(boolean(), false), /** * @internal */ - strictImportCheck: optional(boolean()), + strictImportCheck: optional(boolean(), false), /** * React version to use, "detect" means auto detect React version from the project’s dependencies. * If `importSource` is specified, an equivalent version of React should be provided here. * @example `"18.3.1"` * @default `"detect"` */ - version: optional(string()), + version: optional(string(), "detect"), /** * An array of user-defined components * @description This is used to inform the ESLint React plugins how to treat these components during checks. @@ -146,31 +148,11 @@ export const ESLintReactSettingsSchema = object({ */ additionalComponents: optional(array(CustomComponentSchema)), /** - * A object of aliases for React built-in hooks. + * A object to define additional hooks that are equivalent to the built-in React Hooks. * @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules. * @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }` */ - additionalHooks: optional(object({ - use: optional(array(string())), - useActionState: optional(array(string())), - useCallback: optional(array(string())), - useContext: optional(array(string())), - useDebugValue: optional(array(string())), - useDeferredValue: optional(array(string())), - useEffect: optional(array(string())), - useFormStatus: optional(array(string())), - useId: optional(array(string())), - useImperativeHandle: optional(array(string())), - useInsertionEffect: optional(array(string())), - useLayoutEffect: optional(array(string())), - useMemo: optional(array(string())), - useOptimistic: optional(array(string())), - useReducer: optional(array(string())), - useRef: optional(array(string())), - useState: optional(array(string())), - useSyncExternalStore: optional(array(string())), - useTransition: optional(array(string())), - })), + additionalHooks: optional(CustomHooksSchema), }); /* eslint-enable perfectionist/sort-objects */ @@ -186,39 +168,24 @@ export const ESLintSettingsSchema = optional( {}, ); -export type CustomHook = InferOutput; - -export type CustomAttribute = InferOutput; - export type CustomComponent = InferOutput; -export type CustomAttributeNormalized = InferOutput; +export type CustomComponentProp = InferOutput; -export type CustomComponentNormalized = InferOutput; +export type CustomHooks = InferOutput; export type ESLintReactSettings = InferOutput; export type ESLintSettings = InferOutput; -/** - * This is an expanded version of `ESLintReactSettings` with all shorthand properties expanded. - * @internal - */ -export interface ESLintReactSettingsNormalized extends ESLintReactSettings { - additionalComponents: CustomComponentNormalized[]; - version: string; -} - /** * The default ESLint settings for "react-x". */ export const DEFAULT_ESLINT_REACT_SETTINGS = { + ...parse(ESLintReactSettingsSchema, {}), additionalHooks: { useLayoutEffect: ["useIsomorphicLayoutEffect"], }, - polymorphicPropName: "as", - strictImportCheck: false, - version: "detect", } as const satisfies ESLintReactSettings; // #endregion diff --git a/packages/shared/src/settings.ts b/packages/shared/src/settings.ts index 01d2c76a4f..9dba517fca 100644 --- a/packages/shared/src/settings.ts +++ b/packages/shared/src/settings.ts @@ -1,3 +1,5 @@ +/* eslint-disable no-restricted-syntax */ +import type { _ } from "@eslint-react/eff"; import { identity } from "@eslint-react/eff"; import { shallowEqual } from "fast-equals"; import memoize from "micro-memoize"; @@ -7,9 +9,38 @@ import type { PartialDeep } from "type-fest"; import { parse } from "valibot"; import { getReactVersion } from "./get-react-version"; -import type { ESLintReactSettings, ESLintReactSettingsNormalized } from "./schemas"; +import type { CustomHooks, ESLintReactSettings } from "./schemas"; import { DEFAULT_ESLINT_REACT_SETTINGS, ESLintSettingsSchema } from "./schemas"; +export interface CustomComponentNormalized { + name: string; + as: string; + props: CustomComponentPropNormalized[]; + re: RegExp; + // selector?: string | _; +} + +export interface CustomComponentPropNormalized { + name: string; + as: string; + // controlled?: boolean | _; + defaultValue?: string | _; +} + +/** + * The normalized version of the `ESLintReactSettings`. + * @internal + */ +export interface ESLintReactSettingsNormalized { + additionalComponents: CustomComponentNormalized[]; + additionalHooks: CustomHooks; + importSource?: string; + polymorphicPropName?: string | _; + // strict: boolean; + strictImportCheck: boolean; + version: string; +} + /** * Unsafely casts settings from a data object from `context.settings`. * @internal @@ -35,41 +66,50 @@ export const decodeSettings = memoize((data: unknown): ESLintReactSettings => { }; }, { isEqual: (a, b) => a === b }); -// #endregion - -// #region Normalization Functions - /** - * Normalizes the settings by converting all shorthand properties to their full form. + * The memoized version of `ESLintReactSettings`. * @param settings The settings. * @returns The normalized settings. * @internal */ -export const normalizeSettings = memoize((settings: ESLintReactSettings): ESLintReactSettingsNormalized => { - const additionalComponents = settings.additionalComponents ?? []; - return { - ...settings, - additionalComponents: additionalComponents.map((component) => ({ - ...component, - as: component.as ?? component.name, - attributes: component.attributes?.map((attr) => ({ - ...attr, - as: attr.as ?? attr.name, - })) ?? [], - re: pm.makeRe(component.name, { fastpaths: true }), - })), - version: match(settings.version) - .with(P.union(P.nullish, "", "detect"), () => getReactVersion("19.0.0")) - .otherwise(identity), - }; -}, { isEqual: shallowEqual }); - -// #endregion - -// #region Helper Functions +export const toNormalizedSettings = memoize( + ({ + additionalComponents = [], + additionalHooks = {}, + version, + ...rest + }: ESLintReactSettings): ESLintReactSettingsNormalized => { + return { + ...rest, + additionalComponents: additionalComponents.map(({ + name, + as = name, + attributes, // eslint-disable-line @typescript-eslint/no-deprecated + props = attributes ?? [], + ...rest + }) => ({ + ...rest, + name, + as, + props: props + .map(({ name, as = name, ...rest }) => ({ + ...rest, + name, + as, + })), + re: pm.makeRe(name, { fastpaths: true }), + })), + additionalHooks, + version: match(version) + .with(P.union(P.nullish, "", "detect"), () => getReactVersion("19.0.0")) + .otherwise(identity), + }; + }, + { isEqual: shallowEqual }, +); export function getSettingsFromContext(context: { settings: unknown }): ESLintReactSettingsNormalized { - return normalizeSettings(decodeSettings(context.settings)); + return toNormalizedSettings(decodeSettings(context.settings)); } /** @@ -79,11 +119,8 @@ export function getSettingsFromContext(context: { settings: unknown }): ESLintRe */ export const defineSettings: (settings: ESLintReactSettings) => ESLintReactSettings = identity; -// #endregion - declare module "@typescript-eslint/utils/ts-eslint" { export interface SharedConfigurationSettings { - // eslint-disable-next-line no-restricted-syntax "react-x"?: Partial; } } diff --git a/packages/utilities/ast/package.json b/packages/utilities/ast/package.json index 9f76ae7e23..d507190df4 100644 --- a/packages/utilities/ast/package.json +++ b/packages/utilities/ast/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/ast", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "ESLint React's TSESTree AST utility module.", "homepage": "https://github.com/Rel1cx/eslint-react", "bugs": { diff --git a/packages/utilities/eff/package.json b/packages/utilities/eff/package.json index 23b7c0e4e1..40327753a3 100644 --- a/packages/utilities/eff/package.json +++ b/packages/utilities/eff/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/eff", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "JavaScript and TypeScript utilities (previously some re-exports of the effect library).", "homepage": "https://github.com/Rel1cx/eslint-react", "bugs": { diff --git a/packages/utilities/jsx/package.json b/packages/utilities/jsx/package.json index 56ff4be9cf..29c20defee 100644 --- a/packages/utilities/jsx/package.json +++ b/packages/utilities/jsx/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/jsx", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "ESLint React's TSESTree AST utility module for static analysis of JSX.", "homepage": "https://github.com/Rel1cx/eslint-react", "bugs": { diff --git a/packages/utilities/jsx/src/get-attribute-value.ts b/packages/utilities/jsx/src/get-attribute-value.ts new file mode 100644 index 0000000000..bd0472d127 --- /dev/null +++ b/packages/utilities/jsx/src/get-attribute-value.ts @@ -0,0 +1,37 @@ +import type * as VAR from "@eslint-react/var"; +import type { Scope } from "@typescript-eslint/scope-manager"; +import { AST_NODE_TYPES as T } from "@typescript-eslint/types"; +import type { TSESTree } from "@typescript-eslint/utils"; + +export function getAttributeStaticValue( + node: TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute, + initialScope: Scope, +): VAR.StaticValue { + switch (node.type) { + case T.JSXAttribute: + if (node.value?.type === T.Literal) { + return { + kind: "some", + node: node.value, + initialScope, + value: node.value.value, + } as const; + } + if (node.value?.type === T.JSXExpressionContainer) { + return { + kind: "lazy", + node: node.value.expression, + initialScope, + } as const; + } + return { kind: "none", node, initialScope } as const; + case T.JSXSpreadAttribute: + return { + kind: "lazy", + node: node.argument, + initialScope, + } as const; + default: + return { kind: "none", node, initialScope } as const; + } +} diff --git a/packages/utilities/jsx/src/get-attribute.ts b/packages/utilities/jsx/src/get-attribute.ts index 775eaaecce..bd88c41008 100644 --- a/packages/utilities/jsx/src/get-attribute.ts +++ b/packages/utilities/jsx/src/get-attribute.ts @@ -1,9 +1,8 @@ -import { _, identity } from "@eslint-react/eff"; +import type { _ } from "@eslint-react/eff"; import * as VAR from "@eslint-react/var"; import type { Scope } from "@typescript-eslint/scope-manager"; import { AST_NODE_TYPES as T } from "@typescript-eslint/types"; import type { TSESTree } from "@typescript-eslint/utils"; -import { match, P } from "ts-pattern"; export function getAttributeName(node: TSESTree.JSXAttribute) { switch (node.name.type) { @@ -38,50 +37,3 @@ export function getAttributeNode( return false; }); } - -export function getAttributeStaticValue( - node: TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute, - initialScope: Scope, -): VAR.StaticValue { - switch (node.type) { - case T.JSXAttribute: - if (node.value?.type === T.Literal) { - return { - kind: "some", - node: node.value, - initialScope, - value: node.value.value, - } as const; - } - if (node.value?.type === T.JSXExpressionContainer) { - return { - kind: "lazy", - node: node.value.expression, - initialScope, - } as const; - } - return { kind: "none", node, initialScope } as const; - case T.JSXSpreadAttribute: - return { - kind: "lazy", - node: node.argument, - initialScope, - } as const; - default: - return { kind: "none", node, initialScope } as const; - } -} - -export function getAttributeStringValue( - name: string, - node: TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute | _, - initialScope: Scope, -) { - if (node == null) return _; - const attributeValue = getAttributeStaticValue(node, initialScope); - const attributeValueResolved = VAR.toResolved(attributeValue).value; - return match(attributeValueResolved) - .with(P.string, identity) - .with({ [name]: P.select(P.string) }, identity) - .otherwise(() => _); -} diff --git a/packages/utilities/jsx/src/index.ts b/packages/utilities/jsx/src/index.ts index 4433aef5d3..d037681937 100644 --- a/packages/utilities/jsx/src/index.ts +++ b/packages/utilities/jsx/src/index.ts @@ -1,9 +1,11 @@ export * from "./find-parent-attribute-node"; export * from "./get-attribute"; +export * from "./get-attribute-value"; export * from "./get-element-name"; export * from "./has-attribute"; export * from "./is-element"; export * from "./is-jsx-value"; export * from "./is-literal"; +export * from "./to-resolved-attribute-value"; export * from "./unescape-string-literal-text"; export * from "./xhtml-entities"; diff --git a/packages/utilities/jsx/src/to-resolved-attribute-value.ts b/packages/utilities/jsx/src/to-resolved-attribute-value.ts new file mode 100644 index 0000000000..f441cfccd7 --- /dev/null +++ b/packages/utilities/jsx/src/to-resolved-attribute-value.ts @@ -0,0 +1,13 @@ +import { _, identity } from "@eslint-react/eff"; +import * as VAR from "@eslint-react/var"; +import { match, P } from "ts-pattern"; + +export function toResolvedAttributeValue( + name: string, + value: VAR.StaticValue, +) { + return match(VAR.toResolved(value).value) + .with(P.string, identity) + .with({ [name]: P.select(P.string) }, identity) + .otherwise(() => _); +} diff --git a/packages/utilities/var/package.json b/packages/utilities/var/package.json index 764c26d28f..297aaa7e84 100644 --- a/packages/utilities/var/package.json +++ b/packages/utilities/var/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/var", - "version": "1.24.0-next.9", + "version": "1.24.0-next.10", "description": "ESLint React's TSESTree AST utility module for static analysis of variables", "homepage": "https://github.com/Rel1cx/eslint-react", "bugs": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c6cd23daea..8c6a2dfd70 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,8 +26,8 @@ importers: specifier: ^2.27.11 version: 2.27.11 '@eslint/config-inspector': - specifier: ^0.7.1 - version: 0.7.1(eslint@9.18.0(jiti@2.4.2)) + specifier: ^1.0.0 + version: 1.0.0(eslint@9.18.0(jiti@2.4.2)) '@eslint/js': specifier: ^9.18.0 version: 9.18.0 @@ -134,11 +134,11 @@ importers: specifier: ^2.4.2 version: 2.4.2 lefthook: - specifier: ^1.10.4 - version: 1.10.4 + specifier: ^1.10.5 + version: 1.10.5 markdownlint: - specifier: ^0.37.3 - version: 0.37.3 + specifier: ^0.37.4 + version: 0.37.4 ofetch: specifier: ^1.4.1 version: 1.4.1 @@ -168,7 +168,7 @@ importers: version: 5.6.0 tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) tsx: specifier: ^4.19.2 version: 4.19.2 @@ -231,7 +231,7 @@ importers: version: 19.0.0 tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) typescript: specifier: ^5.7.3 version: 5.7.3 @@ -261,8 +261,8 @@ importers: specifier: ^1.23.2 version: 1.23.2(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3) '@eslint/config-inspector': - specifier: ^0.7.1 - version: 0.7.1(eslint@9.18.0(jiti@2.4.2)) + specifier: ^1.0.0 + version: 1.0.0(eslint@9.18.0(jiti@2.4.2)) '@eslint/js': specifier: ^9.18.0 version: 9.18.0 @@ -322,8 +322,8 @@ importers: specifier: ^1.23.2 version: 1.23.2(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3) '@eslint/config-inspector': - specifier: ^0.7.1 - version: 0.7.1(eslint@9.18.0(jiti@2.4.2)) + specifier: ^1.0.0 + version: 1.0.0(eslint@9.18.0(jiti@2.4.2)) '@eslint/js': specifier: ^9.18.0 version: 9.18.0 @@ -374,8 +374,8 @@ importers: specifier: ^1.23.2 version: 1.23.2(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3) '@eslint/config-inspector': - specifier: ^0.7.1 - version: 0.7.1(eslint@9.18.0(jiti@2.4.2)) + specifier: ^1.0.0 + version: 1.0.0(eslint@9.18.0(jiti@2.4.2)) '@eslint/js': specifier: ^9.18.0 version: 9.18.0 @@ -429,8 +429,8 @@ importers: specifier: ^1.23.2 version: 1.23.2(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3) '@eslint/config-inspector': - specifier: ^0.7.1 - version: 0.7.1(eslint@9.18.0(jiti@2.4.2)) + specifier: ^1.0.0 + version: 1.0.0(eslint@9.18.0(jiti@2.4.2)) '@eslint/js': specifier: ^9.18.0 version: 9.18.0 @@ -506,7 +506,7 @@ importers: version: link:../../workspace/configs tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages/plugins/eslint-plugin: dependencies: @@ -558,7 +558,7 @@ importers: version: link:../../../workspace/configs tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages/plugins/eslint-plugin-react-debug: dependencies: @@ -616,7 +616,7 @@ importers: version: link:../../../workspace/configs tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages/plugins/eslint-plugin-react-dom: dependencies: @@ -674,7 +674,7 @@ importers: version: link:../../../workspace/configs tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages/plugins/eslint-plugin-react-hooks-extra: dependencies: @@ -732,7 +732,7 @@ importers: version: link:../../../workspace/configs tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages/plugins/eslint-plugin-react-naming-convention: dependencies: @@ -787,7 +787,7 @@ importers: version: link:../../../workspace/configs tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages/plugins/eslint-plugin-react-web-api: dependencies: @@ -842,7 +842,7 @@ importers: version: link:../../../workspace/configs tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages/plugins/eslint-plugin-react-x: dependencies: @@ -909,7 +909,7 @@ importers: version: 2.0.0(typescript@5.7.3) tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages/shared: dependencies: @@ -940,7 +940,7 @@ importers: version: 4.1.3 tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) type-fest: specifier: ^4.32.0 version: 4.32.0 @@ -974,7 +974,7 @@ importers: version: link:../../../workspace/configs tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages/utilities/eff: devDependencies: @@ -983,7 +983,7 @@ importers: version: link:../../../workspace/configs tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages/utilities/jsx: dependencies: @@ -1014,7 +1014,7 @@ importers: version: link:../../../workspace/configs tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages/utilities/var: dependencies: @@ -1045,7 +1045,7 @@ importers: version: link:../../../workspace/configs tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) website: dependencies: @@ -1138,8 +1138,8 @@ importers: specifier: ^12.1.1 version: 12.1.1(eslint@9.18.0(jiti@2.4.2)) postcss: - specifier: ^8.5.0 - version: 8.5.0 + specifier: ^8.5.1 + version: 8.5.1 remark-code-import: specifier: ^1.2.0 version: 1.2.0 @@ -1217,7 +1217,7 @@ importers: version: link:../configs tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages: @@ -2626,8 +2626,8 @@ packages: resolution: {integrity: sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/config-inspector@0.7.1': - resolution: {integrity: sha512-80+MJay0D/Kf2ImH04UOQtnL4141KviU0KNuT34xvQZ0TQ/aAfIzKnx4cc4lxIDOLi/ITCV3BxOQkHRrDULFQw==} + '@eslint/config-inspector@1.0.0': + resolution: {integrity: sha512-fzl4OHQazPSpsT5LIoE5qQV+8m48pdLN92lPdmIZJpQpD+kZmYC5JfxRilj5vcSaVmB9klJ8s81knNyC3hG7Eg==} hasBin: true peerDependencies: eslint: ^8.50.0 || ^9.0.0 @@ -5692,8 +5692,8 @@ packages: resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==} engines: {node: '>=10'} - h3@1.13.0: - resolution: {integrity: sha512-vFEAu/yf8UMUcB4s43OaDaigcqpQd14yanmOsn+NcRX3/guSKncyE2rOYhq8RIchgJrPSs/QiIddnTTR1ddiAg==} + h3@1.13.1: + resolution: {integrity: sha512-u/z6Z4YY+ANZ05cRRfsFJadTBrNA6e3jxdU+AN5UCbZSZEUwgHiwjvUEe0k1NoQmAvQmETwr+xB5jd7mhCJuIQ==} hachure-fill@0.5.2: resolution: {integrity: sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==} @@ -6088,58 +6088,58 @@ packages: layout-base@2.0.1: resolution: {integrity: sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==} - lefthook-darwin-arm64@1.10.4: - resolution: {integrity: sha512-ARVuQwMFkKBy++2W4ACwCf5oy93qfOs0KKjJM1ssvgLB25MtJQeIhEoJ10sPXYkEnLZnEkfAtX4womVEjCXyXw==} + lefthook-darwin-arm64@1.10.5: + resolution: {integrity: sha512-Sllv7RgzR33gwmnWf6dFttzXbA78f9dBDhX4IVJUUSa5AM/6uvchooM7+sdvv3+G8aR3MsGewIImlZoD5rn3wg==} cpu: [arm64] os: [darwin] - lefthook-darwin-x64@1.10.4: - resolution: {integrity: sha512-KQw7nPtdF3+Bf9UQMdME2jzEu9KJJhAt5SdS9/JTDcfXTwBd1tz3l1bQT4BmvP2Du3XqSvgttWCrhGfIkfO9mw==} + lefthook-darwin-x64@1.10.5: + resolution: {integrity: sha512-pClWV5IpCjBDYD7QetQMxOjZQ/9/ry8HH9QGHPAHELHISqpMePd9sVvaRBQNeq9KY2nqmn46/4oJ+dCI3jUEuQ==} cpu: [x64] os: [darwin] - lefthook-freebsd-arm64@1.10.4: - resolution: {integrity: sha512-BMXbiB6cF8Cr8pyE3r/hPzBMZJqTNZ4dwC5w/RQTvori5kow8kDgiby2pNVq3gaYvyg4TpXccc8dGgjQoOBHRQ==} + lefthook-freebsd-arm64@1.10.5: + resolution: {integrity: sha512-5xqw26FSE0UEYLXkbTuPQcLpCbchCRDVaMwGN7jbF5WpeFAinYumfZ/ZzmXtfE+l4DSMALc/62EpA2sEtOxAuA==} cpu: [arm64] os: [freebsd] - lefthook-freebsd-x64@1.10.4: - resolution: {integrity: sha512-ClXTNqa4DyXJjZ2u8SINx4XxHWOvJ7FFbtqPl+NJiPmToRZ/nYVaeZakgHTblupB3z/xggiPAKdlKbqABELCzw==} + lefthook-freebsd-x64@1.10.5: + resolution: {integrity: sha512-tLOol890ozyZ1cvlZWqk6StBwA5yFifwuoWcFFdGCDJp10NSs6EmKedYKxLVP+v7gcaqg+69bnGgZpPgG9KCoA==} cpu: [x64] os: [freebsd] - lefthook-linux-arm64@1.10.4: - resolution: {integrity: sha512-DyBOXztZSlbMJaQzZ41d+FKgYMC1RzJqHeHFjGMKGNF1Q8eUfW1gGhrBM7yfSJIFAuqOCUK6fw7hI5l7YbOLuQ==} + lefthook-linux-arm64@1.10.5: + resolution: {integrity: sha512-ygVMXFUOVMIwC4cFSUr1YVXkyazLMwQfHc6Bh+D3RraHQ4CuqfGLr9Dqg3JUxQrczOsWlvw7m8fAgz37n4hquQ==} cpu: [arm64] os: [linux] - lefthook-linux-x64@1.10.4: - resolution: {integrity: sha512-V3U/8rs1/6nCmghs4YRGdxPonTLVtvs/W3Ji6UQXFqGLeNAhlhTj2XTYko+vY2QfmavThBpqOtw36Line+d6iw==} + lefthook-linux-x64@1.10.5: + resolution: {integrity: sha512-zu8nnQKjM8P+awoRpIqbyo83Oi88QVDjS5veIXGj61bVNvrMJHMGqMseKJVV+6DNGuTOFx+7W2Iv5OrzQKJgGw==} cpu: [x64] os: [linux] - lefthook-openbsd-arm64@1.10.4: - resolution: {integrity: sha512-+vCvGHqf5qqijbBgjBaQBzV4Mpl16UIgw0QQmnS0oYiaL5HQND3KPSA/bsLnoXe9UWvpIQY4GfMVpqhdl2HN4Q==} + lefthook-openbsd-arm64@1.10.5: + resolution: {integrity: sha512-XRQ4/Jxfm2HnVQB8ZI2f35JNeuO4PANKpO6u29eNMlCJh9HejbdyDbZ3EpS8qIFREkHOxaiKI3fbYd5nsOKcUw==} cpu: [arm64] os: [openbsd] - lefthook-openbsd-x64@1.10.4: - resolution: {integrity: sha512-kvHxriC02YQY9egRD43uzMA7Y/VWo+CzcW894ovpmROOCmmipydDoWPoEd+kknyYyNmntXhXgebAopCy/ZOr8A==} + lefthook-openbsd-x64@1.10.5: + resolution: {integrity: sha512-cVWj6oHOpQ8SdSxfQ920TceSzJyf3jwYJ/QTG4Du2yyl8kds6D3l4Qo54zvfTCeEkOFiY+pAODLLYdQZOEQSnw==} cpu: [x64] os: [openbsd] - lefthook-windows-arm64@1.10.4: - resolution: {integrity: sha512-jSta3l7gYjZWCytvmEC039XXbuvJiZO8hawR3B6nWZFgjaYA0ECS6/fdxuz1kGxd1zMDrvnFoOeTcSGQwHGmaA==} + lefthook-windows-arm64@1.10.5: + resolution: {integrity: sha512-ISyQZlV5P4VmAk8ovdqPyNse4XDp4WM21AKzaDvaGvT/NRgg9Qn9yHFeChgjlUQJitOF7GsQ2hqfli6P4xk62A==} cpu: [arm64] os: [win32] - lefthook-windows-x64@1.10.4: - resolution: {integrity: sha512-d6jOidPQ8HTmXHH8izE7/BY4ZHAsCVgkfSyQI13rvBahZfPjmtE0yNBfd2MC+xyxW1E8M0uloy7ZhAYM4WZjdw==} + lefthook-windows-x64@1.10.5: + resolution: {integrity: sha512-s9tEKZXi3iRqVW/u/9qwOGAiRfDzeO0kNJZKT0JVH3MnZwewF/pVYh+XcfcoNr+SSgsiKvZalN41Sl7XrKyoAw==} cpu: [x64] os: [win32] - lefthook@1.10.4: - resolution: {integrity: sha512-DwRkvZA7IeZv9hwdXKr0PIi0FX1/2ehU5ImPYCs1q9QlPQVmKBborb/z5BnI5k/y52qaAHCgBhcuhm5cwLjMSQ==} + lefthook@1.10.5: + resolution: {integrity: sha512-zVRJtGh6wK6DuUVFeGrYmnSk2fB6L1wh0hOPbRw4E5CMHo7uiTD2f5zRh7VKtMS8jFUnw9sEprffoYqRkJWdeA==} hasBin: true levn@0.4.1: @@ -6308,8 +6308,8 @@ packages: markdown-table@3.0.4: resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==} - markdownlint@0.37.3: - resolution: {integrity: sha512-eoQqH0291YCCjd+Pe1PUQ9AmWthlVmS0XWgcionkZ8q34ceZyRI+pYvsWksXJJL8OBkWCPwp1h/pnXxrPFC4oA==} + markdownlint@0.37.4: + resolution: {integrity: sha512-u00joA/syf3VhWh6/ybVFkib5Zpj2e5KB/cfCei8fkSRuums6nyisTWGqjTWIOFoFwuXoTBQQiqlB4qFKp8ncQ==} engines: {node: '>=18'} marked@13.0.3: @@ -6574,6 +6574,9 @@ packages: mlly@1.7.3: resolution: {integrity: sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==} + mlly@1.7.4: + resolution: {integrity: sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==} + mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -6915,6 +6918,9 @@ packages: pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + pathe@2.0.1: + resolution: {integrity: sha512-6jpjMpOth5S9ITVu5clZ7NOgHNsv5vRQdheL9ztp2vZmM6fRbLvyua1tiBIL4lk8SAe3ARzeXEly6siXCjDHDw==} + pathval@2.0.0: resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} engines: {node: '>= 14.16'} @@ -7024,8 +7030,8 @@ packages: resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} - postcss@8.5.0: - resolution: {integrity: sha512-27VKOqrYfPncKA2NrFOVhP5MGAfHKLYn/Q0mz9cNQyRAKYi3VNHwYU2qKKqPCqgBmeeJ0uAFB56NumXZ5ZReXg==} + postcss@8.5.1: + resolution: {integrity: sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==} engines: {node: ^10 || ^12 || >=14} prelude-ls@1.2.1: @@ -9794,7 +9800,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/config-inspector@0.7.1(eslint@9.18.0(jiti@2.4.2))': + '@eslint/config-inspector@1.0.0(eslint@9.18.0(jiti@2.4.2))': dependencies: '@nodelib/fs.walk': 3.0.1 bundle-require: 5.1.0(esbuild@0.24.2) @@ -9806,8 +9812,8 @@ snapshots: fast-glob: 3.3.3 find-up: 7.0.0 get-port-please: 3.1.2 - h3: 1.13.0 - mlly: 1.7.3 + h3: 1.13.1 + mlly: 1.7.4 mrmime: 2.0.0 open: 10.1.0 picocolors: 1.1.1 @@ -10979,7 +10985,7 @@ snapshots: '@tailwindcss/node': 4.0.0-beta.9 '@tailwindcss/oxide': 4.0.0-beta.9 lightningcss: 1.29.1 - postcss: 8.5.0 + postcss: 8.5.1 tailwindcss: 4.0.0-beta.9 '@tanstack/react-virtual@3.11.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': @@ -11551,7 +11557,7 @@ snapshots: '@vue/shared': 3.5.13 estree-walker: 2.0.2 magic-string: 0.30.17 - postcss: 8.5.0 + postcss: 8.5.1 source-map-js: 1.2.1 '@vue/compiler-ssr@3.5.13': @@ -13247,7 +13253,7 @@ snapshots: dependencies: duplexer: 0.1.2 - h3@1.13.0: + h3@1.13.1: dependencies: cookie-es: 1.2.2 crossws: 0.3.1 @@ -13672,48 +13678,48 @@ snapshots: layout-base@2.0.1: {} - lefthook-darwin-arm64@1.10.4: + lefthook-darwin-arm64@1.10.5: optional: true - lefthook-darwin-x64@1.10.4: + lefthook-darwin-x64@1.10.5: optional: true - lefthook-freebsd-arm64@1.10.4: + lefthook-freebsd-arm64@1.10.5: optional: true - lefthook-freebsd-x64@1.10.4: + lefthook-freebsd-x64@1.10.5: optional: true - lefthook-linux-arm64@1.10.4: + lefthook-linux-arm64@1.10.5: optional: true - lefthook-linux-x64@1.10.4: + lefthook-linux-x64@1.10.5: optional: true - lefthook-openbsd-arm64@1.10.4: + lefthook-openbsd-arm64@1.10.5: optional: true - lefthook-openbsd-x64@1.10.4: + lefthook-openbsd-x64@1.10.5: optional: true - lefthook-windows-arm64@1.10.4: + lefthook-windows-arm64@1.10.5: optional: true - lefthook-windows-x64@1.10.4: + lefthook-windows-x64@1.10.5: optional: true - lefthook@1.10.4: + lefthook@1.10.5: optionalDependencies: - lefthook-darwin-arm64: 1.10.4 - lefthook-darwin-x64: 1.10.4 - lefthook-freebsd-arm64: 1.10.4 - lefthook-freebsd-x64: 1.10.4 - lefthook-linux-arm64: 1.10.4 - lefthook-linux-x64: 1.10.4 - lefthook-openbsd-arm64: 1.10.4 - lefthook-openbsd-x64: 1.10.4 - lefthook-windows-arm64: 1.10.4 - lefthook-windows-x64: 1.10.4 + lefthook-darwin-arm64: 1.10.5 + lefthook-darwin-x64: 1.10.5 + lefthook-freebsd-arm64: 1.10.5 + lefthook-freebsd-x64: 1.10.5 + lefthook-linux-arm64: 1.10.5 + lefthook-linux-x64: 1.10.5 + lefthook-openbsd-arm64: 1.10.5 + lefthook-openbsd-x64: 1.10.5 + lefthook-windows-arm64: 1.10.5 + lefthook-windows-x64: 1.10.5 levn@0.4.1: dependencies: @@ -13853,7 +13859,7 @@ snapshots: markdown-table@3.0.4: {} - markdownlint@0.37.3: + markdownlint@0.37.4: dependencies: markdown-it: 14.1.0 micromark: 4.0.1 @@ -14457,6 +14463,13 @@ snapshots: pkg-types: 1.3.0 ufo: 1.5.4 + mlly@1.7.4: + dependencies: + acorn: 8.14.0 + pathe: 2.0.1 + pkg-types: 1.3.0 + ufo: 1.5.4 + mri@1.2.0: {} mrmime@2.0.0: {} @@ -14874,6 +14887,8 @@ snapshots: pathe@1.1.2: {} + pathe@2.0.1: {} + pathval@2.0.0: {} picocolors@1.1.1: {} @@ -14931,12 +14946,12 @@ snapshots: optionalDependencies: postcss: 8.4.49 - postcss-load-config@6.0.1(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(yaml@2.7.0): + postcss-load-config@6.0.1(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(yaml@2.7.0): dependencies: lilconfig: 3.1.3 optionalDependencies: jiti: 2.4.2 - postcss: 8.5.0 + postcss: 8.5.1 tsx: 4.19.2 yaml: 2.7.0 @@ -14964,7 +14979,7 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - postcss@8.5.0: + postcss@8.5.1: dependencies: nanoid: 3.3.8 picocolors: 1.1.1 @@ -15810,7 +15825,7 @@ snapshots: tslib@2.8.1: {} - tsup@8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0): + tsup@8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0): dependencies: bundle-require: 5.1.0(esbuild@0.24.2) cac: 6.7.14 @@ -15820,7 +15835,7 @@ snapshots: esbuild: 0.24.2 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(yaml@2.7.0) + postcss-load-config: 6.0.1(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(yaml@2.7.0) resolve-from: 5.0.0 rollup: 4.30.1 source-map: 0.8.0-beta.0 @@ -15830,7 +15845,7 @@ snapshots: tree-kill: 1.2.2 optionalDependencies: '@swc/core': 1.10.7(@swc/helpers@0.5.15) - postcss: 8.5.0 + postcss: 8.5.1 typescript: 5.7.3 transitivePeerDependencies: - jiti @@ -16202,7 +16217,7 @@ snapshots: vite@5.4.11(@types/node@22.10.6)(lightningcss@1.29.1): dependencies: esbuild: 0.21.5 - postcss: 8.5.0 + postcss: 8.5.1 rollup: 4.30.1 optionalDependencies: '@types/node': 22.10.6 diff --git a/website/package.json b/website/package.json index ce37463c1f..f2c9cb4145 100644 --- a/website/package.json +++ b/website/package.json @@ -42,7 +42,7 @@ "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-refresh": "^0.4.18", "eslint-plugin-simple-import-sort": "^12.1.1", - "postcss": "^8.5.0", + "postcss": "^8.5.1", "remark-code-import": "^1.2.0", "remark-frontmatter": "^5.0.0", "remark-gfm": "^4.0.0",