@eslint-sukka/react 6.1.11-beta.1 → 6.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,n=require("@eslint-sukka/shared"),r=require("@next/eslint-plugin-next"),t=require("@eslint-sukka/eslint-plugin-react-jsx-a11y"),s=require("eslint-plugin-react-hooks"),o=require("eslint-plugin-react-compiler"),a=require("eslint-plugin-react-refresh"),i=require("@eslint-react/eslint-plugin"),l=require("@stylistic/eslint-plugin-jsx"),c=require("eslint-plugin-ssr-friendly"),p=require("@eslint/compat"),m=require("@stylexjs/eslint-plugin"),u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},d={exports:{}},f={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ALLOW_JSX_UTILITY_CLASS=e.ALLOW_COMPONENT_DID_CATCH=e.COMPONENT_SHOULD_BE_FUNCTION=void 0,e.COMPONENT_SHOULD_BE_FUNCTION="componentShouldBeFunction",e.ALLOW_COMPONENT_DID_CATCH="allowComponentDidCatch",e.ALLOW_JSX_UTILITY_CLASS="allowJsxUtilityClass";let n={meta:{docs:{description:"Enforce components are written as function components",category:"Stylistic Issues",recommended:!1,suggestion:!1,url:"https://github.com/tatethurston/eslint-plugin-react-prefer-function-component#rule-details"},type:"problem",messages:{[e.COMPONENT_SHOULD_BE_FUNCTION]:"Class component should be written as a function"},schema:[{type:"object",properties:{[e.ALLOW_COMPONENT_DID_CATCH]:{default:!0,type:"boolean"},[e.ALLOW_JSX_UTILITY_CLASS]:{default:!1,type:"boolean"}},additionalProperties:!1}]},create(n){var r,t,s,o;let a=null===(t=null===(r=n.options[0])||void 0===r?void 0:r.allowComponentDidCatch)||void 0===t||t,i=null!==(o=null===(s=n.options[0])||void 0===s?void 0:s.allowJsxUtilityClass)&&void 0!==o&&o,l=new Set;function c(e){void 0!==e.body.body.find(e=>{var n;return(null===(n=e.key)||void 0===n?void 0:n.name)==="componentDidCatch"})&&a||l.add(e)}function p(e){i||c(e)}return{"ClassDeclaration:has(JSXElement)":p,"ClassDeclaration:has(JSXFragment)":p,"ClassExpression:has(JSXElement)":p,"ClassExpression:has(JSXFragment)":p,"ClassDeclaration:has(JSXElement):has(MethodDefinition[key.name='render'])":c,"ClassDeclaration:has(JSXFragment):has(MethodDefinition[key.name='render'])":c,"ClassExpression:has(JSXElement):has(MethodDefinition[key.name='render'])":c,"ClassExpression:has(JSXFragment):has(MethodDefinition[key.name='render'])":c,"ClassDeclaration[superClass.object.name='React'][superClass.property.name='Component']":c,"ClassDeclaration[superClass.object.name='React'][superClass.property.name='PureComponent']":c,"ClassDeclaration[superClass.name='Component']":c,"ClassDeclaration[superClass.name='PureComponent']":c,"ClassExpression[superClass.object.name='React'][superClass.property.name='Component']":c,"ClassExpression[superClass.object.name='React'][superClass.property.name='PureComponent']":c,"ClassExpression[superClass.name='Component']":c,"ClassExpression[superClass.name='PureComponent']":c,"Program:exit"(){l.forEach(r=>{r.id?r=r.id:"VariableDeclarator"==r.parent.type&&(r=r.parent.id),n.report({node:r,messageId:e.COMPONENT_SHOULD_BE_FUNCTION})})}}}};e.default=n}(f);var
|
|
1
|
+
"use strict";var e,n=require("@eslint-sukka/shared"),r=require("@next/eslint-plugin-next"),t=require("@eslint-sukka/eslint-plugin-react-jsx-a11y"),s=require("eslint-plugin-react-hooks"),o=require("eslint-plugin-react-compiler"),a=require("eslint-plugin-react-refresh"),i=require("@eslint-react/eslint-plugin"),l=require("@stylistic/eslint-plugin-jsx"),c=require("eslint-plugin-ssr-friendly"),p=require("@eslint/compat"),m=require("@stylexjs/eslint-plugin"),u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},d={exports:{}},f={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ALLOW_JSX_UTILITY_CLASS=e.ALLOW_COMPONENT_DID_CATCH=e.COMPONENT_SHOULD_BE_FUNCTION=void 0,e.COMPONENT_SHOULD_BE_FUNCTION="componentShouldBeFunction",e.ALLOW_COMPONENT_DID_CATCH="allowComponentDidCatch",e.ALLOW_JSX_UTILITY_CLASS="allowJsxUtilityClass";let n={meta:{docs:{description:"Enforce components are written as function components",category:"Stylistic Issues",recommended:!1,suggestion:!1,url:"https://github.com/tatethurston/eslint-plugin-react-prefer-function-component#rule-details"},type:"problem",messages:{[e.COMPONENT_SHOULD_BE_FUNCTION]:"Class component should be written as a function"},schema:[{type:"object",properties:{[e.ALLOW_COMPONENT_DID_CATCH]:{default:!0,type:"boolean"},[e.ALLOW_JSX_UTILITY_CLASS]:{default:!1,type:"boolean"}},additionalProperties:!1}]},create(n){var r,t,s,o;let a=null===(t=null===(r=n.options[0])||void 0===r?void 0:r.allowComponentDidCatch)||void 0===t||t,i=null!==(o=null===(s=n.options[0])||void 0===s?void 0:s.allowJsxUtilityClass)&&void 0!==o&&o,l=new Set;function c(e){void 0!==e.body.body.find(e=>{var n;return(null===(n=e.key)||void 0===n?void 0:n.name)==="componentDidCatch"})&&a||l.add(e)}function p(e){i||c(e)}return{"ClassDeclaration:has(JSXElement)":p,"ClassDeclaration:has(JSXFragment)":p,"ClassExpression:has(JSXElement)":p,"ClassExpression:has(JSXFragment)":p,"ClassDeclaration:has(JSXElement):has(MethodDefinition[key.name='render'])":c,"ClassDeclaration:has(JSXFragment):has(MethodDefinition[key.name='render'])":c,"ClassExpression:has(JSXElement):has(MethodDefinition[key.name='render'])":c,"ClassExpression:has(JSXFragment):has(MethodDefinition[key.name='render'])":c,"ClassDeclaration[superClass.object.name='React'][superClass.property.name='Component']":c,"ClassDeclaration[superClass.object.name='React'][superClass.property.name='PureComponent']":c,"ClassDeclaration[superClass.name='Component']":c,"ClassDeclaration[superClass.name='PureComponent']":c,"ClassExpression[superClass.object.name='React'][superClass.property.name='Component']":c,"ClassExpression[superClass.object.name='React'][superClass.property.name='PureComponent']":c,"ClassExpression[superClass.name='Component']":c,"ClassExpression[superClass.name='PureComponent']":c,"Program:exit"(){l.forEach(r=>{r.id?r=r.id:"VariableDeclarator"==r.parent.type&&(r=r.parent.id),n.report({node:r,messageId:e.COMPONENT_SHOULD_BE_FUNCTION})})}}}};e.default=n}(f);var g=d.exports,x=u&&u.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(g,"__esModule",{value:!0});const y={configs:{recommended:{plugins:["react-prefer-function-component"],rules:{"react-prefer-function-component/react-prefer-function-component":"error"}}},rules:{"react-prefer-function-component":x(f).default}};d.exports=y;var C=(e=d.exports)&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;const h=n.memo(i,"@eslint-react/eslint-plugin"),_=n.memo(p.fixupPluginRules(c),"eslint-plugin-ssr-friendly");exports.next=()=>[{plugins:{"@next/next":r},files:[n.constants.GLOB_TS,n.constants.GLOB_TSX,n.constants.GLOB_JSX],rules:{...r.configs.recommended.rules,...r.configs["core-web-vitals"].rules,"@next/next/no-img-element":"off"}}],exports.react=({reactCompiler:e="error",additionalHooks:r="(useIsomorphicLayoutEffect|useSukkaManyOtherCustomEffectHookExample)",nextjs:i=!1,remix:c=!1,reactRefresh:p={},additionalHooksWithType:m={useLayoutEffect:["useIsomorphicLayoutEffect"],useEffect:["useAbortableEffect"]},additionalComponents:u=[{name:"Link",as:"a",attributes:[{name:"to",as:"href"},{name:"rel",as:"rel"}]}]}={})=>{let{allowConstantExport:d=!1}=p;return[{name:"@eslint-sukka/react base",files:[n.constants.GLOB_TS,n.constants.GLOB_TSX,n.constants.GLOB_JSX],plugins:{"jsx-a11y-minimal":n.memo(t.eslint_plugin_jsx_a11y_minimal,"@eslint-sukka/eslint-plugin-react-jsx-a11y#eslint_plugin_jsx_a11y_minimal"),"react-hooks":n.memo(s,"eslint-plugin-react-hooks"),"@stylistic/jsx":n.memo(l,"@stylistic/eslint-plugin-jsx"),"react-prefer-function-component":n.memo(C,"eslint-plugin-react-prefer-function-component"),"react-compiler":n.memo(o,"eslint-plugin-react-compiler"),...h.configs["recommended-type-checked"].plugins,"ssr-friendly":_,"react-refresh":a},settings:{"react-x":{version:"detect",additionalHooks:m,additionalComponents:u}},languageOptions:{globals:n.globals.browser},rules:{...s.configs.recommended.rules,"react-compiler/react-compiler":e,"react-hooks/exhaustive-deps":["error",{additionalHooks:r}],"@stylistic/jsx/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],...h.configs["recommended-type-checked"].rules,"@eslint-react/no-string-refs":"error","@eslint-react/no-comment-textnodes":"error","@eslint-react/dom/no-unsafe-target-blank":"error","@eslint-react/no-children-prop":"error","@eslint-react/dom/no-dangerously-set-innerhtml-with-children":"error","@eslint-react/dom/no-render-return-value":"error","@eslint-react/no-direct-mutation-state":"error","@eslint-react/dom/no-find-dom-node":"error","@eslint-react/no-unsafe-component-will-mount":"warn","@eslint-react/no-unsafe-component-will-receive-props":"warn","@eslint-react/no-unsafe-component-will-update":"warn","@eslint-react/no-unused-state":"error","@eslint-react/no-access-state-in-setstate":"error","@eslint-react/dom/no-script-url":"error","@eslint-react/no-unused-class-component-members":"error","@eslint-react/naming-convention/component-name":["error",{rule:"PascalCase"}],"@eslint-react/naming-convention/filename":["error",{rule:"kebab-case"}],"@eslint-react/naming-convention/filename-extension":["error",{allow:"as-needed"}],"@eslint-react/naming-convention/use-state":"error","react-prefer-function-component/react-prefer-function-component":"error","@stylistic/jsx/jsx-self-closing-comp":"error","@eslint-react/prefer-shorthand-boolean":"error","@stylistic/jsx/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"@stylistic/jsx/jsx-indent-props":["error",2],"@stylistic/jsx/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"@stylistic/jsx/jsx-wrap-multilines":["error",{declaration:"parens-new-line",assignment:"parens-new-line",return:"parens-new-line",arrow:"parens-new-line",condition:"ignore",logical:"ignore",prop:"ignore"}],"@stylistic/jsx/jsx-first-prop-new-line":["error","multiline-multiprop"],"@stylistic/jsx/jsx-equals-spacing":["error","never"],"@stylistic/jsx/jsx-indent":"off","@stylistic/jsx/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never",beforeClosing:"never"}],"@eslint-react/dom/no-children-in-void-dom-elements":"error","@stylistic/jsx/jsx-curly-brace-presence":["error",{props:"never",children:"never"}],"@stylistic/jsx/jsx-props-no-multi-spaces":"error","@eslint-react/prefer-shorthand-fragment":"error","@stylistic/jsx/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"@eslint-react/no-missing-key":"error","@eslint-react/no-array-index-key":"error","@eslint-react/no-duplicate-key":"error","@eslint-react/no-implicit-key":"error","@eslint-react/no-useless-fragment":"error","@eslint-react/no-unstable-context-value":"error","@eslint-react/no-nested-components":"error","@eslint-react/dom/no-missing-iframe-sandbox":"warn","@eslint-react/dom/no-unsafe-iframe-sandbox":"warn","@eslint-react/no-leaked-conditional-rendering":"error","@eslint-react/no-unstable-default-props":"error","@eslint-react/dom/no-missing-button-type":"error","@eslint-react/dom/no-namespace":"error","class-methods-use-this":["error",{exceptMethods:["render","getInitialState","getDefaultProps","getChildContext","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","componentDidUpdate","componentWillUnmount","componentDidCatch","getSnapshotBeforeUpdate"]}],"jsx-a11y-minimal/alt-text":["warn",{elements:["img"],img:["Image"]}],"jsx-a11y-minimal/aria-props":"warn","jsx-a11y-minimal/aria-proptypes":"warn","jsx-a11y-minimal/aria-role":"warn","jsx-a11y-minimal/aria-unsupported-elements":"warn","jsx-a11y-minimal/iframe-has-title":"warn","jsx-a11y-minimal/no-access-key":"warn","jsx-a11y-minimal/role-has-required-aria-props":"warn","jsx-a11y-minimal/role-supports-aria-props":"warn","jsx-a11y-minimal/tabindex-no-positive":"warn","react-refresh/only-export-components":["warn",{allowConstantExport:d,allowExportNames:[...i?["config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...c?["meta","links","headers","loader","action"]:[]]}],"prefer-arrow-callback":["error",{allowNamedFunctions:!0,allowUnboundThis:!0}]}}]},exports.stylex=({opt:e={}}={})=>[{plugins:{"@stylex":m},files:[n.constants.GLOB_TS,n.constants.GLOB_TSX,n.constants.GLOB_JSX],rules:{"@stylexjs/valid-styles":["error",e],"@stylexjs/valid-shorthands":["error",e]}}];
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{constants as e,memo as n,globals as r}from"@eslint-sukka/shared";import t from"@next/eslint-plugin-next";import{eslint_plugin_jsx_a11y_minimal as s}from"@eslint-sukka/eslint-plugin-react-jsx-a11y";import o from"eslint-plugin-react-hooks";import a from"eslint-plugin-react-compiler";import i from"eslint-plugin-react-refresh";import l from"@eslint-react/eslint-plugin";import c from"@stylistic/eslint-plugin-jsx";import p from"eslint-plugin-ssr-friendly";import{fixupPluginRules as m}from"@eslint/compat";import u from"@stylexjs/eslint-plugin";let d=()=>[{plugins:{"@next/next":t},files:[e.GLOB_TS,e.GLOB_TSX,e.GLOB_JSX],rules:{...t.configs.recommended.rules,...t.configs["core-web-vitals"].rules,"@next/next/no-img-element":"off"}}];var f,g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},x={exports:{}},y={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ALLOW_JSX_UTILITY_CLASS=e.ALLOW_COMPONENT_DID_CATCH=e.COMPONENT_SHOULD_BE_FUNCTION=void 0,e.COMPONENT_SHOULD_BE_FUNCTION="componentShouldBeFunction",e.ALLOW_COMPONENT_DID_CATCH="allowComponentDidCatch",e.ALLOW_JSX_UTILITY_CLASS="allowJsxUtilityClass";let n={meta:{docs:{description:"Enforce components are written as function components",category:"Stylistic Issues",recommended:!1,suggestion:!1,url:"https://github.com/tatethurston/eslint-plugin-react-prefer-function-component#rule-details"},type:"problem",messages:{[e.COMPONENT_SHOULD_BE_FUNCTION]:"Class component should be written as a function"},schema:[{type:"object",properties:{[e.ALLOW_COMPONENT_DID_CATCH]:{default:!0,type:"boolean"},[e.ALLOW_JSX_UTILITY_CLASS]:{default:!1,type:"boolean"}},additionalProperties:!1}]},create(n){var r,t,s,o;let a=null===(t=null===(r=n.options[0])||void 0===r?void 0:r.allowComponentDidCatch)||void 0===t||t,i=null!==(o=null===(s=n.options[0])||void 0===s?void 0:s.allowJsxUtilityClass)&&void 0!==o&&o,l=new Set;function c(e){void 0!==e.body.body.find(e=>{var n;return(null===(n=e.key)||void 0===n?void 0:n.name)==="componentDidCatch"})&&a||l.add(e)}function p(e){i||c(e)}return{"ClassDeclaration:has(JSXElement)":p,"ClassDeclaration:has(JSXFragment)":p,"ClassExpression:has(JSXElement)":p,"ClassExpression:has(JSXFragment)":p,"ClassDeclaration:has(JSXElement):has(MethodDefinition[key.name='render'])":c,"ClassDeclaration:has(JSXFragment):has(MethodDefinition[key.name='render'])":c,"ClassExpression:has(JSXElement):has(MethodDefinition[key.name='render'])":c,"ClassExpression:has(JSXFragment):has(MethodDefinition[key.name='render'])":c,"ClassDeclaration[superClass.object.name='React'][superClass.property.name='Component']":c,"ClassDeclaration[superClass.object.name='React'][superClass.property.name='PureComponent']":c,"ClassDeclaration[superClass.name='Component']":c,"ClassDeclaration[superClass.name='PureComponent']":c,"ClassExpression[superClass.object.name='React'][superClass.property.name='Component']":c,"ClassExpression[superClass.object.name='React'][superClass.property.name='PureComponent']":c,"ClassExpression[superClass.name='Component']":c,"ClassExpression[superClass.name='PureComponent']":c,"Program:exit"(){l.forEach(r=>{r.id?r=r.id:"VariableDeclarator"==r.parent.type&&(r=r.parent.id),n.report({node:r,messageId:e.COMPONENT_SHOULD_BE_FUNCTION})})}}}};e.default=n}(y);var C=x.exports,h=g&&g.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(C,"__esModule",{value:!0});let _={configs:{recommended:{plugins:["react-prefer-function-component"],rules:{"react-prefer-function-component/react-prefer-function-component":"error"}}},rules:{"react-prefer-function-component":h(y).default}};x.exports=_;var j=(f=x.exports)&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f;let w=n(l,"@eslint-react/eslint-plugin"),O=n(m(p),"eslint-plugin-ssr-friendly"),b=({reactCompiler:t="error",additionalHooks:l="(useIsomorphicLayoutEffect|useSukkaManyOtherCustomEffectHookExample)",nextjs:p=!1,remix:m=!1,reactRefresh:u={},additionalHooksWithType:d={useLayoutEffect:["useIsomorphicLayoutEffect"],useEffect:["useAbortableEffect"]},additionalComponents:f=[{name:"Link",as:"a",attributes:[{name:"to",as:"href"},{name:"rel",as:"rel"}]}]}={})=>{let{allowConstantExport:g=!1}=u;return[{name:"@eslint-sukka/react base",files:[e.GLOB_TS,e.GLOB_TSX,e.GLOB_JSX],plugins:{"jsx-a11y-minimal":n(s,"@eslint-sukka/eslint-plugin-react-jsx-a11y#eslint_plugin_jsx_a11y_minimal"),"react-hooks":n(o,"eslint-plugin-react-hooks"),"@stylistic/jsx":n(c,"@stylistic/eslint-plugin-jsx"),"react-prefer-function-component":n(j,"eslint-plugin-react-prefer-function-component"),"react-compiler":n(a,"eslint-plugin-react-compiler"),...w.configs["recommended-type-checked"].plugins,"ssr-friendly":O,"react-refresh":i},settings:{"react-x":{version:"detect",additionalHooks:d,additionalComponents:f}},languageOptions:{globals:r.browser},rules:{...o.configs.recommended.rules,"react-compiler/react-compiler":t,"react-hooks/exhaustive-deps":["error",{additionalHooks:l}],"@stylistic/jsx/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],...w.configs["recommended-type-checked"].rules,"@eslint-react/no-string-refs":"error","@eslint-react/no-comment-textnodes":"error","@eslint-react/dom/no-unsafe-target-blank":"error","@eslint-react/no-children-prop":"error","@eslint-react/dom/no-dangerously-set-innerhtml-with-children":"error","@eslint-react/dom/no-render-return-value":"error","@eslint-react/no-direct-mutation-state":"error","@eslint-react/dom/no-find-dom-node":"error","@eslint-react/no-unsafe-component-will-mount":"warn","@eslint-react/no-unsafe-component-will-receive-props":"warn","@eslint-react/no-unsafe-component-will-update":"warn","@eslint-react/no-unused-state":"error","@eslint-react/no-access-state-in-setstate":"error","@eslint-react/dom/no-script-url":"error","@eslint-react/no-unused-class-component-members":"error","@eslint-react/naming-convention/filename":["error",{rule:"kebab-case"}],"@eslint-react/naming-convention/filename-extension":["error",{allow:"as-needed"}],"react-prefer-function-component/react-prefer-function-component":"error","@
|
|
1
|
+
import{constants as e,memo as n,globals as r}from"@eslint-sukka/shared";import t from"@next/eslint-plugin-next";import{eslint_plugin_jsx_a11y_minimal as s}from"@eslint-sukka/eslint-plugin-react-jsx-a11y";import o from"eslint-plugin-react-hooks";import a from"eslint-plugin-react-compiler";import i from"eslint-plugin-react-refresh";import l from"@eslint-react/eslint-plugin";import c from"@stylistic/eslint-plugin-jsx";import p from"eslint-plugin-ssr-friendly";import{fixupPluginRules as m}from"@eslint/compat";import u from"@stylexjs/eslint-plugin";let d=()=>[{plugins:{"@next/next":t},files:[e.GLOB_TS,e.GLOB_TSX,e.GLOB_JSX],rules:{...t.configs.recommended.rules,...t.configs["core-web-vitals"].rules,"@next/next/no-img-element":"off"}}];var f,g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},x={exports:{}},y={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ALLOW_JSX_UTILITY_CLASS=e.ALLOW_COMPONENT_DID_CATCH=e.COMPONENT_SHOULD_BE_FUNCTION=void 0,e.COMPONENT_SHOULD_BE_FUNCTION="componentShouldBeFunction",e.ALLOW_COMPONENT_DID_CATCH="allowComponentDidCatch",e.ALLOW_JSX_UTILITY_CLASS="allowJsxUtilityClass";let n={meta:{docs:{description:"Enforce components are written as function components",category:"Stylistic Issues",recommended:!1,suggestion:!1,url:"https://github.com/tatethurston/eslint-plugin-react-prefer-function-component#rule-details"},type:"problem",messages:{[e.COMPONENT_SHOULD_BE_FUNCTION]:"Class component should be written as a function"},schema:[{type:"object",properties:{[e.ALLOW_COMPONENT_DID_CATCH]:{default:!0,type:"boolean"},[e.ALLOW_JSX_UTILITY_CLASS]:{default:!1,type:"boolean"}},additionalProperties:!1}]},create(n){var r,t,s,o;let a=null===(t=null===(r=n.options[0])||void 0===r?void 0:r.allowComponentDidCatch)||void 0===t||t,i=null!==(o=null===(s=n.options[0])||void 0===s?void 0:s.allowJsxUtilityClass)&&void 0!==o&&o,l=new Set;function c(e){void 0!==e.body.body.find(e=>{var n;return(null===(n=e.key)||void 0===n?void 0:n.name)==="componentDidCatch"})&&a||l.add(e)}function p(e){i||c(e)}return{"ClassDeclaration:has(JSXElement)":p,"ClassDeclaration:has(JSXFragment)":p,"ClassExpression:has(JSXElement)":p,"ClassExpression:has(JSXFragment)":p,"ClassDeclaration:has(JSXElement):has(MethodDefinition[key.name='render'])":c,"ClassDeclaration:has(JSXFragment):has(MethodDefinition[key.name='render'])":c,"ClassExpression:has(JSXElement):has(MethodDefinition[key.name='render'])":c,"ClassExpression:has(JSXFragment):has(MethodDefinition[key.name='render'])":c,"ClassDeclaration[superClass.object.name='React'][superClass.property.name='Component']":c,"ClassDeclaration[superClass.object.name='React'][superClass.property.name='PureComponent']":c,"ClassDeclaration[superClass.name='Component']":c,"ClassDeclaration[superClass.name='PureComponent']":c,"ClassExpression[superClass.object.name='React'][superClass.property.name='Component']":c,"ClassExpression[superClass.object.name='React'][superClass.property.name='PureComponent']":c,"ClassExpression[superClass.name='Component']":c,"ClassExpression[superClass.name='PureComponent']":c,"Program:exit"(){l.forEach(r=>{r.id?r=r.id:"VariableDeclarator"==r.parent.type&&(r=r.parent.id),n.report({node:r,messageId:e.COMPONENT_SHOULD_BE_FUNCTION})})}}}};e.default=n}(y);var C=x.exports,h=g&&g.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(C,"__esModule",{value:!0});let _={configs:{recommended:{plugins:["react-prefer-function-component"],rules:{"react-prefer-function-component/react-prefer-function-component":"error"}}},rules:{"react-prefer-function-component":h(y).default}};x.exports=_;var j=(f=x.exports)&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f;let w=n(l,"@eslint-react/eslint-plugin"),O=n(m(p),"eslint-plugin-ssr-friendly"),b=({reactCompiler:t="error",additionalHooks:l="(useIsomorphicLayoutEffect|useSukkaManyOtherCustomEffectHookExample)",nextjs:p=!1,remix:m=!1,reactRefresh:u={},additionalHooksWithType:d={useLayoutEffect:["useIsomorphicLayoutEffect"],useEffect:["useAbortableEffect"]},additionalComponents:f=[{name:"Link",as:"a",attributes:[{name:"to",as:"href"},{name:"rel",as:"rel"}]}]}={})=>{let{allowConstantExport:g=!1}=u;return[{name:"@eslint-sukka/react base",files:[e.GLOB_TS,e.GLOB_TSX,e.GLOB_JSX],plugins:{"jsx-a11y-minimal":n(s,"@eslint-sukka/eslint-plugin-react-jsx-a11y#eslint_plugin_jsx_a11y_minimal"),"react-hooks":n(o,"eslint-plugin-react-hooks"),"@stylistic/jsx":n(c,"@stylistic/eslint-plugin-jsx"),"react-prefer-function-component":n(j,"eslint-plugin-react-prefer-function-component"),"react-compiler":n(a,"eslint-plugin-react-compiler"),...w.configs["recommended-type-checked"].plugins,"ssr-friendly":O,"react-refresh":i},settings:{"react-x":{version:"detect",additionalHooks:d,additionalComponents:f}},languageOptions:{globals:r.browser},rules:{...o.configs.recommended.rules,"react-compiler/react-compiler":t,"react-hooks/exhaustive-deps":["error",{additionalHooks:l}],"@stylistic/jsx/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],...w.configs["recommended-type-checked"].rules,"@eslint-react/no-string-refs":"error","@eslint-react/no-comment-textnodes":"error","@eslint-react/dom/no-unsafe-target-blank":"error","@eslint-react/no-children-prop":"error","@eslint-react/dom/no-dangerously-set-innerhtml-with-children":"error","@eslint-react/dom/no-render-return-value":"error","@eslint-react/no-direct-mutation-state":"error","@eslint-react/dom/no-find-dom-node":"error","@eslint-react/no-unsafe-component-will-mount":"warn","@eslint-react/no-unsafe-component-will-receive-props":"warn","@eslint-react/no-unsafe-component-will-update":"warn","@eslint-react/no-unused-state":"error","@eslint-react/no-access-state-in-setstate":"error","@eslint-react/dom/no-script-url":"error","@eslint-react/no-unused-class-component-members":"error","@eslint-react/naming-convention/component-name":["error",{rule:"PascalCase"}],"@eslint-react/naming-convention/filename":["error",{rule:"kebab-case"}],"@eslint-react/naming-convention/filename-extension":["error",{allow:"as-needed"}],"@eslint-react/naming-convention/use-state":"error","react-prefer-function-component/react-prefer-function-component":"error","@stylistic/jsx/jsx-self-closing-comp":"error","@eslint-react/prefer-shorthand-boolean":"error","@stylistic/jsx/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"@stylistic/jsx/jsx-indent-props":["error",2],"@stylistic/jsx/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"@stylistic/jsx/jsx-wrap-multilines":["error",{declaration:"parens-new-line",assignment:"parens-new-line",return:"parens-new-line",arrow:"parens-new-line",condition:"ignore",logical:"ignore",prop:"ignore"}],"@stylistic/jsx/jsx-first-prop-new-line":["error","multiline-multiprop"],"@stylistic/jsx/jsx-equals-spacing":["error","never"],"@stylistic/jsx/jsx-indent":"off","@stylistic/jsx/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never",beforeClosing:"never"}],"@eslint-react/dom/no-children-in-void-dom-elements":"error","@stylistic/jsx/jsx-curly-brace-presence":["error",{props:"never",children:"never"}],"@stylistic/jsx/jsx-props-no-multi-spaces":"error","@eslint-react/prefer-shorthand-fragment":"error","@stylistic/jsx/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"@eslint-react/no-missing-key":"error","@eslint-react/no-array-index-key":"error","@eslint-react/no-duplicate-key":"error","@eslint-react/no-implicit-key":"error","@eslint-react/no-useless-fragment":"error","@eslint-react/no-unstable-context-value":"error","@eslint-react/no-nested-components":"error","@eslint-react/dom/no-missing-iframe-sandbox":"warn","@eslint-react/dom/no-unsafe-iframe-sandbox":"warn","@eslint-react/no-leaked-conditional-rendering":"error","@eslint-react/no-unstable-default-props":"error","@eslint-react/dom/no-missing-button-type":"error","@eslint-react/dom/no-namespace":"error","class-methods-use-this":["error",{exceptMethods:["render","getInitialState","getDefaultProps","getChildContext","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","componentDidUpdate","componentWillUnmount","componentDidCatch","getSnapshotBeforeUpdate"]}],"jsx-a11y-minimal/alt-text":["warn",{elements:["img"],img:["Image"]}],"jsx-a11y-minimal/aria-props":"warn","jsx-a11y-minimal/aria-proptypes":"warn","jsx-a11y-minimal/aria-role":"warn","jsx-a11y-minimal/aria-unsupported-elements":"warn","jsx-a11y-minimal/iframe-has-title":"warn","jsx-a11y-minimal/no-access-key":"warn","jsx-a11y-minimal/role-has-required-aria-props":"warn","jsx-a11y-minimal/role-supports-aria-props":"warn","jsx-a11y-minimal/tabindex-no-positive":"warn","react-refresh/only-export-components":["warn",{allowConstantExport:g,allowExportNames:[...p?["config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...m?["meta","links","headers","loader","action"]:[]]}],"prefer-arrow-callback":["error",{allowNamedFunctions:!0,allowUnboundThis:!0}]}}]},S=({opt:n={}}={})=>[{plugins:{"@stylex":u},files:[e.GLOB_TS,e.GLOB_TSX,e.GLOB_JSX],rules:{"@stylexjs/valid-styles":["error",n],"@stylexjs/valid-shorthands":["error",n]}}];export{d as next,b as react,S as stylex};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-sukka/react",
|
|
3
|
-
"version": "6.1.11
|
|
3
|
+
"version": "6.1.11",
|
|
4
4
|
"description": "Sukka's ESLint config",
|
|
5
5
|
"homepage": "https://github.com/SukkaW/eslint-config-sukka",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"author": "Sukka <https://skk.moe>",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
31
|
+
"@eslint-react/eslint-plugin": "^1.12.1",
|
|
32
32
|
"@eslint/compat": "^1.1.1",
|
|
33
33
|
"@next/eslint-plugin-next": "15.0.0-canary.47",
|
|
34
34
|
"@stylexjs/eslint-plugin": "^0.7.5",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"@stylistic/eslint-plugin-jsx": "^2.6.4",
|
|
37
37
|
"eslint-plugin-react-compiler": "0.0.0-experimental-9ed098e-20240725",
|
|
38
38
|
"eslint-plugin-react-hooks": "5.1.0-beta-4508873393-20240430",
|
|
39
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
39
|
+
"eslint-plugin-react-refresh": "^0.4.11",
|
|
40
40
|
"eslint-plugin-ssr-friendly": "^1.3.0",
|
|
41
41
|
"globals": "^15.9.0",
|
|
42
|
-
"@eslint-sukka/
|
|
43
|
-
"@eslint-sukka/
|
|
42
|
+
"@eslint-sukka/shared": "6.1.11",
|
|
43
|
+
"@eslint-sukka/eslint-plugin-react-jsx-a11y": "6.1.11"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"eslint-plugin-react-prefer-function-component": "^3.3.0",
|
|
47
|
-
"@eslint-sukka/rollup-config": "6.1.11
|
|
47
|
+
"@eslint-sukka/rollup-config": "6.1.11"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "rollup -c rollup.config.ts --configPlugin swc3"
|