@eslint-sukka/react 4.1.10 → 4.1.11-beta.0

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 CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("@eslint-sukka/shared"),r=require("eslint-plugin-import"),t=require("@eslint-sukka/eslint-plugin-react-jsx-a11y"),n=require("eslint-plugin-react-hooks"),s=require("@eslint-react/eslint-plugin"),o=require("@stylistic/eslint-plugin-jsx"),i=require("globals");const a=[".js",".jsx",".mjs",".cjs"];exports.react=(l={})=>[{files:[e.constants.GLOB_TS,e.constants.GLOB_TSX,e.constants.GLOB_JS,e.constants.GLOB_JSX],plugins:{i:e.memo(r,"eslint-plugin-i"),import:e.memo(r,"eslint-plugin-i"),react:e.memo(t.eslint_plugin_react,"@eslint-sukka/eslint-plugin-react-jsx-a11y#eslint_plugin_react"),"jsx-a11y":e.memo(t.eslint_plugin_jsx_a11y,"@eslint-sukka/eslint-plugin-react-jsx-a11y#eslint_plugin_jsx_a11y"),"react-hooks":e.memo(n,"eslint-plugin-react-hooks"),"@stylistic/jsx":e.memo(o,"@stylistic/eslint-plugin-jsx"),"@eslint-react":e.memo(s,"@eslint-react/eslint-plugin")},settings:{"import/extensions":a,"import/parsers":{espree:a},"import/resolver":{node:{extensions:a}},react:{version:"detect"}},languageOptions:{sourceType:"module",parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:void 0},globals:i.browser},rules:{...n.configs.recommended.rules,...t.eslint_plugin_react.configs.recommended.rules,...t.eslint_plugin_react.configs["jsx-runtime"].rules,"react-hooks/exhaustive-deps":["error",{additionalHooks:l.additionalHooks??"(useIsomorphicLayoutEffect|useSukkaManyOtherCustomEffectHookExample)"}],"react/jsx-no-bind":["error",{ignoreRefs:!0,allowArrowFunctions:!0,allowFunctions:!1,allowBind:!1,ignoreDOMComponents:!0}],"react/self-closing-comp":"error","react/no-unused-state":"error","react/no-access-state-in-setstate":"error","react/no-unused-class-component-methods":"error","react/hook-use-state":"off","react/react-in-jsx-scope":"off","react/prop-types":"off","react/display-name":["off",{ignoreTranspilerName:!1}],"react/no-unknown-property":"off","react/jsx-uses-vars":"off","react/jsx-filename-extension":"off","@eslint-react/naming-convention/filename-extension":["error","as-needed"],"react/jsx-boolean-value":"off","@eslint-react/jsx/prefer-shorthand-boolean":"error","@stylistic/jsx/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"@stylistic/jsx/jsx-indent-props":["error",2],"@stylistic/jsx/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/require-render-return":"error","react/sort-comp":["error",{order:["static-variables","static-methods","instance-variables","lifecycle","/^handle.+$/","/^on.+$/","getters","setters","/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/","instance-methods","everything-else","rendering"],groups:{lifecycle:["displayName","propTypes","contextTypes","childContextTypes","mixins","statics","defaultProps","constructor","getDefaultProps","getInitialState","state","getChildContext","getDerivedStateFromProps","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","getSnapshotBeforeUpdate","componentDidUpdate","componentDidCatch","componentWillUnmount"],rendering:["/^render.+$/","render"]}}],"@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":["error",2],"react/style-prop-object":"error","@stylistic/jsx/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never",beforeClosing:"never"}],"react/void-dom-elements-no-children":"off","@eslint-react/react/no-children-in-vold-dom-elements":"error","@stylistic/jsx/jsx-curly-brace-presence":["error",{props:"never",children:"never"}],"react/no-this-in-sfc":"off","@stylistic/jsx/jsx-props-no-multi-spaces":"error","react/jsx-fragments":"off","@eslint-react/jsx/prefer-shorthand-fragment":"error","@stylistic/jsx/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"react/jsx-no-script-url":["error",[{name:"Link",props:["to","href"]},{name:"NextLink",props:["href"]}]],"react/jsx-key":"off","@eslint-react/jsx/no-missing-key":"error","react/no-array-index-key":"off","@eslint-react/jsx/no-array-index-key":"error","@eslint-react/jsx/no-duplicate-key":"error","@eslint-react/jsx/no-spreading-key":"error","react/jsx-no-useless-fragment":"off","@eslint-react/jsx/no-useless-fragment":"error","react/jsx-no-constructed-context-values":"off","@eslint-react/react/no-constructed-context-value":"error","react/no-unstable-nested-components":"off","@eslint-react/react/no-unstable-nested-components":"error","react/iframe-missing-sandbox":"off","@eslint-react/react/no-missing-iframe-sandbox":"warn","@eslint-react/react/no-unsafe-iframe-sandbox":"warn","react/jsx-no-leaked-render":"off","@eslint-react/jsx/no-leaked-conditional-rendering":"error","react/no-object-type-as-default-prop":"off","@eslint-react/react/no-unstable-default-props":"warn","react/button-has-type":"off","@eslint-react/react/no-missing-button-type":"error","react/no-namespace":"off","@eslint-react/react/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/alt-text":["warn",{elements:["img"],img:["Image"]}],"jsx-a11y/aria-props":"warn","jsx-a11y/aria-proptypes":"warn","jsx-a11y/aria-unsupported-elements":"warn","jsx-a11y/role-has-required-aria-props":"warn","jsx-a11y/role-supports-aria-props":"warn"}}];
1
+ "use strict";var e,n=require("@eslint-sukka/shared"),t=require("eslint-plugin-import"),r=require("@eslint-sukka/eslint-plugin-react-jsx-a11y"),s=require("eslint-plugin-react-hooks"),o=require("@eslint-react/eslint-plugin"),a=require("@stylistic/eslint-plugin-jsx"),i=require("globals"),l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},c={exports:{}},p={};!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 t,r,s,o;let a=null===(r=null===(t=n.options[0])||void 0===t?void 0:t.allowComponentDidCatch)||void 0===r||r,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(t=>{t.id?t=t.id:"VariableDeclarator"==t.parent.type&&(t=t.parent.id),n.report({node:t,messageId:e.COMPONENT_SHOULD_BE_FUNCTION})})}}}};e.default=n}(p);var m=c.exports,u=l&&l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(m,"__esModule",{value:!0});const d={configs:{recommended:{plugins:["react-prefer-function-component"],rules:{"react-prefer-function-component/react-prefer-function-component":"error"}}},rules:{"react-prefer-function-component":u(p).default}};c.exports=d;var x=(e=c.exports)&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;const f=[".js",".jsx",".mjs",".cjs"];exports.react=(e={})=>[{files:[n.constants.GLOB_TS,n.constants.GLOB_TSX,n.constants.GLOB_JS,n.constants.GLOB_JSX],plugins:{i:n.memo(t,"eslint-plugin-i"),import:n.memo(t,"eslint-plugin-i"),"react-minimal":n.memo(r.eslint_plugin_react_minimal,"@eslint-sukka/eslint-plugin-react-jsx-a11y#eslint_plugin_react_minimal"),"jsx-a11y-minimal":n.memo(r.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(a,"@stylistic/eslint-plugin-jsx"),"@eslint-react":n.memo(o,"@eslint-react/eslint-plugin"),"react-prefer-function-component":n.memo(x,"eslint-plugin-react-prefer-function-component")},settings:{"import/extensions":f,"import/parsers":{espree:f},"import/resolver":{node:{extensions:f}},react:{version:"detect"}},languageOptions:{sourceType:"module",parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:void 0},globals:i.browser},rules:{...s.configs.recommended.rules,"react-hooks/exhaustive-deps":["error",{additionalHooks:e.additionalHooks??"(useIsomorphicLayoutEffect|useSukkaManyOtherCustomEffectHookExample)"}],"react-minimal/no-unused-state":"error","react-minimal/no-access-state-in-setstate":"error","react-minimal/no-unused-class-component-methods":"error","react-minimal/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react-minimal/sort-comp":["error",{order:["static-variables","static-methods","instance-variables","lifecycle","/^handle.+$/","/^on.+$/","getters","setters","/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/","instance-methods","everything-else","rendering"],groups:{lifecycle:["displayName","propTypes","contextTypes","childContextTypes","mixins","statics","defaultProps","constructor","getDefaultProps","getInitialState","state","getChildContext","getDerivedStateFromProps","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","getSnapshotBeforeUpdate","componentDidUpdate","componentDidCatch","componentWillUnmount"],rendering:["/^render.+$/","render"]}}],"react-minimal/jsx-no-script-url":["error",[{name:"Link",props:["to","href"]},{name:"NextLink",props:["href"]}]],"@eslint-react/react/no-string-refs":"error","@eslint-react/jsx/no-comment-textnodes":"error","@eslint-react/react/no-unsafe-target-blank":"error","@eslint-react/react/no-children-prop":"error","@eslint-react/react/no-dangerously-set-innerhtml-with-children":"error","@eslint-react/react/no-render-return-value":"error","@eslint-react/react/no-direct-mutation-state":"error","@eslint-react/react/no-find-dom-node":"error","@eslint-react/react/no-unsafe-component-will-mount":"warn","@eslint-react/react/no-unsafe-component-will-receive-props":"warn","@eslint-react/react/no-unsafe-component-will-update":"warn","@eslint-react/naming-convention/filename-extension":["error","as-needed"],"react-prefer-function-component/react-prefer-function-component":"error","@eslint-react/naming-convention/use-state":"error","@stylistic/jsx/jsx-self-closing-comp":"error","@eslint-react/jsx/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":["error",2],"@stylistic/jsx/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never",beforeClosing:"never"}],"@eslint-react/react/no-children-in-vold-dom-elements":"error","@stylistic/jsx/jsx-curly-brace-presence":["error",{props:"never",children:"never"}],"@stylistic/jsx/jsx-props-no-multi-spaces":"error","@eslint-react/jsx/prefer-shorthand-fragment":"error","@stylistic/jsx/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"@eslint-react/jsx/no-missing-key":"error","@eslint-react/jsx/no-array-index-key":"error","@eslint-react/jsx/no-duplicate-key":"error","@eslint-react/jsx/no-spreading-key":"error","@eslint-react/jsx/no-useless-fragment":"error","@eslint-react/react/no-constructed-context-value":"error","@eslint-react/react/no-unstable-nested-components":"error","@eslint-react/react/no-missing-iframe-sandbox":"warn","@eslint-react/react/no-unsafe-iframe-sandbox":"warn","@eslint-react/jsx/no-leaked-conditional-rendering":"error","@eslint-react/react/no-unstable-default-props":"warn","@eslint-react/react/no-missing-button-type":"error","@eslint-react/react/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-unsupported-elements":"warn","jsx-a11y-minimal/role-has-required-aria-props":"warn","jsx-a11y-minimal/role-supports-aria-props":"warn"}}];
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{constants as e,memo as r}from"@eslint-sukka/shared";import t from"eslint-plugin-import";import{eslint_plugin_react as n,eslint_plugin_jsx_a11y as s}from"@eslint-sukka/eslint-plugin-react-jsx-a11y";import o from"eslint-plugin-react-hooks";import i from"@eslint-react/eslint-plugin";import a from"@stylistic/eslint-plugin-jsx";import l from"globals";let c=[".js",".jsx",".mjs",".cjs"],p=(p={})=>[{files:[e.GLOB_TS,e.GLOB_TSX,e.GLOB_JS,e.GLOB_JSX],plugins:{i:r(t,"eslint-plugin-i"),import:r(t,"eslint-plugin-i"),react:r(n,"@eslint-sukka/eslint-plugin-react-jsx-a11y#eslint_plugin_react"),"jsx-a11y":r(s,"@eslint-sukka/eslint-plugin-react-jsx-a11y#eslint_plugin_jsx_a11y"),"react-hooks":r(o,"eslint-plugin-react-hooks"),"@stylistic/jsx":r(a,"@stylistic/eslint-plugin-jsx"),"@eslint-react":r(i,"@eslint-react/eslint-plugin")},settings:{"import/extensions":c,"import/parsers":{espree:c},"import/resolver":{node:{extensions:c}},react:{version:"detect"}},languageOptions:{sourceType:"module",parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:void 0},globals:l.browser},rules:{...o.configs.recommended.rules,...n.configs.recommended.rules,...n.configs["jsx-runtime"].rules,"react-hooks/exhaustive-deps":["error",{additionalHooks:p.additionalHooks??"(useIsomorphicLayoutEffect|useSukkaManyOtherCustomEffectHookExample)"}],"react/jsx-no-bind":["error",{ignoreRefs:!0,allowArrowFunctions:!0,allowFunctions:!1,allowBind:!1,ignoreDOMComponents:!0}],"react/self-closing-comp":"error","react/no-unused-state":"error","react/no-access-state-in-setstate":"error","react/no-unused-class-component-methods":"error","react/hook-use-state":"off","react/react-in-jsx-scope":"off","react/prop-types":"off","react/display-name":["off",{ignoreTranspilerName:!1}],"react/no-unknown-property":"off","react/jsx-uses-vars":"off","react/jsx-filename-extension":"off","@eslint-react/naming-convention/filename-extension":["error","as-needed"],"react/jsx-boolean-value":"off","@eslint-react/jsx/prefer-shorthand-boolean":"error","@stylistic/jsx/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"@stylistic/jsx/jsx-indent-props":["error",2],"@stylistic/jsx/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/require-render-return":"error","react/sort-comp":["error",{order:["static-variables","static-methods","instance-variables","lifecycle","/^handle.+$/","/^on.+$/","getters","setters","/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/","instance-methods","everything-else","rendering"],groups:{lifecycle:["displayName","propTypes","contextTypes","childContextTypes","mixins","statics","defaultProps","constructor","getDefaultProps","getInitialState","state","getChildContext","getDerivedStateFromProps","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","getSnapshotBeforeUpdate","componentDidUpdate","componentDidCatch","componentWillUnmount"],rendering:["/^render.+$/","render"]}}],"@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":["error",2],"react/style-prop-object":"error","@stylistic/jsx/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never",beforeClosing:"never"}],"react/void-dom-elements-no-children":"off","@eslint-react/react/no-children-in-vold-dom-elements":"error","@stylistic/jsx/jsx-curly-brace-presence":["error",{props:"never",children:"never"}],"react/no-this-in-sfc":"off","@stylistic/jsx/jsx-props-no-multi-spaces":"error","react/jsx-fragments":"off","@eslint-react/jsx/prefer-shorthand-fragment":"error","@stylistic/jsx/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"react/jsx-no-script-url":["error",[{name:"Link",props:["to","href"]},{name:"NextLink",props:["href"]}]],"react/jsx-key":"off","@eslint-react/jsx/no-missing-key":"error","react/no-array-index-key":"off","@eslint-react/jsx/no-array-index-key":"error","@eslint-react/jsx/no-duplicate-key":"error","@eslint-react/jsx/no-spreading-key":"error","react/jsx-no-useless-fragment":"off","@eslint-react/jsx/no-useless-fragment":"error","react/jsx-no-constructed-context-values":"off","@eslint-react/react/no-constructed-context-value":"error","react/no-unstable-nested-components":"off","@eslint-react/react/no-unstable-nested-components":"error","react/iframe-missing-sandbox":"off","@eslint-react/react/no-missing-iframe-sandbox":"warn","@eslint-react/react/no-unsafe-iframe-sandbox":"warn","react/jsx-no-leaked-render":"off","@eslint-react/jsx/no-leaked-conditional-rendering":"error","react/no-object-type-as-default-prop":"off","@eslint-react/react/no-unstable-default-props":"warn","react/button-has-type":"off","@eslint-react/react/no-missing-button-type":"error","react/no-namespace":"off","@eslint-react/react/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/alt-text":["warn",{elements:["img"],img:["Image"]}],"jsx-a11y/aria-props":"warn","jsx-a11y/aria-proptypes":"warn","jsx-a11y/aria-unsupported-elements":"warn","jsx-a11y/role-has-required-aria-props":"warn","jsx-a11y/role-supports-aria-props":"warn"}}];export{p as react};
1
+ import{constants as e,memo as n}from"@eslint-sukka/shared";import t from"eslint-plugin-import";import{eslint_plugin_react_minimal as r,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-react/eslint-plugin";import i from"@stylistic/eslint-plugin-jsx";import l from"globals";var c,p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},m={exports:{}},u={};!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 t,r,s,o;let a=null===(r=null===(t=n.options[0])||void 0===t?void 0:t.allowComponentDidCatch)||void 0===r||r,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(t=>{t.id?t=t.id:"VariableDeclarator"==t.parent.type&&(t=t.parent.id),n.report({node:t,messageId:e.COMPONENT_SHOULD_BE_FUNCTION})})}}}};e.default=n}(u);var d=m.exports,f=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(d,"__esModule",{value:!0});let x={configs:{recommended:{plugins:["react-prefer-function-component"],rules:{"react-prefer-function-component/react-prefer-function-component":"error"}}},rules:{"react-prefer-function-component":f(u).default}};m.exports=x;var g=(c=m.exports)&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c;let C=[".js",".jsx",".mjs",".cjs"],y=(c={})=>[{files:[e.GLOB_TS,e.GLOB_TSX,e.GLOB_JS,e.GLOB_JSX],plugins:{i:n(t,"eslint-plugin-i"),import:n(t,"eslint-plugin-i"),"react-minimal":n(r,"@eslint-sukka/eslint-plugin-react-jsx-a11y#eslint_plugin_react_minimal"),"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(i,"@stylistic/eslint-plugin-jsx"),"@eslint-react":n(a,"@eslint-react/eslint-plugin"),"react-prefer-function-component":n(g,"eslint-plugin-react-prefer-function-component")},settings:{"import/extensions":C,"import/parsers":{espree:C},"import/resolver":{node:{extensions:C}},react:{version:"detect"}},languageOptions:{sourceType:"module",parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:void 0},globals:l.browser},rules:{...o.configs.recommended.rules,"react-hooks/exhaustive-deps":["error",{additionalHooks:c.additionalHooks??"(useIsomorphicLayoutEffect|useSukkaManyOtherCustomEffectHookExample)"}],"react-minimal/no-unused-state":"error","react-minimal/no-access-state-in-setstate":"error","react-minimal/no-unused-class-component-methods":"error","react-minimal/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react-minimal/sort-comp":["error",{order:["static-variables","static-methods","instance-variables","lifecycle","/^handle.+$/","/^on.+$/","getters","setters","/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/","instance-methods","everything-else","rendering"],groups:{lifecycle:["displayName","propTypes","contextTypes","childContextTypes","mixins","statics","defaultProps","constructor","getDefaultProps","getInitialState","state","getChildContext","getDerivedStateFromProps","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","getSnapshotBeforeUpdate","componentDidUpdate","componentDidCatch","componentWillUnmount"],rendering:["/^render.+$/","render"]}}],"react-minimal/jsx-no-script-url":["error",[{name:"Link",props:["to","href"]},{name:"NextLink",props:["href"]}]],"@eslint-react/react/no-string-refs":"error","@eslint-react/jsx/no-comment-textnodes":"error","@eslint-react/react/no-unsafe-target-blank":"error","@eslint-react/react/no-children-prop":"error","@eslint-react/react/no-dangerously-set-innerhtml-with-children":"error","@eslint-react/react/no-render-return-value":"error","@eslint-react/react/no-direct-mutation-state":"error","@eslint-react/react/no-find-dom-node":"error","@eslint-react/react/no-unsafe-component-will-mount":"warn","@eslint-react/react/no-unsafe-component-will-receive-props":"warn","@eslint-react/react/no-unsafe-component-will-update":"warn","@eslint-react/naming-convention/filename-extension":["error","as-needed"],"react-prefer-function-component/react-prefer-function-component":"error","@eslint-react/naming-convention/use-state":"error","@stylistic/jsx/jsx-self-closing-comp":"error","@eslint-react/jsx/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":["error",2],"@stylistic/jsx/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never",beforeClosing:"never"}],"@eslint-react/react/no-children-in-vold-dom-elements":"error","@stylistic/jsx/jsx-curly-brace-presence":["error",{props:"never",children:"never"}],"@stylistic/jsx/jsx-props-no-multi-spaces":"error","@eslint-react/jsx/prefer-shorthand-fragment":"error","@stylistic/jsx/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"@eslint-react/jsx/no-missing-key":"error","@eslint-react/jsx/no-array-index-key":"error","@eslint-react/jsx/no-duplicate-key":"error","@eslint-react/jsx/no-spreading-key":"error","@eslint-react/jsx/no-useless-fragment":"error","@eslint-react/react/no-constructed-context-value":"error","@eslint-react/react/no-unstable-nested-components":"error","@eslint-react/react/no-missing-iframe-sandbox":"warn","@eslint-react/react/no-unsafe-iframe-sandbox":"warn","@eslint-react/jsx/no-leaked-conditional-rendering":"error","@eslint-react/react/no-unstable-default-props":"warn","@eslint-react/react/no-missing-button-type":"error","@eslint-react/react/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-unsupported-elements":"warn","jsx-a11y-minimal/role-has-required-aria-props":"warn","jsx-a11y-minimal/role-supports-aria-props":"warn"}}];export{y as react};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-sukka/react",
3
- "version": "4.1.10",
3
+ "version": "4.1.11-beta.0",
4
4
  "description": "Sukka's ESLint config",
5
5
  "homepage": "https://github.com/SukkaW/eslint-config-sukka",
6
6
  "repository": {
@@ -28,16 +28,17 @@
28
28
  "author": "Sukka <https://skk.moe>",
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
- "@eslint-react/eslint-plugin": "^0.9.2",
31
+ "@eslint-react/eslint-plugin": "^0.9.5",
32
32
  "@stylistic/eslint-plugin-jsx": "^1.5.0",
33
33
  "eslint-plugin-import": "npm:eslint-plugin-i@2.29.0",
34
34
  "eslint-plugin-react-hooks": "^4.6.0",
35
- "globals": "^13.23.0",
36
- "@eslint-sukka/eslint-plugin-react-jsx-a11y": "^4.1.10",
37
- "@eslint-sukka/shared": "4.1.10"
35
+ "globals": "^13.24.0",
36
+ "@eslint-sukka/eslint-plugin-react-jsx-a11y": "^4.1.11-beta.0",
37
+ "@eslint-sukka/shared": "4.1.11-beta.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@eslint-sukka/rollup-config": "^4.1.10"
40
+ "eslint-plugin-react-prefer-function-component": "^3.3.0",
41
+ "@eslint-sukka/rollup-config": "^4.1.11-beta.0"
41
42
  },
42
43
  "scripts": {
43
44
  "build": "rollup -c rollup.config.ts --configPlugin swc3"