@anolilab/eslint-config 6.1.7 → 6.1.8

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## @anolilab/eslint-config [6.1.8](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@6.1.7...@anolilab/eslint-config@6.1.8) (2023-06-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fixed wrong import, added better plugin login for testing-library ([857d734](https://github.com/anolilab/javascript-style-guide/commit/857d734cead4f1551bc466888d854a9ab6ab0a4a))
7
+
1
8
  ## @anolilab/eslint-config [6.1.7](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@6.1.6...@anolilab/eslint-config@6.1.7) (2023-06-22)
2
9
 
3
10
 
@@ -3,7 +3,6 @@
3
3
  var chunkYMWD4DNM_js = require('../../chunk-YMWD4DNM.js');
4
4
  var chunkZRBLJAQI_js = require('../../chunk-ZRBLJAQI.js');
5
5
  var packageJsonUtils = require('@anolilab/package-json-utils');
6
- var src = require('@anolilab/package-json-utils/src');
7
6
  var d = require('find-up');
8
7
  var process = require('process');
9
8
 
@@ -16,10 +15,10 @@ var s=chunkZRBLJAQI_js.a.rules,n=s["no-underscore-dangle"],f={};packageJsonUtils
16
15
 
17
16
  Following rules are disabled: "react/jsx-uses-react" and "react/react-in-jsx-scope".
18
17
  If you dont use the new react jsx-runtime in you project, please enable it manually.
19
- `),global.hasAnolilabEsLintConfigReactRuntimePath=a;}return global.hasAnolilabEsLintConfigReactRuntimePath})(),e=src.getPackageSubProperty("dependencies")("react");e===void 0&&(e=src.getPackageSubProperty("devDependencies")("react"));e!==void 0&&r?.info_on_found_react_version!==!1&&chunkYMWD4DNM_js.b(`
18
+ `),global.hasAnolilabEsLintConfigReactRuntimePath=a;}return global.hasAnolilabEsLintConfigReactRuntimePath})(),e=packageJsonUtils.getPackageSubProperty("dependencies")("react");e===void 0&&(e=packageJsonUtils.getPackageSubProperty("devDependencies")("react"));e!==void 0&&r?.info_on_found_react_version!==!1&&chunkYMWD4DNM_js.b(`
20
19
  @anolilab/eslint-config found the version ${e} of react in your dependencies, this version ${e} will be used to setup the "eslint-plugin-react"
21
- `);var g={overrides:[{files:["*.jsx","*.tsx"],plugins:["react"],env:{browser:!0},parserOptions:{ecmaFeatures:{jsx:!0}},settings:{"import/resolver":{node:{extensions:[".js",".jsx",".json",".cjs",".mjs"]}},react:{version:e??"detect"},propWrapperFunctions:["forbidExtraProps","exact","Object.freeze"]},rules:{"no-underscore-dangle":[n[0],{...n[1],allow:[...n[1].allow,"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"]}],"jsx-quotes":["error","prefer-double"],"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"]}],"react/display-name":["off",{ignoreTranspilerName:!1}],"react/forbid-prop-types":["error",{forbid:["any","array","object"],checkContextTypes:!0,checkChildContextTypes:!0}],"react/forbid-dom-props":["off",{forbid:[]}],"react/jsx-boolean-value":["error","never",{always:[]}],"react/jsx-closing-bracket-location":["error","line-aligned"],"react/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-indent-props":["error",s.indent[1]],"react/jsx-key":"off","react/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"react/jsx-no-bind":["error",{ignoreRefs:!0,allowArrowFunctions:!0,allowFunctions:!1,allowBind:!1,ignoreDOMComponents:!0}],"react/jsx-no-duplicate-props":["error",{ignoreCase:!0}],"react/jsx-no-literals":["off",{noStrings:!0}],"react/jsx-no-undef":"error","react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/sort-prop-types":["off",{ignoreCase:!0,callbacksLast:!1,requiredFirst:!1,sortShapeProp:!0}],"react/jsx-sort-props":["off",{ignoreCase:!0,callbacksLast:!1,shorthandFirst:!1,shorthandLast:!1,noSortAlphabetically:!1,reservedFirst:!0}],"react/jsx-uses-react":[l?"off":"error"],"react/jsx-uses-vars":"error","react/no-danger":"warn","react/no-deprecated":["error"],"react/no-did-mount-set-state":"off","react/no-did-update-set-state":"error","react/no-will-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-is-mounted":"error","react/no-multi-comp":"off","react/no-set-state":"off","react/no-string-refs":"error","react/no-unknown-property":"error","react/prefer-es6-class":["error","always"],"react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/prop-types":["error",{ignore:[],customValidators:[],skipUndeclared:!1}],"react/react-in-jsx-scope":l?"off":"error","react/require-render-return":"error","react/self-closing-comp":"error","react/sort-default-props":["error",{ignoreCase:!0}],"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"]}}],"react/jsx-first-prop-new-line":["error","multiline-multiprop"],"react/jsx-equals-spacing":["error","never"],"react/jsx-indent":["error",s.indent[1],{checkAttributes:!0,indentLogicalExpressions:!0}],"react/jsx-no-target-blank":["error",{enforceDynamicLinks:"always"}],"react/jsx-no-comment-textnodes":"error","react/no-render-return-value":"error","react/require-optimization":["off",{allowDecorators:[]}],"react/no-find-dom-node":"error","react/forbid-component-props":["off",{forbid:[]}],"react/forbid-elements":["off",{forbid:[]}],"react/no-danger-with-children":"error","react/no-unused-prop-types":["error",{customValidators:[],skipShapeProps:!0}],"react/style-prop-object":"error","react/no-unescaped-entities":"error","react/no-children-prop":"error","react/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never",beforeClosing:"never"}],"react/jsx-space-before-closing":["off","always"],"react/no-array-index-key":"error","react/require-default-props":["error",{forbidDefaultForRequired:!0}],"react/forbid-foreign-prop-types":["warn",{allowInPropTypes:!0}],"react/void-dom-elements-no-children":"error","react/default-props-match-prop-types":["error",{allowRequiredDefaults:!1}],"react/no-redundant-should-component-update":"error","react/no-unused-state":"error","react/boolean-prop-naming":["off",{propTypeNames:["bool","mutuallyExclusiveTrueProps"],rule:"^(is|has)[A-Z]([A-Za-z0-9]?)+",message:""}],"react/jsx-curly-brace-presence":["error",{props:"never",children:"never"}],"react/jsx-one-expression-per-line":["error",{allow:"single-child"}],"react/destructuring-assignment":["error","always"],"react/no-access-state-in-setstate":"error","react/button-has-type":["error",{button:!0,submit:!0,reset:!1}],"react/jsx-child-element-spacing":"off","react/no-this-in-sfc":"error","react/jsx-max-depth":"off","react/jsx-props-no-multi-spaces":"error","react/no-unsafe":"off","react/jsx-fragments":["error","syntax"],"react/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"react/state-in-constructor":["error","always"],"react/static-property-placement":["error","property assignment"],"react/jsx-props-no-spreading":["error",{html:"enforce",custom:"enforce",explicitSpread:"ignore",exceptions:[]}],"react/prefer-read-only-props":"off","react/jsx-no-script-url":["error",[{name:"Link",props:["to"]}]],"react/jsx-no-useless-fragment":"error","react/no-adjacent-inline-elements":"error","react/function-component-definition":["error",{namedComponents:"arrow-function",unnamedComponents:"arrow-function"}],"react/jsx-newline":"off","react/jsx-no-constructed-context-values":"error",...f}},{files:["*.jsx"],rules:{"react/jsx-filename-extension":"error","react/no-typos":"error","react/jsx-closing-tag-location":"error","react/jsx-wrap-multilines":["error",{declaration:"parens-new-line",assignment:"parens-new-line",return:"parens-new-line",arrow:"parens-new-line",condition:"parens-new-line",logical:"parens-new-line",prop:"parens-new-line"}]}},{files:["*.tsx"],rules:{"react/jsx-filename-extension":"off","react/default-props-match-prop-types":"off","react/prop-types":"off"}}]},_=g;
20
+ `);var g={overrides:[{files:["*.jsx","*.tsx"],plugins:["react"],env:{browser:!0},parserOptions:{ecmaFeatures:{jsx:!0}},settings:{"import/resolver":{node:{extensions:[".js",".jsx",".json",".cjs",".mjs"]}},react:{version:e??"detect"},propWrapperFunctions:["forbidExtraProps","exact","Object.freeze"]},rules:{"no-underscore-dangle":[n[0],{...n[1],allow:[...n[1].allow,"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"]}],"jsx-quotes":["error","prefer-double"],"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"]}],"react/display-name":["off",{ignoreTranspilerName:!1}],"react/forbid-prop-types":["error",{forbid:["any","array","object"],checkContextTypes:!0,checkChildContextTypes:!0}],"react/forbid-dom-props":["off",{forbid:[]}],"react/jsx-boolean-value":["error","never",{always:[]}],"react/jsx-closing-bracket-location":["error","line-aligned"],"react/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-indent-props":["error",s.indent[1]],"react/jsx-key":"off","react/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"react/jsx-no-bind":["error",{ignoreRefs:!0,allowArrowFunctions:!0,allowFunctions:!1,allowBind:!1,ignoreDOMComponents:!0}],"react/jsx-no-duplicate-props":["error",{ignoreCase:!0}],"react/jsx-no-literals":["off",{noStrings:!0}],"react/jsx-no-undef":"error","react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/sort-prop-types":["off",{ignoreCase:!0,callbacksLast:!1,requiredFirst:!1,sortShapeProp:!0}],"react/jsx-sort-props":["off",{ignoreCase:!0,callbacksLast:!1,shorthandFirst:!1,shorthandLast:!1,noSortAlphabetically:!1,reservedFirst:!0}],"react/jsx-uses-react":[l?"off":"error"],"react/jsx-uses-vars":"error","react/no-danger":"warn","react/no-deprecated":["error"],"react/no-did-mount-set-state":"off","react/no-did-update-set-state":"error","react/no-will-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-is-mounted":"error","react/no-multi-comp":"off","react/no-set-state":"off","react/no-string-refs":"error","react/no-unknown-property":"error","react/prefer-es6-class":["error","always"],"react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/prop-types":["error",{ignore:[],customValidators:[],skipUndeclared:!1}],"react/react-in-jsx-scope":l?"off":"error","react/require-render-return":"error","react/self-closing-comp":"error","react/sort-default-props":["error",{ignoreCase:!0}],"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"]}}],"react/jsx-first-prop-new-line":["error","multiline-multiprop"],"react/jsx-equals-spacing":["error","never"],"react/jsx-indent":["error",s.indent[1],{checkAttributes:!0,indentLogicalExpressions:!0}],"react/jsx-no-target-blank":["error",{enforceDynamicLinks:"always"}],"react/jsx-no-comment-textnodes":"error","react/no-render-return-value":"error","react/require-optimization":["off",{allowDecorators:[]}],"react/no-find-dom-node":"error","react/forbid-component-props":["off",{forbid:[]}],"react/forbid-elements":["off",{forbid:[]}],"react/no-danger-with-children":"error","react/no-unused-prop-types":["error",{customValidators:[],skipShapeProps:!0}],"react/style-prop-object":"error","react/no-unescaped-entities":"error","react/no-children-prop":"error","react/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never",beforeClosing:"never"}],"react/jsx-space-before-closing":["off","always"],"react/no-array-index-key":"error","react/require-default-props":["error",{forbidDefaultForRequired:!0}],"react/forbid-foreign-prop-types":["warn",{allowInPropTypes:!0}],"react/void-dom-elements-no-children":"error","react/default-props-match-prop-types":["error",{allowRequiredDefaults:!1}],"react/no-redundant-should-component-update":"error","react/no-unused-state":"error","react/boolean-prop-naming":["off",{propTypeNames:["bool","mutuallyExclusiveTrueProps"],rule:"^(is|has)[A-Z]([A-Za-z0-9]?)+",message:""}],"react/jsx-curly-brace-presence":["error",{props:"never",children:"never"}],"react/jsx-one-expression-per-line":["error",{allow:"single-child"}],"react/destructuring-assignment":["error","always"],"react/no-access-state-in-setstate":"error","react/button-has-type":["error",{button:!0,submit:!0,reset:!1}],"react/jsx-child-element-spacing":"off","react/no-this-in-sfc":"error","react/jsx-max-depth":"off","react/jsx-props-no-multi-spaces":"error","react/no-unsafe":"off","react/jsx-fragments":["error","syntax"],"react/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"react/state-in-constructor":["error","always"],"react/static-property-placement":["error","property assignment"],"react/jsx-props-no-spreading":["error",{html:"enforce",custom:"enforce",explicitSpread:"ignore",exceptions:[]}],"react/prefer-read-only-props":"off","react/jsx-no-script-url":["error",[{name:"Link",props:["to"]}]],"react/jsx-no-useless-fragment":"error","react/no-adjacent-inline-elements":"error","react/function-component-definition":["error",{namedComponents:"arrow-function",unnamedComponents:"arrow-function"}],"react/jsx-newline":"off","react/jsx-no-constructed-context-values":"error",...f}},{files:["*.jsx"],rules:{"react/jsx-filename-extension":"error","react/no-typos":"error","react/jsx-closing-tag-location":"error","react/jsx-wrap-multilines":["error",{declaration:"parens-new-line",assignment:"parens-new-line",return:"parens-new-line",arrow:"parens-new-line",condition:"parens-new-line",logical:"parens-new-line",prop:"parens-new-line"}]}},{files:["*.tsx"],rules:{"react/jsx-filename-extension":"off","react/default-props-match-prop-types":"off","react/prop-types":"off"}}]},v=g;
22
21
 
23
- module.exports = _;
22
+ module.exports = v;
24
23
  //# sourceMappingURL=out.js.map
25
24
  //# sourceMappingURL=react.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/config/plugins/react.ts"],"names":["hasAnyDep","pkg","getPackageSubProperty","findUp","env","styleRules","style_default","dangleRules","prettierReactRules","anolilabEslintConfig","hasJsxRuntime","isFile","showLog","consoleLog","reactVersion","config","react_default"],"mappings":"wFACA,OAAS,aAAAA,EAAW,OAAAC,MAAW,+BAC/B,OAAS,yBAAAC,MAA6B,mCAEtC,OAAOC,MAAY,UACnB,OAAS,OAAAC,MAAW,UAKpB,IAAMC,EAAaC,EAAY,MACzBC,EAAcF,EAAW,sBAAsB,EAEjDG,EAAqB,CAAC,EAGtBR,EAAU,CAAC,UAAU,EAAG,CACpB,SAAU,EACd,CAAC,IAEDQ,EAAqB,CACjB,kCAAmC,MACnC,qCAAsC,MACtC,iCAAkC,MAClC,0BAA2B,MAC3B,0BAA2B,MAC3B,2BAA4B,MAC5B,gCAAiC,MACjC,mBAAoB,MACpB,yBAA0B,MAC1B,+BAAgC,MAChC,oBAAqB,MACrB,oCAAqC,MACrC,kCAAmC,MACnC,wBAAyB,MACzB,4BAA6B,KACjC,GAGJ,IAAIC,EAA+D,CAAC,EAEhER,IAEAQ,EAAuBR,GAAM,WAAc,eAAe,GAG9D,IAAMS,GAAiB,IAAM,CAEzB,GAAI,CAAC,OAAO,wCAAyC,CAEjD,IAAMC,EAAS,OAD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C,4BAA6B,CACzB,QACA,CAEI,YAAa,kBACb,WAAY,kBACZ,OAAQ,kBACR,MAAO,kBACP,UAAW,kBACX,QAAS,kBACT,KAAM,iBACV,CACJ,CACJ,CACJ,EACA,CACI,MAAO,CAAC,OAAO,EACf,MAAO,CAEH,+BAAgC,MAChC,uCAAwC,MACxC,mBAAoB,KACxB,CACJ,CACJ,CACJ,EAEOQ,EAAQD","sourcesContent":["// @see https://github.com/yannickcr/eslint-plugin-react\nimport { hasAnyDep, pkg } from \"@anolilab/package-json-utils\";\nimport { getPackageSubProperty } from \"@anolilab/package-json-utils/src\";\nimport type { Linter } from \"eslint\";\nimport findUp from \"find-up\";\nimport { env } from \"node:process\";\n\nimport { consoleLog } from \"../../utils/loggers\";\nimport styleConfig from \"../style\";\n\nconst styleRules = styleConfig.rules as Linter.RulesRecord;\nconst dangleRules = styleRules[\"no-underscore-dangle\"] as any[];\n\nlet prettierReactRules = {};\n\nif (\n hasAnyDep([\"prettier\"], {\n peerDeps: false,\n })\n) {\n prettierReactRules = {\n \"react/jsx-child-element-spacing\": \"off\",\n \"react/jsx-closing-bracket-location\": \"off\",\n \"react/jsx-closing-tag-location\": \"off\",\n \"react/jsx-curly-newline\": \"off\",\n \"react/jsx-curly-spacing\": \"off\",\n \"react/jsx-equals-spacing\": \"off\",\n \"react/jsx-first-prop-new-line\": \"off\",\n \"react/jsx-indent\": \"off\",\n \"react/jsx-indent-props\": \"off\",\n \"react/jsx-max-props-per-line\": \"off\",\n \"react/jsx-newline\": \"off\",\n \"react/jsx-one-expression-per-line\": \"off\",\n \"react/jsx-props-no-multi-spaces\": \"off\",\n \"react/jsx-tag-spacing\": \"off\",\n \"react/jsx-wrap-multilines\": \"off\",\n };\n}\n\nlet anolilabEslintConfig: { [key: string]: boolean | undefined } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\nconst hasJsxRuntime = (() => {\n // Workaround VS Code trying to run this file twice!\n if (!global.hasAnolilabEsLintConfigReactRuntimePath) {\n const reactPath = findUp.sync(\"node_modules/react/jsx-runtime.js\");\n const isFile = typeof reactPath === \"string\";\n\n let showLog: boolean = env[\"DISABLE_INFO_ON_DISABLING_JSX_REACT_RULE\"] !== \"true\";\n\n if (showLog && anolilabEslintConfig?.[\"info_on_disabling_jsx_react_rule\"] !== undefined) {\n showLog = anolilabEslintConfig[\"info_on_disabling_jsx_react_rule\"];\n }\n\n if (showLog && isFile) {\n consoleLog(`\\n@anolilab/eslint-config found react jsx-runtime. \\n\n Following rules are disabled: \"react/jsx-uses-react\" and \"react/react-in-jsx-scope\".\n If you dont use the new react jsx-runtime in you project, please enable it manually.\\n`);\n }\n\n global.hasAnolilabEsLintConfigReactRuntimePath = isFile;\n }\n\n return global.hasAnolilabEsLintConfigReactRuntimePath;\n})();\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call\nlet reactVersion: string | undefined = getPackageSubProperty<string>(\"dependencies\")(\"react\")\n\nif (reactVersion === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call\n reactVersion = getPackageSubProperty<string | undefined>(\"devDependencies\")(\"react\");\n}\n\nif (reactVersion !== undefined && anolilabEslintConfig?.[\"info_on_found_react_version\"] !== false) {\n consoleLog(`\\n@anolilab/eslint-config found the version ${reactVersion} of react in your dependencies, this version ${reactVersion} will be used to setup the \"eslint-plugin-react\"\\n`);\n}\n\nconst config: Linter.Config = {\n overrides: [\n {\n files: [\"*.jsx\", \"*.tsx\"],\n\n plugins: [\"react\"],\n\n env: {\n browser: true,\n },\n\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n\n settings: {\n \"import/resolver\": {\n node: {\n extensions: [\".js\", \".jsx\", \".json\", \".cjs\", \".mjs\"],\n },\n },\n react: {\n // The default value is \"detect\". Automatic detection works by loading the entire React library\n // into the linter's process, which is inefficient. It is recommended to specify the version\n // explicity.\n version: reactVersion ?? \"detect\",\n },\n propWrapperFunctions: [\n \"forbidExtraProps\", // https://www.npmjs.com/package/airbnb-prop-types\n \"exact\", // https://www.npmjs.com/package/prop-types-exact\n \"Object.freeze\", // https://tc39.github.io/ecma262/#sec-object.freeze\n ],\n },\n\n // View link below for react rules documentation\n // https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules\n rules: {\n \"no-underscore-dangle\": [\n dangleRules[0],\n {\n ...dangleRules[1],\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n allow: [...dangleRules[1].allow, \"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\"],\n },\n ],\n\n // Specify whether double or single quotes should be used in JSX attributes\n // https://eslint.org/docs/rules/jsx-quotes\n \"jsx-quotes\": [\"error\", \"prefer-double\"],\n\n \"class-methods-use-this\": [\n \"error\",\n {\n exceptMethods: [\n \"render\",\n \"getInitialState\",\n \"getDefaultProps\",\n \"getChildContext\",\n \"componentWillMount\",\n \"UNSAFE_componentWillMount\",\n \"componentDidMount\",\n \"componentWillReceiveProps\",\n \"UNSAFE_componentWillReceiveProps\",\n \"shouldComponentUpdate\",\n \"componentWillUpdate\",\n \"UNSAFE_componentWillUpdate\",\n \"componentDidUpdate\",\n \"componentWillUnmount\",\n \"componentDidCatch\",\n \"getSnapshotBeforeUpdate\",\n ],\n },\n ],\n\n // Prevent missing displayName in a React component definition\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md\n \"react/display-name\": [\"off\", { ignoreTranspilerName: false }],\n\n // Forbid certain propTypes (any, array, object)\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/forbid-prop-types.md\n \"react/forbid-prop-types\": [\n \"error\",\n {\n forbid: [\"any\", \"array\", \"object\"],\n checkContextTypes: true,\n checkChildContextTypes: true,\n },\n ],\n\n // Forbid certain props on DOM Nodes\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/forbid-dom-props.md\n \"react/forbid-dom-props\": [\"off\", { forbid: [] }],\n\n // Enforce boolean attributes notation in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md\n \"react/jsx-boolean-value\": [\"error\", \"never\", { always: [] }],\n\n // Validate closing bracket location in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md\n \"react/jsx-closing-bracket-location\": [\"error\", \"line-aligned\"],\n\n // Enforce or disallow spaces inside of curly braces in JSX attributes\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md\n \"react/jsx-curly-spacing\": [\"error\", \"never\", { allowMultiline: true }],\n\n // Enforce event handler naming conventions in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md\n \"react/jsx-handler-names\": [\n \"off\",\n {\n eventHandlerPrefix: \"handle\",\n eventHandlerPropPrefix: \"on\",\n },\n ],\n\n // Validate props indentation in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md\n \"react/jsx-indent-props\": [\"error\", (styleRules[\"indent\"] as any[])[1] as number],\n\n // Validate JSX has key prop when in array or iterator\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md\n \"react/jsx-key\": \"off\",\n\n // Limit maximum of props on a single line in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md\n \"react/jsx-max-props-per-line\": [\"error\", { maximum: 1, when: \"multiline\" }],\n\n // Prevent usage of .bind() in JSX props\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md\n \"react/jsx-no-bind\": [\n \"error\",\n {\n ignoreRefs: true,\n allowArrowFunctions: true,\n allowFunctions: false,\n allowBind: false,\n ignoreDOMComponents: true,\n },\n ],\n\n // Prevent duplicate props in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md\n \"react/jsx-no-duplicate-props\": [\"error\", { ignoreCase: true }],\n\n // Prevent usage of unwrapped JSX strings\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md\n \"react/jsx-no-literals\": [\"off\", { noStrings: true }],\n\n // Disallow undeclared variables in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md\n \"react/jsx-no-undef\": \"error\",\n\n // Enforce PascalCase for user-defined JSX components\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md\n \"react/jsx-pascal-case\": [\n \"error\",\n {\n allowAllCaps: true,\n ignore: [],\n },\n ],\n\n // Enforce propTypes declarations alphabetical sorting\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md\n \"react/sort-prop-types\": [\n \"off\",\n {\n ignoreCase: true,\n callbacksLast: false,\n requiredFirst: false,\n sortShapeProp: true,\n },\n ],\n\n // Enforce props alphabetical sorting\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md\n \"react/jsx-sort-props\": [\n \"off\",\n {\n ignoreCase: true,\n callbacksLast: false,\n shorthandFirst: false,\n shorthandLast: false,\n noSortAlphabetically: false,\n reservedFirst: true,\n },\n ],\n\n // Prevent React to be incorrectly marked as unused\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md\n \"react/jsx-uses-react\": [hasJsxRuntime ? \"off\" : \"error\"],\n\n // Prevent variables used in JSX to be incorrectly marked as unused\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md\n \"react/jsx-uses-vars\": \"error\",\n\n // Prevent usage of dangerous JSX properties\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md\n \"react/no-danger\": \"warn\",\n\n // Prevent usage of deprecated methods\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md\n \"react/no-deprecated\": [\"error\"],\n\n // Prevent usage of setState in componentDidMount\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md\n // this is necessary for server-rendering\n \"react/no-did-mount-set-state\": \"off\",\n\n // Prevent usage of setState in componentDidUpdate\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md\n \"react/no-did-update-set-state\": \"error\",\n\n // Prevent usage of setState in componentWillUpdate\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-will-update-set-state.md\n \"react/no-will-update-set-state\": \"error\",\n\n // Prevent direct mutation of this.state\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md\n \"react/no-direct-mutation-state\": \"error\",\n\n // Prevent usage of isMounted\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md\n \"react/no-is-mounted\": \"error\",\n\n // Prevent multiple component definition per file\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md\n \"react/no-multi-comp\": \"off\",\n\n // Prevent usage of setState\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md\n \"react/no-set-state\": \"off\",\n\n // Prevent using string references\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md\n \"react/no-string-refs\": \"error\",\n\n // Prevent usage of unknown DOM property\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md\n \"react/no-unknown-property\": \"error\",\n\n // Require ES6 class declarations over React.createClass\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md\n \"react/prefer-es6-class\": [\"error\", \"always\"],\n\n // Require stateless functions when not using lifecycle methods, setState or ref\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md\n \"react/prefer-stateless-function\": [\"error\", { ignorePureComponents: true }],\n\n // Prevent missing props validation in a React component definition\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md\n \"react/prop-types\": [\n \"error\",\n {\n ignore: [],\n customValidators: [],\n skipUndeclared: false,\n },\n ],\n\n // Prevent missing React when using JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md\n \"react/react-in-jsx-scope\": hasJsxRuntime ? \"off\" : \"error\",\n\n // Require render() methods to return something\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-render-return.md\n \"react/require-render-return\": \"error\",\n\n // Prevent extra closing tags for components without children\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md\n \"react/self-closing-comp\": \"error\",\n\n // Enforce defaultProps declarations alphabetical sorting\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/sort-default-props.md\n \"react/sort-default-props\": [\n \"error\",\n {\n ignoreCase: true,\n },\n ],\n\n // Enforce component methods order\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/sort-comp.md\n \"react/sort-comp\": [\n \"error\",\n {\n order: [\n \"static-variables\",\n \"static-methods\",\n \"instance-variables\",\n \"lifecycle\",\n \"/^handle.+$/\",\n \"/^on.+$/\",\n \"getters\",\n \"setters\",\n \"/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/\",\n \"instance-methods\",\n \"everything-else\",\n \"rendering\",\n ],\n groups: {\n lifecycle: [\n \"displayName\",\n \"propTypes\",\n \"contextTypes\",\n \"childContextTypes\",\n \"mixins\",\n \"statics\",\n \"defaultProps\",\n \"constructor\",\n \"getDefaultProps\",\n \"getInitialState\",\n \"state\",\n \"getChildContext\",\n \"getDerivedStateFromProps\",\n \"componentWillMount\",\n \"UNSAFE_componentWillMount\",\n \"componentDidMount\",\n \"componentWillReceiveProps\",\n \"UNSAFE_componentWillReceiveProps\",\n \"shouldComponentUpdate\",\n \"componentWillUpdate\",\n \"UNSAFE_componentWillUpdate\",\n \"getSnapshotBeforeUpdate\",\n \"componentDidUpdate\",\n \"componentDidCatch\",\n \"componentWillUnmount\",\n ],\n rendering: [\"/^render.+$/\", \"render\"],\n },\n },\n ],\n\n // Require that the first prop in a JSX element be on a new line when the element is multiline\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md\n \"react/jsx-first-prop-new-line\": [\"error\", \"multiline-multiprop\"],\n\n // Enforce spacing around jsx equals signs\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md\n \"react/jsx-equals-spacing\": [\"error\", \"never\"],\n\n // Enforce JSX indentation\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md\n \"react/jsx-indent\": [\"error\", (styleRules[\"indent\"] as any[])[1] as number, { checkAttributes: true, indentLogicalExpressions: true }],\n\n // Disallow target=\"_blank\" on links\n // https://github.com/yannickcr/eslint-plugin-react/blob/ac102885765be5ff37847a871f239c6703e1c7cc/docs/rules/jsx-no-target-blank.md\n \"react/jsx-no-target-blank\": [\"error\", { enforceDynamicLinks: \"always\" }],\n\n // prevent accidental JS comments from being injected into JSX as text\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md\n \"react/jsx-no-comment-textnodes\": \"error\",\n\n // disallow using React.render/ReactDOM.render's return value\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md\n \"react/no-render-return-value\": \"error\",\n\n // require a shouldComponentUpdate method, or PureRenderMixin\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-optimization.md\n \"react/require-optimization\": [\"off\", { allowDecorators: [] }],\n\n // warn against using findDOMNode()\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md\n \"react/no-find-dom-node\": \"error\",\n\n // Forbid certain props on Components\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md\n \"react/forbid-component-props\": [\"off\", { forbid: [] }],\n\n // Forbid certain elements\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-elements.md\n \"react/forbid-elements\": [\"off\", { forbid: [] }],\n\n // Prevent problem with children and props.dangerouslySetInnerHTML\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md\n \"react/no-danger-with-children\": \"error\",\n\n // Prevent unused propType definitions\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md\n \"react/no-unused-prop-types\": [\n \"error\",\n {\n customValidators: [],\n skipShapeProps: true,\n },\n ],\n\n // Require style prop value be an object or var\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md\n \"react/style-prop-object\": \"error\",\n\n // Prevent invalid characters from appearing in markup\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md\n \"react/no-unescaped-entities\": \"error\",\n\n // Prevent passing of children as props\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md\n \"react/no-children-prop\": \"error\",\n\n // Validate whitespace in and around the JSX opening and closing brackets\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-tag-spacing.md\n \"react/jsx-tag-spacing\": [\n \"error\",\n {\n closingSlash: \"never\",\n beforeSelfClosing: \"always\",\n afterOpening: \"never\",\n beforeClosing: \"never\",\n },\n ],\n\n // Enforce spaces before the closing bracket of self-closing JSX elements\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-space-before-closing.md\n // Deprecated in favor of jsx-tag-spacing\n \"react/jsx-space-before-closing\": [\"off\", \"always\"],\n\n // Prevent usage of Array index in keys\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md\n \"react/no-array-index-key\": \"error\",\n\n // Enforce a defaultProps definition for every prop that is not a required prop\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/require-default-props.md\n \"react/require-default-props\": [\n \"error\",\n {\n forbidDefaultForRequired: true,\n },\n ],\n\n // Forbids using non-exported propTypes\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-foreign-prop-types.md\n // this is intentionally set to \"warn\". it would be \"error\",\n // but it's only critical if you're stripping propTypes in production.\n \"react/forbid-foreign-prop-types\": [\"warn\", { allowInPropTypes: true }],\n\n // Prevent void DOM elements from receiving children\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md\n \"react/void-dom-elements-no-children\": \"error\",\n\n // Enforce all defaultProps have a corresponding non-required PropType\n // https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/default-props-match-prop-types.md\n \"react/default-props-match-prop-types\": [\"error\", { allowRequiredDefaults: false }],\n\n // Prevent usage of shouldComponentUpdate when extending React.PureComponent\n // https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/no-redundant-should-component-update.md\n \"react/no-redundant-should-component-update\": \"error\",\n\n // Prevent unused state values\n // https://github.com/yannickcr/eslint-plugin-react/pull/1103/\n \"react/no-unused-state\": \"error\",\n\n // Enforces consistent naming for boolean props\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/boolean-prop-naming.md\n \"react/boolean-prop-naming\": [\n \"off\",\n {\n propTypeNames: [\"bool\", \"mutuallyExclusiveTrueProps\"],\n rule: \"^(is|has)[A-Z]([A-Za-z0-9]?)+\",\n message: \"\",\n },\n ],\n\n // Enforce curly braces or disallow unnecessary curly braces in JSX props and/or children\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md\n \"react/jsx-curly-brace-presence\": [\"error\", { props: \"never\", children: \"never\" }],\n\n // One JSX Element Per Line\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-one-expression-per-line.md\n \"react/jsx-one-expression-per-line\": [\"error\", { allow: \"single-child\" }],\n\n // Enforce consistent usage of destructuring assignment of props, state, and context\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/destructuring-assignment.md\n \"react/destructuring-assignment\": [\"error\", \"always\"],\n\n // Prevent using this.state within a this.setState\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/no-access-state-in-setstate.md\n \"react/no-access-state-in-setstate\": \"error\",\n\n // Prevent usage of button elements without an explicit type attribute\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/button-has-type.md\n \"react/button-has-type\": [\n \"error\",\n {\n button: true,\n submit: true,\n reset: false,\n },\n ],\n\n // Ensures inline tags are not rendered without spaces between them\n \"react/jsx-child-element-spacing\": \"off\",\n\n // Prevent this from being used in stateless functional components\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/no-this-in-sfc.md\n \"react/no-this-in-sfc\": \"error\",\n\n // Validate JSX maximum depth\n // https://github.com/yannickcr/eslint-plugin-react/blob/abe8381c0d6748047224c430ce47f02e40160ed0/docs/rules/jsx-max-depth.md\n \"react/jsx-max-depth\": \"off\",\n\n // Disallow multiple spaces between inline JSX props\n // https://github.com/yannickcr/eslint-plugin-react/blob/ac102885765be5ff37847a871f239c6703e1c7cc/docs/rules/jsx-props-no-multi-spaces.md\n \"react/jsx-props-no-multi-spaces\": \"error\",\n\n // Prevent usage of UNSAFE_ methods\n // https://github.com/yannickcr/eslint-plugin-react/blob/157cc932be2cfaa56b3f5b45df6f6d4322a2f660/docs/rules/no-unsafe.md\n \"react/no-unsafe\": \"off\",\n\n // Enforce shorthand or standard form for React fragments\n // https://github.com/yannickcr/eslint-plugin-react/blob/bc976b837abeab1dffd90ac6168b746a83fc83cc/docs/rules/jsx-fragments.md\n \"react/jsx-fragments\": [\"error\", \"syntax\"],\n\n // Enforce linebreaks in curly braces in JSX attributes and expressions.\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md\n \"react/jsx-curly-newline\": [\n \"error\",\n {\n multiline: \"consistent\",\n singleline: \"consistent\",\n },\n ],\n\n // Enforce state initialization style\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md\n // TODO: set to \"never\" once @anolilab/babel-preset supports public class fields\n \"react/state-in-constructor\": [\"error\", \"always\"],\n\n // Enforces where React component static properties should be positioned\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md\n // TODO: set to \"static public field\" once @anolilab/babel-preset supports public class fields\n \"react/static-property-placement\": [\"error\", \"property assignment\"],\n\n // Disallow JSX props spreading\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md\n \"react/jsx-props-no-spreading\": [\n \"error\",\n {\n html: \"enforce\",\n custom: \"enforce\",\n explicitSpread: \"ignore\",\n exceptions: [],\n },\n ],\n\n // Enforce that props are read-only\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md\n \"react/prefer-read-only-props\": \"off\",\n\n // Prevent usage of `javascript:` URLs\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md\n \"react/jsx-no-script-url\": [\n \"error\",\n [\n {\n name: \"Link\",\n props: [\"to\"],\n },\n ],\n ],\n\n // Disallow unnecessary fragments\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md\n \"react/jsx-no-useless-fragment\": \"error\",\n\n // Prevent adjacent inline elements not separated by whitespace\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md\n \"react/no-adjacent-inline-elements\": \"error\",\n\n // Enforce a specific function type for function components\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md\n \"react/function-component-definition\": [\n \"error\",\n {\n namedComponents: \"arrow-function\",\n unnamedComponents: \"arrow-function\",\n },\n ],\n\n // Enforce a new line after jsx elements and expressions\n // https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-newline.md\n \"react/jsx-newline\": \"off\",\n\n // Prevent react contexts from taking non-stable values\n // https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-no-constructed-context-values.md\n \"react/jsx-no-constructed-context-values\": \"error\",\n\n ...prettierReactRules,\n },\n },\n {\n files: [\"*.jsx\"],\n rules: {\n // only .jsx files may have JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md\n \"react/jsx-filename-extension\": \"error\",\n\n // Prevents common casing typos\n // https://github.com/yannickcr/eslint-plugin-react/blob/73abadb697034b5ccb514d79fb4689836fe61f91/docs/rules/no-typos.md\n \"react/no-typos\": \"error\",\n\n // Validate closing tag location in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md\n \"react/jsx-closing-tag-location\": \"error\",\n\n // Prevent missing parentheses around multilines JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-wrap-multilines.md\n \"react/jsx-wrap-multilines\": [\n \"error\",\n {\n // eslint-disable-next-line sonarjs/no-duplicate-string\n declaration: \"parens-new-line\",\n assignment: \"parens-new-line\",\n return: \"parens-new-line\",\n arrow: \"parens-new-line\",\n condition: \"parens-new-line\",\n logical: \"parens-new-line\",\n prop: \"parens-new-line\",\n },\n ],\n },\n },\n {\n files: [\"*.tsx\"],\n rules: {\n // Disable JS specific rules\n \"react/jsx-filename-extension\": \"off\",\n \"react/default-props-match-prop-types\": \"off\",\n \"react/prop-types\": \"off\",\n },\n },\n ],\n};\n\nexport default config;\n"]}
1
+ {"version":3,"sources":["../../../src/config/plugins/react.ts"],"names":["getPackageSubProperty","hasAnyDep","pkg","findUp","env","styleRules","style_default","dangleRules","prettierReactRules","anolilabEslintConfig","hasJsxRuntime","isFile","showLog","consoleLog","reactVersion","config","react_default"],"mappings":"wFACA,OAAS,yBAAAA,EAAsB,aAAAC,EAAW,OAAAC,MAAW,+BAErD,OAAOC,MAAY,UACnB,OAAS,OAAAC,MAAW,UAKpB,IAAMC,EAAaC,EAAY,MACzBC,EAAcF,EAAW,sBAAsB,EAEjDG,EAAqB,CAAC,EAGtBP,EAAU,CAAC,UAAU,EAAG,CACpB,SAAU,EACd,CAAC,IAEDO,EAAqB,CACjB,kCAAmC,MACnC,qCAAsC,MACtC,iCAAkC,MAClC,0BAA2B,MAC3B,0BAA2B,MAC3B,2BAA4B,MAC5B,gCAAiC,MACjC,mBAAoB,MACpB,yBAA0B,MAC1B,+BAAgC,MAChC,oBAAqB,MACrB,oCAAqC,MACrC,kCAAmC,MACnC,wBAAyB,MACzB,4BAA6B,KACjC,GAGJ,IAAIC,EAA+D,CAAC,EAEhEP,IAEAO,EAAuBP,GAAM,WAAc,eAAe,GAG9D,IAAMQ,GAAiB,IAAM,CAEzB,GAAI,CAAC,OAAO,wCAAyC,CAEjD,IAAMC,EAAS,OADGR,EAAO,KAAK,mCAAmC,GAC7B,SAEhCS,EAAmBR,EAAI,2CAAgD,OAEvEQ,GAAWH,GAAuB,mCAAwC,SAC1EG,EAAUH,EAAqB,kCAG/BG,GAAWD,GACXE,EAAW;AAAA;AAAA;AAAA;AAAA;AAAA,CAEkE,EAGjF,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C,MACxC,mBAAoB,KACxB,CACJ,CACJ,CACJ,EAEOQ,EAAQD","sourcesContent":["// @see https://github.com/yannickcr/eslint-plugin-react\nimport { getPackageSubProperty,hasAnyDep, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\nimport findUp from \"find-up\";\nimport { env } from \"node:process\";\n\nimport { consoleLog } from \"../../utils/loggers\";\nimport styleConfig from \"../style\";\n\nconst styleRules = styleConfig.rules as Linter.RulesRecord;\nconst dangleRules = styleRules[\"no-underscore-dangle\"] as any[];\n\nlet prettierReactRules = {};\n\nif (\n hasAnyDep([\"prettier\"], {\n peerDeps: false,\n })\n) {\n prettierReactRules = {\n \"react/jsx-child-element-spacing\": \"off\",\n \"react/jsx-closing-bracket-location\": \"off\",\n \"react/jsx-closing-tag-location\": \"off\",\n \"react/jsx-curly-newline\": \"off\",\n \"react/jsx-curly-spacing\": \"off\",\n \"react/jsx-equals-spacing\": \"off\",\n \"react/jsx-first-prop-new-line\": \"off\",\n \"react/jsx-indent\": \"off\",\n \"react/jsx-indent-props\": \"off\",\n \"react/jsx-max-props-per-line\": \"off\",\n \"react/jsx-newline\": \"off\",\n \"react/jsx-one-expression-per-line\": \"off\",\n \"react/jsx-props-no-multi-spaces\": \"off\",\n \"react/jsx-tag-spacing\": \"off\",\n \"react/jsx-wrap-multilines\": \"off\",\n };\n}\n\nlet anolilabEslintConfig: { [key: string]: boolean | undefined } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\nconst hasJsxRuntime = (() => {\n // Workaround VS Code trying to run this file twice!\n if (!global.hasAnolilabEsLintConfigReactRuntimePath) {\n const reactPath = findUp.sync(\"node_modules/react/jsx-runtime.js\");\n const isFile = typeof reactPath === \"string\";\n\n let showLog: boolean = env[\"DISABLE_INFO_ON_DISABLING_JSX_REACT_RULE\"] !== \"true\";\n\n if (showLog && anolilabEslintConfig?.[\"info_on_disabling_jsx_react_rule\"] !== undefined) {\n showLog = anolilabEslintConfig[\"info_on_disabling_jsx_react_rule\"];\n }\n\n if (showLog && isFile) {\n consoleLog(`\\n@anolilab/eslint-config found react jsx-runtime. \\n\n Following rules are disabled: \"react/jsx-uses-react\" and \"react/react-in-jsx-scope\".\n If you dont use the new react jsx-runtime in you project, please enable it manually.\\n`);\n }\n\n global.hasAnolilabEsLintConfigReactRuntimePath = isFile;\n }\n\n return global.hasAnolilabEsLintConfigReactRuntimePath;\n})();\n\nlet reactVersion: string | undefined = getPackageSubProperty<string>(\"dependencies\")(\"react\")\n\nif (reactVersion === undefined) {\n reactVersion = getPackageSubProperty<string | undefined>(\"devDependencies\")(\"react\");\n}\n\nif (reactVersion !== undefined && anolilabEslintConfig?.[\"info_on_found_react_version\"] !== false) {\n consoleLog(`\\n@anolilab/eslint-config found the version ${reactVersion} of react in your dependencies, this version ${reactVersion} will be used to setup the \"eslint-plugin-react\"\\n`);\n}\n\nconst config: Linter.Config = {\n overrides: [\n {\n files: [\"*.jsx\", \"*.tsx\"],\n\n plugins: [\"react\"],\n\n env: {\n browser: true,\n },\n\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n\n settings: {\n \"import/resolver\": {\n node: {\n extensions: [\".js\", \".jsx\", \".json\", \".cjs\", \".mjs\"],\n },\n },\n react: {\n // The default value is \"detect\". Automatic detection works by loading the entire React library\n // into the linter's process, which is inefficient. It is recommended to specify the version\n // explicity.\n version: reactVersion ?? \"detect\",\n },\n propWrapperFunctions: [\n \"forbidExtraProps\", // https://www.npmjs.com/package/airbnb-prop-types\n \"exact\", // https://www.npmjs.com/package/prop-types-exact\n \"Object.freeze\", // https://tc39.github.io/ecma262/#sec-object.freeze\n ],\n },\n\n // View link below for react rules documentation\n // https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules\n rules: {\n \"no-underscore-dangle\": [\n dangleRules[0],\n {\n ...dangleRules[1],\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n allow: [...dangleRules[1].allow, \"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\"],\n },\n ],\n\n // Specify whether double or single quotes should be used in JSX attributes\n // https://eslint.org/docs/rules/jsx-quotes\n \"jsx-quotes\": [\"error\", \"prefer-double\"],\n\n \"class-methods-use-this\": [\n \"error\",\n {\n exceptMethods: [\n \"render\",\n \"getInitialState\",\n \"getDefaultProps\",\n \"getChildContext\",\n \"componentWillMount\",\n \"UNSAFE_componentWillMount\",\n \"componentDidMount\",\n \"componentWillReceiveProps\",\n \"UNSAFE_componentWillReceiveProps\",\n \"shouldComponentUpdate\",\n \"componentWillUpdate\",\n \"UNSAFE_componentWillUpdate\",\n \"componentDidUpdate\",\n \"componentWillUnmount\",\n \"componentDidCatch\",\n \"getSnapshotBeforeUpdate\",\n ],\n },\n ],\n\n // Prevent missing displayName in a React component definition\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md\n \"react/display-name\": [\"off\", { ignoreTranspilerName: false }],\n\n // Forbid certain propTypes (any, array, object)\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/forbid-prop-types.md\n \"react/forbid-prop-types\": [\n \"error\",\n {\n forbid: [\"any\", \"array\", \"object\"],\n checkContextTypes: true,\n checkChildContextTypes: true,\n },\n ],\n\n // Forbid certain props on DOM Nodes\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/forbid-dom-props.md\n \"react/forbid-dom-props\": [\"off\", { forbid: [] }],\n\n // Enforce boolean attributes notation in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md\n \"react/jsx-boolean-value\": [\"error\", \"never\", { always: [] }],\n\n // Validate closing bracket location in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md\n \"react/jsx-closing-bracket-location\": [\"error\", \"line-aligned\"],\n\n // Enforce or disallow spaces inside of curly braces in JSX attributes\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md\n \"react/jsx-curly-spacing\": [\"error\", \"never\", { allowMultiline: true }],\n\n // Enforce event handler naming conventions in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md\n \"react/jsx-handler-names\": [\n \"off\",\n {\n eventHandlerPrefix: \"handle\",\n eventHandlerPropPrefix: \"on\",\n },\n ],\n\n // Validate props indentation in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md\n \"react/jsx-indent-props\": [\"error\", (styleRules[\"indent\"] as any[])[1] as number],\n\n // Validate JSX has key prop when in array or iterator\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md\n \"react/jsx-key\": \"off\",\n\n // Limit maximum of props on a single line in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md\n \"react/jsx-max-props-per-line\": [\"error\", { maximum: 1, when: \"multiline\" }],\n\n // Prevent usage of .bind() in JSX props\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md\n \"react/jsx-no-bind\": [\n \"error\",\n {\n ignoreRefs: true,\n allowArrowFunctions: true,\n allowFunctions: false,\n allowBind: false,\n ignoreDOMComponents: true,\n },\n ],\n\n // Prevent duplicate props in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md\n \"react/jsx-no-duplicate-props\": [\"error\", { ignoreCase: true }],\n\n // Prevent usage of unwrapped JSX strings\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md\n \"react/jsx-no-literals\": [\"off\", { noStrings: true }],\n\n // Disallow undeclared variables in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md\n \"react/jsx-no-undef\": \"error\",\n\n // Enforce PascalCase for user-defined JSX components\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md\n \"react/jsx-pascal-case\": [\n \"error\",\n {\n allowAllCaps: true,\n ignore: [],\n },\n ],\n\n // Enforce propTypes declarations alphabetical sorting\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md\n \"react/sort-prop-types\": [\n \"off\",\n {\n ignoreCase: true,\n callbacksLast: false,\n requiredFirst: false,\n sortShapeProp: true,\n },\n ],\n\n // Enforce props alphabetical sorting\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md\n \"react/jsx-sort-props\": [\n \"off\",\n {\n ignoreCase: true,\n callbacksLast: false,\n shorthandFirst: false,\n shorthandLast: false,\n noSortAlphabetically: false,\n reservedFirst: true,\n },\n ],\n\n // Prevent React to be incorrectly marked as unused\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md\n \"react/jsx-uses-react\": [hasJsxRuntime ? \"off\" : \"error\"],\n\n // Prevent variables used in JSX to be incorrectly marked as unused\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md\n \"react/jsx-uses-vars\": \"error\",\n\n // Prevent usage of dangerous JSX properties\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md\n \"react/no-danger\": \"warn\",\n\n // Prevent usage of deprecated methods\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md\n \"react/no-deprecated\": [\"error\"],\n\n // Prevent usage of setState in componentDidMount\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md\n // this is necessary for server-rendering\n \"react/no-did-mount-set-state\": \"off\",\n\n // Prevent usage of setState in componentDidUpdate\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md\n \"react/no-did-update-set-state\": \"error\",\n\n // Prevent usage of setState in componentWillUpdate\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-will-update-set-state.md\n \"react/no-will-update-set-state\": \"error\",\n\n // Prevent direct mutation of this.state\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md\n \"react/no-direct-mutation-state\": \"error\",\n\n // Prevent usage of isMounted\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md\n \"react/no-is-mounted\": \"error\",\n\n // Prevent multiple component definition per file\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md\n \"react/no-multi-comp\": \"off\",\n\n // Prevent usage of setState\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md\n \"react/no-set-state\": \"off\",\n\n // Prevent using string references\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md\n \"react/no-string-refs\": \"error\",\n\n // Prevent usage of unknown DOM property\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md\n \"react/no-unknown-property\": \"error\",\n\n // Require ES6 class declarations over React.createClass\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md\n \"react/prefer-es6-class\": [\"error\", \"always\"],\n\n // Require stateless functions when not using lifecycle methods, setState or ref\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md\n \"react/prefer-stateless-function\": [\"error\", { ignorePureComponents: true }],\n\n // Prevent missing props validation in a React component definition\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md\n \"react/prop-types\": [\n \"error\",\n {\n ignore: [],\n customValidators: [],\n skipUndeclared: false,\n },\n ],\n\n // Prevent missing React when using JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md\n \"react/react-in-jsx-scope\": hasJsxRuntime ? \"off\" : \"error\",\n\n // Require render() methods to return something\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-render-return.md\n \"react/require-render-return\": \"error\",\n\n // Prevent extra closing tags for components without children\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md\n \"react/self-closing-comp\": \"error\",\n\n // Enforce defaultProps declarations alphabetical sorting\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/sort-default-props.md\n \"react/sort-default-props\": [\n \"error\",\n {\n ignoreCase: true,\n },\n ],\n\n // Enforce component methods order\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/sort-comp.md\n \"react/sort-comp\": [\n \"error\",\n {\n order: [\n \"static-variables\",\n \"static-methods\",\n \"instance-variables\",\n \"lifecycle\",\n \"/^handle.+$/\",\n \"/^on.+$/\",\n \"getters\",\n \"setters\",\n \"/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/\",\n \"instance-methods\",\n \"everything-else\",\n \"rendering\",\n ],\n groups: {\n lifecycle: [\n \"displayName\",\n \"propTypes\",\n \"contextTypes\",\n \"childContextTypes\",\n \"mixins\",\n \"statics\",\n \"defaultProps\",\n \"constructor\",\n \"getDefaultProps\",\n \"getInitialState\",\n \"state\",\n \"getChildContext\",\n \"getDerivedStateFromProps\",\n \"componentWillMount\",\n \"UNSAFE_componentWillMount\",\n \"componentDidMount\",\n \"componentWillReceiveProps\",\n \"UNSAFE_componentWillReceiveProps\",\n \"shouldComponentUpdate\",\n \"componentWillUpdate\",\n \"UNSAFE_componentWillUpdate\",\n \"getSnapshotBeforeUpdate\",\n \"componentDidUpdate\",\n \"componentDidCatch\",\n \"componentWillUnmount\",\n ],\n rendering: [\"/^render.+$/\", \"render\"],\n },\n },\n ],\n\n // Require that the first prop in a JSX element be on a new line when the element is multiline\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md\n \"react/jsx-first-prop-new-line\": [\"error\", \"multiline-multiprop\"],\n\n // Enforce spacing around jsx equals signs\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md\n \"react/jsx-equals-spacing\": [\"error\", \"never\"],\n\n // Enforce JSX indentation\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md\n \"react/jsx-indent\": [\"error\", (styleRules[\"indent\"] as any[])[1] as number, { checkAttributes: true, indentLogicalExpressions: true }],\n\n // Disallow target=\"_blank\" on links\n // https://github.com/yannickcr/eslint-plugin-react/blob/ac102885765be5ff37847a871f239c6703e1c7cc/docs/rules/jsx-no-target-blank.md\n \"react/jsx-no-target-blank\": [\"error\", { enforceDynamicLinks: \"always\" }],\n\n // prevent accidental JS comments from being injected into JSX as text\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md\n \"react/jsx-no-comment-textnodes\": \"error\",\n\n // disallow using React.render/ReactDOM.render's return value\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md\n \"react/no-render-return-value\": \"error\",\n\n // require a shouldComponentUpdate method, or PureRenderMixin\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-optimization.md\n \"react/require-optimization\": [\"off\", { allowDecorators: [] }],\n\n // warn against using findDOMNode()\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md\n \"react/no-find-dom-node\": \"error\",\n\n // Forbid certain props on Components\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md\n \"react/forbid-component-props\": [\"off\", { forbid: [] }],\n\n // Forbid certain elements\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-elements.md\n \"react/forbid-elements\": [\"off\", { forbid: [] }],\n\n // Prevent problem with children and props.dangerouslySetInnerHTML\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md\n \"react/no-danger-with-children\": \"error\",\n\n // Prevent unused propType definitions\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md\n \"react/no-unused-prop-types\": [\n \"error\",\n {\n customValidators: [],\n skipShapeProps: true,\n },\n ],\n\n // Require style prop value be an object or var\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md\n \"react/style-prop-object\": \"error\",\n\n // Prevent invalid characters from appearing in markup\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md\n \"react/no-unescaped-entities\": \"error\",\n\n // Prevent passing of children as props\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md\n \"react/no-children-prop\": \"error\",\n\n // Validate whitespace in and around the JSX opening and closing brackets\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-tag-spacing.md\n \"react/jsx-tag-spacing\": [\n \"error\",\n {\n closingSlash: \"never\",\n beforeSelfClosing: \"always\",\n afterOpening: \"never\",\n beforeClosing: \"never\",\n },\n ],\n\n // Enforce spaces before the closing bracket of self-closing JSX elements\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-space-before-closing.md\n // Deprecated in favor of jsx-tag-spacing\n \"react/jsx-space-before-closing\": [\"off\", \"always\"],\n\n // Prevent usage of Array index in keys\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md\n \"react/no-array-index-key\": \"error\",\n\n // Enforce a defaultProps definition for every prop that is not a required prop\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/require-default-props.md\n \"react/require-default-props\": [\n \"error\",\n {\n forbidDefaultForRequired: true,\n },\n ],\n\n // Forbids using non-exported propTypes\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-foreign-prop-types.md\n // this is intentionally set to \"warn\". it would be \"error\",\n // but it's only critical if you're stripping propTypes in production.\n \"react/forbid-foreign-prop-types\": [\"warn\", { allowInPropTypes: true }],\n\n // Prevent void DOM elements from receiving children\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md\n \"react/void-dom-elements-no-children\": \"error\",\n\n // Enforce all defaultProps have a corresponding non-required PropType\n // https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/default-props-match-prop-types.md\n \"react/default-props-match-prop-types\": [\"error\", { allowRequiredDefaults: false }],\n\n // Prevent usage of shouldComponentUpdate when extending React.PureComponent\n // https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/no-redundant-should-component-update.md\n \"react/no-redundant-should-component-update\": \"error\",\n\n // Prevent unused state values\n // https://github.com/yannickcr/eslint-plugin-react/pull/1103/\n \"react/no-unused-state\": \"error\",\n\n // Enforces consistent naming for boolean props\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/boolean-prop-naming.md\n \"react/boolean-prop-naming\": [\n \"off\",\n {\n propTypeNames: [\"bool\", \"mutuallyExclusiveTrueProps\"],\n rule: \"^(is|has)[A-Z]([A-Za-z0-9]?)+\",\n message: \"\",\n },\n ],\n\n // Enforce curly braces or disallow unnecessary curly braces in JSX props and/or children\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md\n \"react/jsx-curly-brace-presence\": [\"error\", { props: \"never\", children: \"never\" }],\n\n // One JSX Element Per Line\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-one-expression-per-line.md\n \"react/jsx-one-expression-per-line\": [\"error\", { allow: \"single-child\" }],\n\n // Enforce consistent usage of destructuring assignment of props, state, and context\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/destructuring-assignment.md\n \"react/destructuring-assignment\": [\"error\", \"always\"],\n\n // Prevent using this.state within a this.setState\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/no-access-state-in-setstate.md\n \"react/no-access-state-in-setstate\": \"error\",\n\n // Prevent usage of button elements without an explicit type attribute\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/button-has-type.md\n \"react/button-has-type\": [\n \"error\",\n {\n button: true,\n submit: true,\n reset: false,\n },\n ],\n\n // Ensures inline tags are not rendered without spaces between them\n \"react/jsx-child-element-spacing\": \"off\",\n\n // Prevent this from being used in stateless functional components\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/no-this-in-sfc.md\n \"react/no-this-in-sfc\": \"error\",\n\n // Validate JSX maximum depth\n // https://github.com/yannickcr/eslint-plugin-react/blob/abe8381c0d6748047224c430ce47f02e40160ed0/docs/rules/jsx-max-depth.md\n \"react/jsx-max-depth\": \"off\",\n\n // Disallow multiple spaces between inline JSX props\n // https://github.com/yannickcr/eslint-plugin-react/blob/ac102885765be5ff37847a871f239c6703e1c7cc/docs/rules/jsx-props-no-multi-spaces.md\n \"react/jsx-props-no-multi-spaces\": \"error\",\n\n // Prevent usage of UNSAFE_ methods\n // https://github.com/yannickcr/eslint-plugin-react/blob/157cc932be2cfaa56b3f5b45df6f6d4322a2f660/docs/rules/no-unsafe.md\n \"react/no-unsafe\": \"off\",\n\n // Enforce shorthand or standard form for React fragments\n // https://github.com/yannickcr/eslint-plugin-react/blob/bc976b837abeab1dffd90ac6168b746a83fc83cc/docs/rules/jsx-fragments.md\n \"react/jsx-fragments\": [\"error\", \"syntax\"],\n\n // Enforce linebreaks in curly braces in JSX attributes and expressions.\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md\n \"react/jsx-curly-newline\": [\n \"error\",\n {\n multiline: \"consistent\",\n singleline: \"consistent\",\n },\n ],\n\n // Enforce state initialization style\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md\n // TODO: set to \"never\" once @anolilab/babel-preset supports public class fields\n \"react/state-in-constructor\": [\"error\", \"always\"],\n\n // Enforces where React component static properties should be positioned\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md\n // TODO: set to \"static public field\" once @anolilab/babel-preset supports public class fields\n \"react/static-property-placement\": [\"error\", \"property assignment\"],\n\n // Disallow JSX props spreading\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md\n \"react/jsx-props-no-spreading\": [\n \"error\",\n {\n html: \"enforce\",\n custom: \"enforce\",\n explicitSpread: \"ignore\",\n exceptions: [],\n },\n ],\n\n // Enforce that props are read-only\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md\n \"react/prefer-read-only-props\": \"off\",\n\n // Prevent usage of `javascript:` URLs\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md\n \"react/jsx-no-script-url\": [\n \"error\",\n [\n {\n name: \"Link\",\n props: [\"to\"],\n },\n ],\n ],\n\n // Disallow unnecessary fragments\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md\n \"react/jsx-no-useless-fragment\": \"error\",\n\n // Prevent adjacent inline elements not separated by whitespace\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md\n \"react/no-adjacent-inline-elements\": \"error\",\n\n // Enforce a specific function type for function components\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md\n \"react/function-component-definition\": [\n \"error\",\n {\n namedComponents: \"arrow-function\",\n unnamedComponents: \"arrow-function\",\n },\n ],\n\n // Enforce a new line after jsx elements and expressions\n // https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-newline.md\n \"react/jsx-newline\": \"off\",\n\n // Prevent react contexts from taking non-stable values\n // https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-no-constructed-context-values.md\n \"react/jsx-no-constructed-context-values\": \"error\",\n\n ...prettierReactRules,\n },\n },\n {\n files: [\"*.jsx\"],\n rules: {\n // only .jsx files may have JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md\n \"react/jsx-filename-extension\": \"error\",\n\n // Prevents common casing typos\n // https://github.com/yannickcr/eslint-plugin-react/blob/73abadb697034b5ccb514d79fb4689836fe61f91/docs/rules/no-typos.md\n \"react/no-typos\": \"error\",\n\n // Validate closing tag location in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md\n \"react/jsx-closing-tag-location\": \"error\",\n\n // Prevent missing parentheses around multilines JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-wrap-multilines.md\n \"react/jsx-wrap-multilines\": [\n \"error\",\n {\n // eslint-disable-next-line sonarjs/no-duplicate-string\n declaration: \"parens-new-line\",\n assignment: \"parens-new-line\",\n return: \"parens-new-line\",\n arrow: \"parens-new-line\",\n condition: \"parens-new-line\",\n logical: \"parens-new-line\",\n prop: \"parens-new-line\",\n },\n ],\n },\n },\n {\n files: [\"*.tsx\"],\n rules: {\n // Disable JS specific rules\n \"react/jsx-filename-extension\": \"off\",\n \"react/default-props-match-prop-types\": \"off\",\n \"react/prop-types\": \"off\",\n },\n },\n ],\n};\n\nexport default config;\n"]}
@@ -1,7 +1,6 @@
1
1
  import { b } from '../../chunk-G7JIJH44.mjs';
2
2
  import { a } from '../../chunk-NH6CJJWC.mjs';
3
- import { hasAnyDep, pkg } from '@anolilab/package-json-utils';
4
- import { getPackageSubProperty } from '@anolilab/package-json-utils/src';
3
+ import { hasAnyDep, pkg, getPackageSubProperty } from '@anolilab/package-json-utils';
5
4
  import d from 'find-up';
6
5
  import { env } from 'process';
7
6
 
@@ -12,8 +11,8 @@ var s=a.rules,n=s["no-underscore-dangle"],f={};hasAnyDep(["prettier"],{peerDeps:
12
11
  If you dont use the new react jsx-runtime in you project, please enable it manually.
13
12
  `),global.hasAnolilabEsLintConfigReactRuntimePath=a;}return global.hasAnolilabEsLintConfigReactRuntimePath})(),e=getPackageSubProperty("dependencies")("react");e===void 0&&(e=getPackageSubProperty("devDependencies")("react"));e!==void 0&&r?.info_on_found_react_version!==!1&&b(`
14
13
  @anolilab/eslint-config found the version ${e} of react in your dependencies, this version ${e} will be used to setup the "eslint-plugin-react"
15
- `);var g={overrides:[{files:["*.jsx","*.tsx"],plugins:["react"],env:{browser:!0},parserOptions:{ecmaFeatures:{jsx:!0}},settings:{"import/resolver":{node:{extensions:[".js",".jsx",".json",".cjs",".mjs"]}},react:{version:e??"detect"},propWrapperFunctions:["forbidExtraProps","exact","Object.freeze"]},rules:{"no-underscore-dangle":[n[0],{...n[1],allow:[...n[1].allow,"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"]}],"jsx-quotes":["error","prefer-double"],"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"]}],"react/display-name":["off",{ignoreTranspilerName:!1}],"react/forbid-prop-types":["error",{forbid:["any","array","object"],checkContextTypes:!0,checkChildContextTypes:!0}],"react/forbid-dom-props":["off",{forbid:[]}],"react/jsx-boolean-value":["error","never",{always:[]}],"react/jsx-closing-bracket-location":["error","line-aligned"],"react/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-indent-props":["error",s.indent[1]],"react/jsx-key":"off","react/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"react/jsx-no-bind":["error",{ignoreRefs:!0,allowArrowFunctions:!0,allowFunctions:!1,allowBind:!1,ignoreDOMComponents:!0}],"react/jsx-no-duplicate-props":["error",{ignoreCase:!0}],"react/jsx-no-literals":["off",{noStrings:!0}],"react/jsx-no-undef":"error","react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/sort-prop-types":["off",{ignoreCase:!0,callbacksLast:!1,requiredFirst:!1,sortShapeProp:!0}],"react/jsx-sort-props":["off",{ignoreCase:!0,callbacksLast:!1,shorthandFirst:!1,shorthandLast:!1,noSortAlphabetically:!1,reservedFirst:!0}],"react/jsx-uses-react":[l?"off":"error"],"react/jsx-uses-vars":"error","react/no-danger":"warn","react/no-deprecated":["error"],"react/no-did-mount-set-state":"off","react/no-did-update-set-state":"error","react/no-will-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-is-mounted":"error","react/no-multi-comp":"off","react/no-set-state":"off","react/no-string-refs":"error","react/no-unknown-property":"error","react/prefer-es6-class":["error","always"],"react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/prop-types":["error",{ignore:[],customValidators:[],skipUndeclared:!1}],"react/react-in-jsx-scope":l?"off":"error","react/require-render-return":"error","react/self-closing-comp":"error","react/sort-default-props":["error",{ignoreCase:!0}],"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"]}}],"react/jsx-first-prop-new-line":["error","multiline-multiprop"],"react/jsx-equals-spacing":["error","never"],"react/jsx-indent":["error",s.indent[1],{checkAttributes:!0,indentLogicalExpressions:!0}],"react/jsx-no-target-blank":["error",{enforceDynamicLinks:"always"}],"react/jsx-no-comment-textnodes":"error","react/no-render-return-value":"error","react/require-optimization":["off",{allowDecorators:[]}],"react/no-find-dom-node":"error","react/forbid-component-props":["off",{forbid:[]}],"react/forbid-elements":["off",{forbid:[]}],"react/no-danger-with-children":"error","react/no-unused-prop-types":["error",{customValidators:[],skipShapeProps:!0}],"react/style-prop-object":"error","react/no-unescaped-entities":"error","react/no-children-prop":"error","react/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never",beforeClosing:"never"}],"react/jsx-space-before-closing":["off","always"],"react/no-array-index-key":"error","react/require-default-props":["error",{forbidDefaultForRequired:!0}],"react/forbid-foreign-prop-types":["warn",{allowInPropTypes:!0}],"react/void-dom-elements-no-children":"error","react/default-props-match-prop-types":["error",{allowRequiredDefaults:!1}],"react/no-redundant-should-component-update":"error","react/no-unused-state":"error","react/boolean-prop-naming":["off",{propTypeNames:["bool","mutuallyExclusiveTrueProps"],rule:"^(is|has)[A-Z]([A-Za-z0-9]?)+",message:""}],"react/jsx-curly-brace-presence":["error",{props:"never",children:"never"}],"react/jsx-one-expression-per-line":["error",{allow:"single-child"}],"react/destructuring-assignment":["error","always"],"react/no-access-state-in-setstate":"error","react/button-has-type":["error",{button:!0,submit:!0,reset:!1}],"react/jsx-child-element-spacing":"off","react/no-this-in-sfc":"error","react/jsx-max-depth":"off","react/jsx-props-no-multi-spaces":"error","react/no-unsafe":"off","react/jsx-fragments":["error","syntax"],"react/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"react/state-in-constructor":["error","always"],"react/static-property-placement":["error","property assignment"],"react/jsx-props-no-spreading":["error",{html:"enforce",custom:"enforce",explicitSpread:"ignore",exceptions:[]}],"react/prefer-read-only-props":"off","react/jsx-no-script-url":["error",[{name:"Link",props:["to"]}]],"react/jsx-no-useless-fragment":"error","react/no-adjacent-inline-elements":"error","react/function-component-definition":["error",{namedComponents:"arrow-function",unnamedComponents:"arrow-function"}],"react/jsx-newline":"off","react/jsx-no-constructed-context-values":"error",...f}},{files:["*.jsx"],rules:{"react/jsx-filename-extension":"error","react/no-typos":"error","react/jsx-closing-tag-location":"error","react/jsx-wrap-multilines":["error",{declaration:"parens-new-line",assignment:"parens-new-line",return:"parens-new-line",arrow:"parens-new-line",condition:"parens-new-line",logical:"parens-new-line",prop:"parens-new-line"}]}},{files:["*.tsx"],rules:{"react/jsx-filename-extension":"off","react/default-props-match-prop-types":"off","react/prop-types":"off"}}]},_=g;
14
+ `);var g={overrides:[{files:["*.jsx","*.tsx"],plugins:["react"],env:{browser:!0},parserOptions:{ecmaFeatures:{jsx:!0}},settings:{"import/resolver":{node:{extensions:[".js",".jsx",".json",".cjs",".mjs"]}},react:{version:e??"detect"},propWrapperFunctions:["forbidExtraProps","exact","Object.freeze"]},rules:{"no-underscore-dangle":[n[0],{...n[1],allow:[...n[1].allow,"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"]}],"jsx-quotes":["error","prefer-double"],"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"]}],"react/display-name":["off",{ignoreTranspilerName:!1}],"react/forbid-prop-types":["error",{forbid:["any","array","object"],checkContextTypes:!0,checkChildContextTypes:!0}],"react/forbid-dom-props":["off",{forbid:[]}],"react/jsx-boolean-value":["error","never",{always:[]}],"react/jsx-closing-bracket-location":["error","line-aligned"],"react/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-indent-props":["error",s.indent[1]],"react/jsx-key":"off","react/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"react/jsx-no-bind":["error",{ignoreRefs:!0,allowArrowFunctions:!0,allowFunctions:!1,allowBind:!1,ignoreDOMComponents:!0}],"react/jsx-no-duplicate-props":["error",{ignoreCase:!0}],"react/jsx-no-literals":["off",{noStrings:!0}],"react/jsx-no-undef":"error","react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/sort-prop-types":["off",{ignoreCase:!0,callbacksLast:!1,requiredFirst:!1,sortShapeProp:!0}],"react/jsx-sort-props":["off",{ignoreCase:!0,callbacksLast:!1,shorthandFirst:!1,shorthandLast:!1,noSortAlphabetically:!1,reservedFirst:!0}],"react/jsx-uses-react":[l?"off":"error"],"react/jsx-uses-vars":"error","react/no-danger":"warn","react/no-deprecated":["error"],"react/no-did-mount-set-state":"off","react/no-did-update-set-state":"error","react/no-will-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-is-mounted":"error","react/no-multi-comp":"off","react/no-set-state":"off","react/no-string-refs":"error","react/no-unknown-property":"error","react/prefer-es6-class":["error","always"],"react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/prop-types":["error",{ignore:[],customValidators:[],skipUndeclared:!1}],"react/react-in-jsx-scope":l?"off":"error","react/require-render-return":"error","react/self-closing-comp":"error","react/sort-default-props":["error",{ignoreCase:!0}],"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"]}}],"react/jsx-first-prop-new-line":["error","multiline-multiprop"],"react/jsx-equals-spacing":["error","never"],"react/jsx-indent":["error",s.indent[1],{checkAttributes:!0,indentLogicalExpressions:!0}],"react/jsx-no-target-blank":["error",{enforceDynamicLinks:"always"}],"react/jsx-no-comment-textnodes":"error","react/no-render-return-value":"error","react/require-optimization":["off",{allowDecorators:[]}],"react/no-find-dom-node":"error","react/forbid-component-props":["off",{forbid:[]}],"react/forbid-elements":["off",{forbid:[]}],"react/no-danger-with-children":"error","react/no-unused-prop-types":["error",{customValidators:[],skipShapeProps:!0}],"react/style-prop-object":"error","react/no-unescaped-entities":"error","react/no-children-prop":"error","react/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never",beforeClosing:"never"}],"react/jsx-space-before-closing":["off","always"],"react/no-array-index-key":"error","react/require-default-props":["error",{forbidDefaultForRequired:!0}],"react/forbid-foreign-prop-types":["warn",{allowInPropTypes:!0}],"react/void-dom-elements-no-children":"error","react/default-props-match-prop-types":["error",{allowRequiredDefaults:!1}],"react/no-redundant-should-component-update":"error","react/no-unused-state":"error","react/boolean-prop-naming":["off",{propTypeNames:["bool","mutuallyExclusiveTrueProps"],rule:"^(is|has)[A-Z]([A-Za-z0-9]?)+",message:""}],"react/jsx-curly-brace-presence":["error",{props:"never",children:"never"}],"react/jsx-one-expression-per-line":["error",{allow:"single-child"}],"react/destructuring-assignment":["error","always"],"react/no-access-state-in-setstate":"error","react/button-has-type":["error",{button:!0,submit:!0,reset:!1}],"react/jsx-child-element-spacing":"off","react/no-this-in-sfc":"error","react/jsx-max-depth":"off","react/jsx-props-no-multi-spaces":"error","react/no-unsafe":"off","react/jsx-fragments":["error","syntax"],"react/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"react/state-in-constructor":["error","always"],"react/static-property-placement":["error","property assignment"],"react/jsx-props-no-spreading":["error",{html:"enforce",custom:"enforce",explicitSpread:"ignore",exceptions:[]}],"react/prefer-read-only-props":"off","react/jsx-no-script-url":["error",[{name:"Link",props:["to"]}]],"react/jsx-no-useless-fragment":"error","react/no-adjacent-inline-elements":"error","react/function-component-definition":["error",{namedComponents:"arrow-function",unnamedComponents:"arrow-function"}],"react/jsx-newline":"off","react/jsx-no-constructed-context-values":"error",...f}},{files:["*.jsx"],rules:{"react/jsx-filename-extension":"error","react/no-typos":"error","react/jsx-closing-tag-location":"error","react/jsx-wrap-multilines":["error",{declaration:"parens-new-line",assignment:"parens-new-line",return:"parens-new-line",arrow:"parens-new-line",condition:"parens-new-line",logical:"parens-new-line",prop:"parens-new-line"}]}},{files:["*.tsx"],rules:{"react/jsx-filename-extension":"off","react/default-props-match-prop-types":"off","react/prop-types":"off"}}]},v=g;
16
15
 
17
- export { _ as default };
16
+ export { v as default };
18
17
  //# sourceMappingURL=out.js.map
19
18
  //# sourceMappingURL=react.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/config/plugins/react.ts"],"names":["hasAnyDep","pkg","getPackageSubProperty","findUp","env","styleRules","style_default","dangleRules","prettierReactRules","anolilabEslintConfig","hasJsxRuntime","isFile","showLog","consoleLog","reactVersion","config","react_default"],"mappings":"0FACA,OAAS,aAAAA,EAAW,OAAAC,MAAW,+BAC/B,OAAS,yBAAAC,MAA6B,mCAEtC,OAAOC,MAAY,UACnB,OAAS,OAAAC,MAAW,UAKpB,IAAMC,EAAaC,EAAY,MACzBC,EAAcF,EAAW,sBAAsB,EAEjDG,EAAqB,CAAC,EAGtBR,EAAU,CAAC,UAAU,EAAG,CACpB,SAAU,EACd,CAAC,IAEDQ,EAAqB,CACjB,kCAAmC,MACnC,q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,CAAC,CACjB,CACJ,EAIA,+BAAgC,MAIhC,0BAA2B,CACvB,QACA,CACI,CACI,KAAM,OACN,MAAO,CAAC,IAAI,CAChB,CACJ,CACJ,EAIA,gCAAiC,QAIjC,oCAAqC,QAIrC,sCAAuC,CACnC,QACA,CACI,gBAAiB,iBACjB,kBAAmB,gBACvB,CACJ,EAIA,oBAAqB,MAIrB,0CAA2C,QAE3C,GAAGG,CACP,CACJ,EACA,CACI,MAAO,CAAC,OAAO,EACf,MAAO,CAGH,+BAAgC,QAIhC,iBAAkB,QAIlB,iCAAkC,QAIlC,4BAA6B,CACzB,QACA,CAEI,YAAa,kBACb,WAAY,kBACZ,OAAQ,kBACR,MAAO,kBACP,UAAW,kBACX,QAAS,kBACT,KAAM,iBACV,CACJ,CACJ,CACJ,EACA,CACI,MAAO,CAAC,OAAO,EACf,MAAO,CAEH,+BAAgC,MAChC,uCAAwC,MACxC,mBAAoB,KACxB,CACJ,CACJ,CACJ,EAEOQ,EAAQD","sourcesContent":["// @see https://github.com/yannickcr/eslint-plugin-react\nimport { hasAnyDep, pkg } from \"@anolilab/package-json-utils\";\nimport { getPackageSubProperty } from \"@anolilab/package-json-utils/src\";\nimport type { Linter } from \"eslint\";\nimport findUp from \"find-up\";\nimport { env } from \"node:process\";\n\nimport { consoleLog } from \"../../utils/loggers\";\nimport styleConfig from \"../style\";\n\nconst styleRules = styleConfig.rules as Linter.RulesRecord;\nconst dangleRules = styleRules[\"no-underscore-dangle\"] as any[];\n\nlet prettierReactRules = {};\n\nif (\n hasAnyDep([\"prettier\"], {\n peerDeps: false,\n })\n) {\n prettierReactRules = {\n \"react/jsx-child-element-spacing\": \"off\",\n \"react/jsx-closing-bracket-location\": \"off\",\n \"react/jsx-closing-tag-location\": \"off\",\n \"react/jsx-curly-newline\": \"off\",\n \"react/jsx-curly-spacing\": \"off\",\n \"react/jsx-equals-spacing\": \"off\",\n \"react/jsx-first-prop-new-line\": \"off\",\n \"react/jsx-indent\": \"off\",\n \"react/jsx-indent-props\": \"off\",\n \"react/jsx-max-props-per-line\": \"off\",\n \"react/jsx-newline\": \"off\",\n \"react/jsx-one-expression-per-line\": \"off\",\n \"react/jsx-props-no-multi-spaces\": \"off\",\n \"react/jsx-tag-spacing\": \"off\",\n \"react/jsx-wrap-multilines\": \"off\",\n };\n}\n\nlet anolilabEslintConfig: { [key: string]: boolean | undefined } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\nconst hasJsxRuntime = (() => {\n // Workaround VS Code trying to run this file twice!\n if (!global.hasAnolilabEsLintConfigReactRuntimePath) {\n const reactPath = findUp.sync(\"node_modules/react/jsx-runtime.js\");\n const isFile = typeof reactPath === \"string\";\n\n let showLog: boolean = env[\"DISABLE_INFO_ON_DISABLING_JSX_REACT_RULE\"] !== \"true\";\n\n if (showLog && anolilabEslintConfig?.[\"info_on_disabling_jsx_react_rule\"] !== undefined) {\n showLog = anolilabEslintConfig[\"info_on_disabling_jsx_react_rule\"];\n }\n\n if (showLog && isFile) {\n consoleLog(`\\n@anolilab/eslint-config found react jsx-runtime. \\n\n Following rules are disabled: \"react/jsx-uses-react\" and \"react/react-in-jsx-scope\".\n If you dont use the new react jsx-runtime in you project, please enable it manually.\\n`);\n }\n\n global.hasAnolilabEsLintConfigReactRuntimePath = isFile;\n }\n\n return global.hasAnolilabEsLintConfigReactRuntimePath;\n})();\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call\nlet reactVersion: string | undefined = getPackageSubProperty<string>(\"dependencies\")(\"react\")\n\nif (reactVersion === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call\n reactVersion = getPackageSubProperty<string | undefined>(\"devDependencies\")(\"react\");\n}\n\nif (reactVersion !== undefined && anolilabEslintConfig?.[\"info_on_found_react_version\"] !== false) {\n consoleLog(`\\n@anolilab/eslint-config found the version ${reactVersion} of react in your dependencies, this version ${reactVersion} will be used to setup the \"eslint-plugin-react\"\\n`);\n}\n\nconst config: Linter.Config = {\n overrides: [\n {\n files: [\"*.jsx\", \"*.tsx\"],\n\n plugins: [\"react\"],\n\n env: {\n browser: true,\n },\n\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n\n settings: {\n \"import/resolver\": {\n node: {\n extensions: [\".js\", \".jsx\", \".json\", \".cjs\", \".mjs\"],\n },\n },\n react: {\n // The default value is \"detect\". Automatic detection works by loading the entire React library\n // into the linter's process, which is inefficient. It is recommended to specify the version\n // explicity.\n version: reactVersion ?? \"detect\",\n },\n propWrapperFunctions: [\n \"forbidExtraProps\", // https://www.npmjs.com/package/airbnb-prop-types\n \"exact\", // https://www.npmjs.com/package/prop-types-exact\n \"Object.freeze\", // https://tc39.github.io/ecma262/#sec-object.freeze\n ],\n },\n\n // View link below for react rules documentation\n // https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules\n rules: {\n \"no-underscore-dangle\": [\n dangleRules[0],\n {\n ...dangleRules[1],\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n allow: [...dangleRules[1].allow, \"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\"],\n },\n ],\n\n // Specify whether double or single quotes should be used in JSX attributes\n // https://eslint.org/docs/rules/jsx-quotes\n \"jsx-quotes\": [\"error\", \"prefer-double\"],\n\n \"class-methods-use-this\": [\n \"error\",\n {\n exceptMethods: [\n \"render\",\n \"getInitialState\",\n \"getDefaultProps\",\n \"getChildContext\",\n \"componentWillMount\",\n \"UNSAFE_componentWillMount\",\n \"componentDidMount\",\n \"componentWillReceiveProps\",\n \"UNSAFE_componentWillReceiveProps\",\n \"shouldComponentUpdate\",\n \"componentWillUpdate\",\n \"UNSAFE_componentWillUpdate\",\n \"componentDidUpdate\",\n \"componentWillUnmount\",\n \"componentDidCatch\",\n \"getSnapshotBeforeUpdate\",\n ],\n },\n ],\n\n // Prevent missing displayName in a React component definition\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md\n \"react/display-name\": [\"off\", { ignoreTranspilerName: false }],\n\n // Forbid certain propTypes (any, array, object)\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/forbid-prop-types.md\n \"react/forbid-prop-types\": [\n \"error\",\n {\n forbid: [\"any\", \"array\", \"object\"],\n checkContextTypes: true,\n checkChildContextTypes: true,\n },\n ],\n\n // Forbid certain props on DOM Nodes\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/forbid-dom-props.md\n \"react/forbid-dom-props\": [\"off\", { forbid: [] }],\n\n // Enforce boolean attributes notation in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md\n \"react/jsx-boolean-value\": [\"error\", \"never\", { always: [] }],\n\n // Validate closing bracket location in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md\n \"react/jsx-closing-bracket-location\": [\"error\", \"line-aligned\"],\n\n // Enforce or disallow spaces inside of curly braces in JSX attributes\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md\n \"react/jsx-curly-spacing\": [\"error\", \"never\", { allowMultiline: true }],\n\n // Enforce event handler naming conventions in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md\n \"react/jsx-handler-names\": [\n \"off\",\n {\n eventHandlerPrefix: \"handle\",\n eventHandlerPropPrefix: \"on\",\n },\n ],\n\n // Validate props indentation in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md\n \"react/jsx-indent-props\": [\"error\", (styleRules[\"indent\"] as any[])[1] as number],\n\n // Validate JSX has key prop when in array or iterator\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md\n \"react/jsx-key\": \"off\",\n\n // Limit maximum of props on a single line in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md\n \"react/jsx-max-props-per-line\": [\"error\", { maximum: 1, when: \"multiline\" }],\n\n // Prevent usage of .bind() in JSX props\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md\n \"react/jsx-no-bind\": [\n \"error\",\n {\n ignoreRefs: true,\n allowArrowFunctions: true,\n allowFunctions: false,\n allowBind: false,\n ignoreDOMComponents: true,\n },\n ],\n\n // Prevent duplicate props in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md\n \"react/jsx-no-duplicate-props\": [\"error\", { ignoreCase: true }],\n\n // Prevent usage of unwrapped JSX strings\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md\n \"react/jsx-no-literals\": [\"off\", { noStrings: true }],\n\n // Disallow undeclared variables in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md\n \"react/jsx-no-undef\": \"error\",\n\n // Enforce PascalCase for user-defined JSX components\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md\n \"react/jsx-pascal-case\": [\n \"error\",\n {\n allowAllCaps: true,\n ignore: [],\n },\n ],\n\n // Enforce propTypes declarations alphabetical sorting\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md\n \"react/sort-prop-types\": [\n \"off\",\n {\n ignoreCase: true,\n callbacksLast: false,\n requiredFirst: false,\n sortShapeProp: true,\n },\n ],\n\n // Enforce props alphabetical sorting\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md\n \"react/jsx-sort-props\": [\n \"off\",\n {\n ignoreCase: true,\n callbacksLast: false,\n shorthandFirst: false,\n shorthandLast: false,\n noSortAlphabetically: false,\n reservedFirst: true,\n },\n ],\n\n // Prevent React to be incorrectly marked as unused\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md\n \"react/jsx-uses-react\": [hasJsxRuntime ? \"off\" : \"error\"],\n\n // Prevent variables used in JSX to be incorrectly marked as unused\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md\n \"react/jsx-uses-vars\": \"error\",\n\n // Prevent usage of dangerous JSX properties\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md\n \"react/no-danger\": \"warn\",\n\n // Prevent usage of deprecated methods\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md\n \"react/no-deprecated\": [\"error\"],\n\n // Prevent usage of setState in componentDidMount\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md\n // this is necessary for server-rendering\n \"react/no-did-mount-set-state\": \"off\",\n\n // Prevent usage of setState in componentDidUpdate\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md\n \"react/no-did-update-set-state\": \"error\",\n\n // Prevent usage of setState in componentWillUpdate\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-will-update-set-state.md\n \"react/no-will-update-set-state\": \"error\",\n\n // Prevent direct mutation of this.state\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md\n \"react/no-direct-mutation-state\": \"error\",\n\n // Prevent usage of isMounted\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md\n \"react/no-is-mounted\": \"error\",\n\n // Prevent multiple component definition per file\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md\n \"react/no-multi-comp\": \"off\",\n\n // Prevent usage of setState\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md\n \"react/no-set-state\": \"off\",\n\n // Prevent using string references\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md\n \"react/no-string-refs\": \"error\",\n\n // Prevent usage of unknown DOM property\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md\n \"react/no-unknown-property\": \"error\",\n\n // Require ES6 class declarations over React.createClass\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md\n \"react/prefer-es6-class\": [\"error\", \"always\"],\n\n // Require stateless functions when not using lifecycle methods, setState or ref\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md\n \"react/prefer-stateless-function\": [\"error\", { ignorePureComponents: true }],\n\n // Prevent missing props validation in a React component definition\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md\n \"react/prop-types\": [\n \"error\",\n {\n ignore: [],\n customValidators: [],\n skipUndeclared: false,\n },\n ],\n\n // Prevent missing React when using JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md\n \"react/react-in-jsx-scope\": hasJsxRuntime ? \"off\" : \"error\",\n\n // Require render() methods to return something\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-render-return.md\n \"react/require-render-return\": \"error\",\n\n // Prevent extra closing tags for components without children\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md\n \"react/self-closing-comp\": \"error\",\n\n // Enforce defaultProps declarations alphabetical sorting\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/sort-default-props.md\n \"react/sort-default-props\": [\n \"error\",\n {\n ignoreCase: true,\n },\n ],\n\n // Enforce component methods order\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/sort-comp.md\n \"react/sort-comp\": [\n \"error\",\n {\n order: [\n \"static-variables\",\n \"static-methods\",\n \"instance-variables\",\n \"lifecycle\",\n \"/^handle.+$/\",\n \"/^on.+$/\",\n \"getters\",\n \"setters\",\n \"/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/\",\n \"instance-methods\",\n \"everything-else\",\n \"rendering\",\n ],\n groups: {\n lifecycle: [\n \"displayName\",\n \"propTypes\",\n \"contextTypes\",\n \"childContextTypes\",\n \"mixins\",\n \"statics\",\n \"defaultProps\",\n \"constructor\",\n \"getDefaultProps\",\n \"getInitialState\",\n \"state\",\n \"getChildContext\",\n \"getDerivedStateFromProps\",\n \"componentWillMount\",\n \"UNSAFE_componentWillMount\",\n \"componentDidMount\",\n \"componentWillReceiveProps\",\n \"UNSAFE_componentWillReceiveProps\",\n \"shouldComponentUpdate\",\n \"componentWillUpdate\",\n \"UNSAFE_componentWillUpdate\",\n \"getSnapshotBeforeUpdate\",\n \"componentDidUpdate\",\n \"componentDidCatch\",\n \"componentWillUnmount\",\n ],\n rendering: [\"/^render.+$/\", \"render\"],\n },\n },\n ],\n\n // Require that the first prop in a JSX element be on a new line when the element is multiline\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md\n \"react/jsx-first-prop-new-line\": [\"error\", \"multiline-multiprop\"],\n\n // Enforce spacing around jsx equals signs\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md\n \"react/jsx-equals-spacing\": [\"error\", \"never\"],\n\n // Enforce JSX indentation\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md\n \"react/jsx-indent\": [\"error\", (styleRules[\"indent\"] as any[])[1] as number, { checkAttributes: true, indentLogicalExpressions: true }],\n\n // Disallow target=\"_blank\" on links\n // https://github.com/yannickcr/eslint-plugin-react/blob/ac102885765be5ff37847a871f239c6703e1c7cc/docs/rules/jsx-no-target-blank.md\n \"react/jsx-no-target-blank\": [\"error\", { enforceDynamicLinks: \"always\" }],\n\n // prevent accidental JS comments from being injected into JSX as text\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md\n \"react/jsx-no-comment-textnodes\": \"error\",\n\n // disallow using React.render/ReactDOM.render's return value\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md\n \"react/no-render-return-value\": \"error\",\n\n // require a shouldComponentUpdate method, or PureRenderMixin\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-optimization.md\n \"react/require-optimization\": [\"off\", { allowDecorators: [] }],\n\n // warn against using findDOMNode()\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md\n \"react/no-find-dom-node\": \"error\",\n\n // Forbid certain props on Components\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md\n \"react/forbid-component-props\": [\"off\", { forbid: [] }],\n\n // Forbid certain elements\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-elements.md\n \"react/forbid-elements\": [\"off\", { forbid: [] }],\n\n // Prevent problem with children and props.dangerouslySetInnerHTML\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md\n \"react/no-danger-with-children\": \"error\",\n\n // Prevent unused propType definitions\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md\n \"react/no-unused-prop-types\": [\n \"error\",\n {\n customValidators: [],\n skipShapeProps: true,\n },\n ],\n\n // Require style prop value be an object or var\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md\n \"react/style-prop-object\": \"error\",\n\n // Prevent invalid characters from appearing in markup\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md\n \"react/no-unescaped-entities\": \"error\",\n\n // Prevent passing of children as props\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md\n \"react/no-children-prop\": \"error\",\n\n // Validate whitespace in and around the JSX opening and closing brackets\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-tag-spacing.md\n \"react/jsx-tag-spacing\": [\n \"error\",\n {\n closingSlash: \"never\",\n beforeSelfClosing: \"always\",\n afterOpening: \"never\",\n beforeClosing: \"never\",\n },\n ],\n\n // Enforce spaces before the closing bracket of self-closing JSX elements\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-space-before-closing.md\n // Deprecated in favor of jsx-tag-spacing\n \"react/jsx-space-before-closing\": [\"off\", \"always\"],\n\n // Prevent usage of Array index in keys\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md\n \"react/no-array-index-key\": \"error\",\n\n // Enforce a defaultProps definition for every prop that is not a required prop\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/require-default-props.md\n \"react/require-default-props\": [\n \"error\",\n {\n forbidDefaultForRequired: true,\n },\n ],\n\n // Forbids using non-exported propTypes\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-foreign-prop-types.md\n // this is intentionally set to \"warn\". it would be \"error\",\n // but it's only critical if you're stripping propTypes in production.\n \"react/forbid-foreign-prop-types\": [\"warn\", { allowInPropTypes: true }],\n\n // Prevent void DOM elements from receiving children\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md\n \"react/void-dom-elements-no-children\": \"error\",\n\n // Enforce all defaultProps have a corresponding non-required PropType\n // https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/default-props-match-prop-types.md\n \"react/default-props-match-prop-types\": [\"error\", { allowRequiredDefaults: false }],\n\n // Prevent usage of shouldComponentUpdate when extending React.PureComponent\n // https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/no-redundant-should-component-update.md\n \"react/no-redundant-should-component-update\": \"error\",\n\n // Prevent unused state values\n // https://github.com/yannickcr/eslint-plugin-react/pull/1103/\n \"react/no-unused-state\": \"error\",\n\n // Enforces consistent naming for boolean props\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/boolean-prop-naming.md\n \"react/boolean-prop-naming\": [\n \"off\",\n {\n propTypeNames: [\"bool\", \"mutuallyExclusiveTrueProps\"],\n rule: \"^(is|has)[A-Z]([A-Za-z0-9]?)+\",\n message: \"\",\n },\n ],\n\n // Enforce curly braces or disallow unnecessary curly braces in JSX props and/or children\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md\n \"react/jsx-curly-brace-presence\": [\"error\", { props: \"never\", children: \"never\" }],\n\n // One JSX Element Per Line\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-one-expression-per-line.md\n \"react/jsx-one-expression-per-line\": [\"error\", { allow: \"single-child\" }],\n\n // Enforce consistent usage of destructuring assignment of props, state, and context\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/destructuring-assignment.md\n \"react/destructuring-assignment\": [\"error\", \"always\"],\n\n // Prevent using this.state within a this.setState\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/no-access-state-in-setstate.md\n \"react/no-access-state-in-setstate\": \"error\",\n\n // Prevent usage of button elements without an explicit type attribute\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/button-has-type.md\n \"react/button-has-type\": [\n \"error\",\n {\n button: true,\n submit: true,\n reset: false,\n },\n ],\n\n // Ensures inline tags are not rendered without spaces between them\n \"react/jsx-child-element-spacing\": \"off\",\n\n // Prevent this from being used in stateless functional components\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/no-this-in-sfc.md\n \"react/no-this-in-sfc\": \"error\",\n\n // Validate JSX maximum depth\n // https://github.com/yannickcr/eslint-plugin-react/blob/abe8381c0d6748047224c430ce47f02e40160ed0/docs/rules/jsx-max-depth.md\n \"react/jsx-max-depth\": \"off\",\n\n // Disallow multiple spaces between inline JSX props\n // https://github.com/yannickcr/eslint-plugin-react/blob/ac102885765be5ff37847a871f239c6703e1c7cc/docs/rules/jsx-props-no-multi-spaces.md\n \"react/jsx-props-no-multi-spaces\": \"error\",\n\n // Prevent usage of UNSAFE_ methods\n // https://github.com/yannickcr/eslint-plugin-react/blob/157cc932be2cfaa56b3f5b45df6f6d4322a2f660/docs/rules/no-unsafe.md\n \"react/no-unsafe\": \"off\",\n\n // Enforce shorthand or standard form for React fragments\n // https://github.com/yannickcr/eslint-plugin-react/blob/bc976b837abeab1dffd90ac6168b746a83fc83cc/docs/rules/jsx-fragments.md\n \"react/jsx-fragments\": [\"error\", \"syntax\"],\n\n // Enforce linebreaks in curly braces in JSX attributes and expressions.\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md\n \"react/jsx-curly-newline\": [\n \"error\",\n {\n multiline: \"consistent\",\n singleline: \"consistent\",\n },\n ],\n\n // Enforce state initialization style\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md\n // TODO: set to \"never\" once @anolilab/babel-preset supports public class fields\n \"react/state-in-constructor\": [\"error\", \"always\"],\n\n // Enforces where React component static properties should be positioned\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md\n // TODO: set to \"static public field\" once @anolilab/babel-preset supports public class fields\n \"react/static-property-placement\": [\"error\", \"property assignment\"],\n\n // Disallow JSX props spreading\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md\n \"react/jsx-props-no-spreading\": [\n \"error\",\n {\n html: \"enforce\",\n custom: \"enforce\",\n explicitSpread: \"ignore\",\n exceptions: [],\n },\n ],\n\n // Enforce that props are read-only\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md\n \"react/prefer-read-only-props\": \"off\",\n\n // Prevent usage of `javascript:` URLs\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md\n \"react/jsx-no-script-url\": [\n \"error\",\n [\n {\n name: \"Link\",\n props: [\"to\"],\n },\n ],\n ],\n\n // Disallow unnecessary fragments\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md\n \"react/jsx-no-useless-fragment\": \"error\",\n\n // Prevent adjacent inline elements not separated by whitespace\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md\n \"react/no-adjacent-inline-elements\": \"error\",\n\n // Enforce a specific function type for function components\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md\n \"react/function-component-definition\": [\n \"error\",\n {\n namedComponents: \"arrow-function\",\n unnamedComponents: \"arrow-function\",\n },\n ],\n\n // Enforce a new line after jsx elements and expressions\n // https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-newline.md\n \"react/jsx-newline\": \"off\",\n\n // Prevent react contexts from taking non-stable values\n // https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-no-constructed-context-values.md\n \"react/jsx-no-constructed-context-values\": \"error\",\n\n ...prettierReactRules,\n },\n },\n {\n files: [\"*.jsx\"],\n rules: {\n // only .jsx files may have JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md\n \"react/jsx-filename-extension\": \"error\",\n\n // Prevents common casing typos\n // https://github.com/yannickcr/eslint-plugin-react/blob/73abadb697034b5ccb514d79fb4689836fe61f91/docs/rules/no-typos.md\n \"react/no-typos\": \"error\",\n\n // Validate closing tag location in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md\n \"react/jsx-closing-tag-location\": \"error\",\n\n // Prevent missing parentheses around multilines JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-wrap-multilines.md\n \"react/jsx-wrap-multilines\": [\n \"error\",\n {\n // eslint-disable-next-line sonarjs/no-duplicate-string\n declaration: \"parens-new-line\",\n assignment: \"parens-new-line\",\n return: \"parens-new-line\",\n arrow: \"parens-new-line\",\n condition: \"parens-new-line\",\n logical: \"parens-new-line\",\n prop: \"parens-new-line\",\n },\n ],\n },\n },\n {\n files: [\"*.tsx\"],\n rules: {\n // Disable JS specific rules\n \"react/jsx-filename-extension\": \"off\",\n \"react/default-props-match-prop-types\": \"off\",\n \"react/prop-types\": \"off\",\n },\n },\n ],\n};\n\nexport default config;\n"]}
1
+ {"version":3,"sources":["../../../src/config/plugins/react.ts"],"names":["getPackageSubProperty","hasAnyDep","pkg","findUp","env","styleRules","style_default","dangleRules","prettierReactRules","anolilabEslintConfig","hasJsxRuntime","isFile","showLog","consoleLog","reactVersion","config","react_default"],"mappings":"0FACA,OAAS,yBAAAA,EAAsB,aAAAC,EAAW,OAAAC,MAAW,+BAErD,OAAOC,MAAY,UACnB,OAAS,OAAAC,MAAW,UAKpB,IAAMC,EAAaC,EAAY,MACzBC,EAAcF,EAAW,sBAAsB,EAEjDG,EAAqB,CAAC,EAGtBP,EAAU,CAAC,UAAU,EAAG,CACpB,SAAU,EACd,CAAC,IAEDO,EAAqB,CACjB,kCAAmC,MACnC,qCAAsC,MACtC,iCAAkC,MAClC,0BAA2B,MAC3B,0BAA2B,MAC3B,2BAA4B,MAC5B,gCAAiC,MACjC,mBAAoB,MACpB,yBAA0B,MAC1B,+BAAgC,MAChC,oBAAqB,MACrB,oCAAqC,MACrC,kCAAmC,MACnC,wBAAyB,MACzB,4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AmB,gBACvB,CACJ,EAIA,oBAAqB,MAIrB,0CAA2C,QAE3C,GAAGG,CACP,CACJ,EACA,CACI,MAAO,CAAC,OAAO,EACf,MAAO,CAGH,+BAAgC,QAIhC,iBAAkB,QAIlB,iCAAkC,QAIlC,4BAA6B,CACzB,QACA,CAEI,YAAa,kBACb,WAAY,kBACZ,OAAQ,kBACR,MAAO,kBACP,UAAW,kBACX,QAAS,kBACT,KAAM,iBACV,CACJ,CACJ,CACJ,EACA,CACI,MAAO,CAAC,OAAO,EACf,MAAO,CAEH,+BAAgC,MAChC,uCAAwC,MACxC,mBAAoB,KACxB,CACJ,CACJ,CACJ,EAEOQ,EAAQD","sourcesContent":["// @see https://github.com/yannickcr/eslint-plugin-react\nimport { getPackageSubProperty,hasAnyDep, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\nimport findUp from \"find-up\";\nimport { env } from \"node:process\";\n\nimport { consoleLog } from \"../../utils/loggers\";\nimport styleConfig from \"../style\";\n\nconst styleRules = styleConfig.rules as Linter.RulesRecord;\nconst dangleRules = styleRules[\"no-underscore-dangle\"] as any[];\n\nlet prettierReactRules = {};\n\nif (\n hasAnyDep([\"prettier\"], {\n peerDeps: false,\n })\n) {\n prettierReactRules = {\n \"react/jsx-child-element-spacing\": \"off\",\n \"react/jsx-closing-bracket-location\": \"off\",\n \"react/jsx-closing-tag-location\": \"off\",\n \"react/jsx-curly-newline\": \"off\",\n \"react/jsx-curly-spacing\": \"off\",\n \"react/jsx-equals-spacing\": \"off\",\n \"react/jsx-first-prop-new-line\": \"off\",\n \"react/jsx-indent\": \"off\",\n \"react/jsx-indent-props\": \"off\",\n \"react/jsx-max-props-per-line\": \"off\",\n \"react/jsx-newline\": \"off\",\n \"react/jsx-one-expression-per-line\": \"off\",\n \"react/jsx-props-no-multi-spaces\": \"off\",\n \"react/jsx-tag-spacing\": \"off\",\n \"react/jsx-wrap-multilines\": \"off\",\n };\n}\n\nlet anolilabEslintConfig: { [key: string]: boolean | undefined } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\nconst hasJsxRuntime = (() => {\n // Workaround VS Code trying to run this file twice!\n if (!global.hasAnolilabEsLintConfigReactRuntimePath) {\n const reactPath = findUp.sync(\"node_modules/react/jsx-runtime.js\");\n const isFile = typeof reactPath === \"string\";\n\n let showLog: boolean = env[\"DISABLE_INFO_ON_DISABLING_JSX_REACT_RULE\"] !== \"true\";\n\n if (showLog && anolilabEslintConfig?.[\"info_on_disabling_jsx_react_rule\"] !== undefined) {\n showLog = anolilabEslintConfig[\"info_on_disabling_jsx_react_rule\"];\n }\n\n if (showLog && isFile) {\n consoleLog(`\\n@anolilab/eslint-config found react jsx-runtime. \\n\n Following rules are disabled: \"react/jsx-uses-react\" and \"react/react-in-jsx-scope\".\n If you dont use the new react jsx-runtime in you project, please enable it manually.\\n`);\n }\n\n global.hasAnolilabEsLintConfigReactRuntimePath = isFile;\n }\n\n return global.hasAnolilabEsLintConfigReactRuntimePath;\n})();\n\nlet reactVersion: string | undefined = getPackageSubProperty<string>(\"dependencies\")(\"react\")\n\nif (reactVersion === undefined) {\n reactVersion = getPackageSubProperty<string | undefined>(\"devDependencies\")(\"react\");\n}\n\nif (reactVersion !== undefined && anolilabEslintConfig?.[\"info_on_found_react_version\"] !== false) {\n consoleLog(`\\n@anolilab/eslint-config found the version ${reactVersion} of react in your dependencies, this version ${reactVersion} will be used to setup the \"eslint-plugin-react\"\\n`);\n}\n\nconst config: Linter.Config = {\n overrides: [\n {\n files: [\"*.jsx\", \"*.tsx\"],\n\n plugins: [\"react\"],\n\n env: {\n browser: true,\n },\n\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n\n settings: {\n \"import/resolver\": {\n node: {\n extensions: [\".js\", \".jsx\", \".json\", \".cjs\", \".mjs\"],\n },\n },\n react: {\n // The default value is \"detect\". Automatic detection works by loading the entire React library\n // into the linter's process, which is inefficient. It is recommended to specify the version\n // explicity.\n version: reactVersion ?? \"detect\",\n },\n propWrapperFunctions: [\n \"forbidExtraProps\", // https://www.npmjs.com/package/airbnb-prop-types\n \"exact\", // https://www.npmjs.com/package/prop-types-exact\n \"Object.freeze\", // https://tc39.github.io/ecma262/#sec-object.freeze\n ],\n },\n\n // View link below for react rules documentation\n // https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules\n rules: {\n \"no-underscore-dangle\": [\n dangleRules[0],\n {\n ...dangleRules[1],\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n allow: [...dangleRules[1].allow, \"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\"],\n },\n ],\n\n // Specify whether double or single quotes should be used in JSX attributes\n // https://eslint.org/docs/rules/jsx-quotes\n \"jsx-quotes\": [\"error\", \"prefer-double\"],\n\n \"class-methods-use-this\": [\n \"error\",\n {\n exceptMethods: [\n \"render\",\n \"getInitialState\",\n \"getDefaultProps\",\n \"getChildContext\",\n \"componentWillMount\",\n \"UNSAFE_componentWillMount\",\n \"componentDidMount\",\n \"componentWillReceiveProps\",\n \"UNSAFE_componentWillReceiveProps\",\n \"shouldComponentUpdate\",\n \"componentWillUpdate\",\n \"UNSAFE_componentWillUpdate\",\n \"componentDidUpdate\",\n \"componentWillUnmount\",\n \"componentDidCatch\",\n \"getSnapshotBeforeUpdate\",\n ],\n },\n ],\n\n // Prevent missing displayName in a React component definition\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md\n \"react/display-name\": [\"off\", { ignoreTranspilerName: false }],\n\n // Forbid certain propTypes (any, array, object)\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/forbid-prop-types.md\n \"react/forbid-prop-types\": [\n \"error\",\n {\n forbid: [\"any\", \"array\", \"object\"],\n checkContextTypes: true,\n checkChildContextTypes: true,\n },\n ],\n\n // Forbid certain props on DOM Nodes\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/forbid-dom-props.md\n \"react/forbid-dom-props\": [\"off\", { forbid: [] }],\n\n // Enforce boolean attributes notation in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md\n \"react/jsx-boolean-value\": [\"error\", \"never\", { always: [] }],\n\n // Validate closing bracket location in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md\n \"react/jsx-closing-bracket-location\": [\"error\", \"line-aligned\"],\n\n // Enforce or disallow spaces inside of curly braces in JSX attributes\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md\n \"react/jsx-curly-spacing\": [\"error\", \"never\", { allowMultiline: true }],\n\n // Enforce event handler naming conventions in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md\n \"react/jsx-handler-names\": [\n \"off\",\n {\n eventHandlerPrefix: \"handle\",\n eventHandlerPropPrefix: \"on\",\n },\n ],\n\n // Validate props indentation in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md\n \"react/jsx-indent-props\": [\"error\", (styleRules[\"indent\"] as any[])[1] as number],\n\n // Validate JSX has key prop when in array or iterator\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md\n \"react/jsx-key\": \"off\",\n\n // Limit maximum of props on a single line in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md\n \"react/jsx-max-props-per-line\": [\"error\", { maximum: 1, when: \"multiline\" }],\n\n // Prevent usage of .bind() in JSX props\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md\n \"react/jsx-no-bind\": [\n \"error\",\n {\n ignoreRefs: true,\n allowArrowFunctions: true,\n allowFunctions: false,\n allowBind: false,\n ignoreDOMComponents: true,\n },\n ],\n\n // Prevent duplicate props in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md\n \"react/jsx-no-duplicate-props\": [\"error\", { ignoreCase: true }],\n\n // Prevent usage of unwrapped JSX strings\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md\n \"react/jsx-no-literals\": [\"off\", { noStrings: true }],\n\n // Disallow undeclared variables in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md\n \"react/jsx-no-undef\": \"error\",\n\n // Enforce PascalCase for user-defined JSX components\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md\n \"react/jsx-pascal-case\": [\n \"error\",\n {\n allowAllCaps: true,\n ignore: [],\n },\n ],\n\n // Enforce propTypes declarations alphabetical sorting\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md\n \"react/sort-prop-types\": [\n \"off\",\n {\n ignoreCase: true,\n callbacksLast: false,\n requiredFirst: false,\n sortShapeProp: true,\n },\n ],\n\n // Enforce props alphabetical sorting\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md\n \"react/jsx-sort-props\": [\n \"off\",\n {\n ignoreCase: true,\n callbacksLast: false,\n shorthandFirst: false,\n shorthandLast: false,\n noSortAlphabetically: false,\n reservedFirst: true,\n },\n ],\n\n // Prevent React to be incorrectly marked as unused\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md\n \"react/jsx-uses-react\": [hasJsxRuntime ? \"off\" : \"error\"],\n\n // Prevent variables used in JSX to be incorrectly marked as unused\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md\n \"react/jsx-uses-vars\": \"error\",\n\n // Prevent usage of dangerous JSX properties\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md\n \"react/no-danger\": \"warn\",\n\n // Prevent usage of deprecated methods\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md\n \"react/no-deprecated\": [\"error\"],\n\n // Prevent usage of setState in componentDidMount\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md\n // this is necessary for server-rendering\n \"react/no-did-mount-set-state\": \"off\",\n\n // Prevent usage of setState in componentDidUpdate\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md\n \"react/no-did-update-set-state\": \"error\",\n\n // Prevent usage of setState in componentWillUpdate\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-will-update-set-state.md\n \"react/no-will-update-set-state\": \"error\",\n\n // Prevent direct mutation of this.state\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md\n \"react/no-direct-mutation-state\": \"error\",\n\n // Prevent usage of isMounted\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md\n \"react/no-is-mounted\": \"error\",\n\n // Prevent multiple component definition per file\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md\n \"react/no-multi-comp\": \"off\",\n\n // Prevent usage of setState\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md\n \"react/no-set-state\": \"off\",\n\n // Prevent using string references\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md\n \"react/no-string-refs\": \"error\",\n\n // Prevent usage of unknown DOM property\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md\n \"react/no-unknown-property\": \"error\",\n\n // Require ES6 class declarations over React.createClass\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md\n \"react/prefer-es6-class\": [\"error\", \"always\"],\n\n // Require stateless functions when not using lifecycle methods, setState or ref\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md\n \"react/prefer-stateless-function\": [\"error\", { ignorePureComponents: true }],\n\n // Prevent missing props validation in a React component definition\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md\n \"react/prop-types\": [\n \"error\",\n {\n ignore: [],\n customValidators: [],\n skipUndeclared: false,\n },\n ],\n\n // Prevent missing React when using JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md\n \"react/react-in-jsx-scope\": hasJsxRuntime ? \"off\" : \"error\",\n\n // Require render() methods to return something\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-render-return.md\n \"react/require-render-return\": \"error\",\n\n // Prevent extra closing tags for components without children\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md\n \"react/self-closing-comp\": \"error\",\n\n // Enforce defaultProps declarations alphabetical sorting\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/sort-default-props.md\n \"react/sort-default-props\": [\n \"error\",\n {\n ignoreCase: true,\n },\n ],\n\n // Enforce component methods order\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/sort-comp.md\n \"react/sort-comp\": [\n \"error\",\n {\n order: [\n \"static-variables\",\n \"static-methods\",\n \"instance-variables\",\n \"lifecycle\",\n \"/^handle.+$/\",\n \"/^on.+$/\",\n \"getters\",\n \"setters\",\n \"/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/\",\n \"instance-methods\",\n \"everything-else\",\n \"rendering\",\n ],\n groups: {\n lifecycle: [\n \"displayName\",\n \"propTypes\",\n \"contextTypes\",\n \"childContextTypes\",\n \"mixins\",\n \"statics\",\n \"defaultProps\",\n \"constructor\",\n \"getDefaultProps\",\n \"getInitialState\",\n \"state\",\n \"getChildContext\",\n \"getDerivedStateFromProps\",\n \"componentWillMount\",\n \"UNSAFE_componentWillMount\",\n \"componentDidMount\",\n \"componentWillReceiveProps\",\n \"UNSAFE_componentWillReceiveProps\",\n \"shouldComponentUpdate\",\n \"componentWillUpdate\",\n \"UNSAFE_componentWillUpdate\",\n \"getSnapshotBeforeUpdate\",\n \"componentDidUpdate\",\n \"componentDidCatch\",\n \"componentWillUnmount\",\n ],\n rendering: [\"/^render.+$/\", \"render\"],\n },\n },\n ],\n\n // Require that the first prop in a JSX element be on a new line when the element is multiline\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md\n \"react/jsx-first-prop-new-line\": [\"error\", \"multiline-multiprop\"],\n\n // Enforce spacing around jsx equals signs\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md\n \"react/jsx-equals-spacing\": [\"error\", \"never\"],\n\n // Enforce JSX indentation\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md\n \"react/jsx-indent\": [\"error\", (styleRules[\"indent\"] as any[])[1] as number, { checkAttributes: true, indentLogicalExpressions: true }],\n\n // Disallow target=\"_blank\" on links\n // https://github.com/yannickcr/eslint-plugin-react/blob/ac102885765be5ff37847a871f239c6703e1c7cc/docs/rules/jsx-no-target-blank.md\n \"react/jsx-no-target-blank\": [\"error\", { enforceDynamicLinks: \"always\" }],\n\n // prevent accidental JS comments from being injected into JSX as text\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md\n \"react/jsx-no-comment-textnodes\": \"error\",\n\n // disallow using React.render/ReactDOM.render's return value\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md\n \"react/no-render-return-value\": \"error\",\n\n // require a shouldComponentUpdate method, or PureRenderMixin\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-optimization.md\n \"react/require-optimization\": [\"off\", { allowDecorators: [] }],\n\n // warn against using findDOMNode()\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md\n \"react/no-find-dom-node\": \"error\",\n\n // Forbid certain props on Components\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md\n \"react/forbid-component-props\": [\"off\", { forbid: [] }],\n\n // Forbid certain elements\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-elements.md\n \"react/forbid-elements\": [\"off\", { forbid: [] }],\n\n // Prevent problem with children and props.dangerouslySetInnerHTML\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md\n \"react/no-danger-with-children\": \"error\",\n\n // Prevent unused propType definitions\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md\n \"react/no-unused-prop-types\": [\n \"error\",\n {\n customValidators: [],\n skipShapeProps: true,\n },\n ],\n\n // Require style prop value be an object or var\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md\n \"react/style-prop-object\": \"error\",\n\n // Prevent invalid characters from appearing in markup\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md\n \"react/no-unescaped-entities\": \"error\",\n\n // Prevent passing of children as props\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md\n \"react/no-children-prop\": \"error\",\n\n // Validate whitespace in and around the JSX opening and closing brackets\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-tag-spacing.md\n \"react/jsx-tag-spacing\": [\n \"error\",\n {\n closingSlash: \"never\",\n beforeSelfClosing: \"always\",\n afterOpening: \"never\",\n beforeClosing: \"never\",\n },\n ],\n\n // Enforce spaces before the closing bracket of self-closing JSX elements\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-space-before-closing.md\n // Deprecated in favor of jsx-tag-spacing\n \"react/jsx-space-before-closing\": [\"off\", \"always\"],\n\n // Prevent usage of Array index in keys\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md\n \"react/no-array-index-key\": \"error\",\n\n // Enforce a defaultProps definition for every prop that is not a required prop\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/require-default-props.md\n \"react/require-default-props\": [\n \"error\",\n {\n forbidDefaultForRequired: true,\n },\n ],\n\n // Forbids using non-exported propTypes\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-foreign-prop-types.md\n // this is intentionally set to \"warn\". it would be \"error\",\n // but it's only critical if you're stripping propTypes in production.\n \"react/forbid-foreign-prop-types\": [\"warn\", { allowInPropTypes: true }],\n\n // Prevent void DOM elements from receiving children\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md\n \"react/void-dom-elements-no-children\": \"error\",\n\n // Enforce all defaultProps have a corresponding non-required PropType\n // https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/default-props-match-prop-types.md\n \"react/default-props-match-prop-types\": [\"error\", { allowRequiredDefaults: false }],\n\n // Prevent usage of shouldComponentUpdate when extending React.PureComponent\n // https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/no-redundant-should-component-update.md\n \"react/no-redundant-should-component-update\": \"error\",\n\n // Prevent unused state values\n // https://github.com/yannickcr/eslint-plugin-react/pull/1103/\n \"react/no-unused-state\": \"error\",\n\n // Enforces consistent naming for boolean props\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/boolean-prop-naming.md\n \"react/boolean-prop-naming\": [\n \"off\",\n {\n propTypeNames: [\"bool\", \"mutuallyExclusiveTrueProps\"],\n rule: \"^(is|has)[A-Z]([A-Za-z0-9]?)+\",\n message: \"\",\n },\n ],\n\n // Enforce curly braces or disallow unnecessary curly braces in JSX props and/or children\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md\n \"react/jsx-curly-brace-presence\": [\"error\", { props: \"never\", children: \"never\" }],\n\n // One JSX Element Per Line\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-one-expression-per-line.md\n \"react/jsx-one-expression-per-line\": [\"error\", { allow: \"single-child\" }],\n\n // Enforce consistent usage of destructuring assignment of props, state, and context\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/destructuring-assignment.md\n \"react/destructuring-assignment\": [\"error\", \"always\"],\n\n // Prevent using this.state within a this.setState\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/no-access-state-in-setstate.md\n \"react/no-access-state-in-setstate\": \"error\",\n\n // Prevent usage of button elements without an explicit type attribute\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/button-has-type.md\n \"react/button-has-type\": [\n \"error\",\n {\n button: true,\n submit: true,\n reset: false,\n },\n ],\n\n // Ensures inline tags are not rendered without spaces between them\n \"react/jsx-child-element-spacing\": \"off\",\n\n // Prevent this from being used in stateless functional components\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/no-this-in-sfc.md\n \"react/no-this-in-sfc\": \"error\",\n\n // Validate JSX maximum depth\n // https://github.com/yannickcr/eslint-plugin-react/blob/abe8381c0d6748047224c430ce47f02e40160ed0/docs/rules/jsx-max-depth.md\n \"react/jsx-max-depth\": \"off\",\n\n // Disallow multiple spaces between inline JSX props\n // https://github.com/yannickcr/eslint-plugin-react/blob/ac102885765be5ff37847a871f239c6703e1c7cc/docs/rules/jsx-props-no-multi-spaces.md\n \"react/jsx-props-no-multi-spaces\": \"error\",\n\n // Prevent usage of UNSAFE_ methods\n // https://github.com/yannickcr/eslint-plugin-react/blob/157cc932be2cfaa56b3f5b45df6f6d4322a2f660/docs/rules/no-unsafe.md\n \"react/no-unsafe\": \"off\",\n\n // Enforce shorthand or standard form for React fragments\n // https://github.com/yannickcr/eslint-plugin-react/blob/bc976b837abeab1dffd90ac6168b746a83fc83cc/docs/rules/jsx-fragments.md\n \"react/jsx-fragments\": [\"error\", \"syntax\"],\n\n // Enforce linebreaks in curly braces in JSX attributes and expressions.\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md\n \"react/jsx-curly-newline\": [\n \"error\",\n {\n multiline: \"consistent\",\n singleline: \"consistent\",\n },\n ],\n\n // Enforce state initialization style\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md\n // TODO: set to \"never\" once @anolilab/babel-preset supports public class fields\n \"react/state-in-constructor\": [\"error\", \"always\"],\n\n // Enforces where React component static properties should be positioned\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md\n // TODO: set to \"static public field\" once @anolilab/babel-preset supports public class fields\n \"react/static-property-placement\": [\"error\", \"property assignment\"],\n\n // Disallow JSX props spreading\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md\n \"react/jsx-props-no-spreading\": [\n \"error\",\n {\n html: \"enforce\",\n custom: \"enforce\",\n explicitSpread: \"ignore\",\n exceptions: [],\n },\n ],\n\n // Enforce that props are read-only\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md\n \"react/prefer-read-only-props\": \"off\",\n\n // Prevent usage of `javascript:` URLs\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md\n \"react/jsx-no-script-url\": [\n \"error\",\n [\n {\n name: \"Link\",\n props: [\"to\"],\n },\n ],\n ],\n\n // Disallow unnecessary fragments\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md\n \"react/jsx-no-useless-fragment\": \"error\",\n\n // Prevent adjacent inline elements not separated by whitespace\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md\n \"react/no-adjacent-inline-elements\": \"error\",\n\n // Enforce a specific function type for function components\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md\n \"react/function-component-definition\": [\n \"error\",\n {\n namedComponents: \"arrow-function\",\n unnamedComponents: \"arrow-function\",\n },\n ],\n\n // Enforce a new line after jsx elements and expressions\n // https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-newline.md\n \"react/jsx-newline\": \"off\",\n\n // Prevent react contexts from taking non-stable values\n // https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-no-constructed-context-values.md\n \"react/jsx-no-constructed-context-values\": \"error\",\n\n ...prettierReactRules,\n },\n },\n {\n files: [\"*.jsx\"],\n rules: {\n // only .jsx files may have JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md\n \"react/jsx-filename-extension\": \"error\",\n\n // Prevents common casing typos\n // https://github.com/yannickcr/eslint-plugin-react/blob/73abadb697034b5ccb514d79fb4689836fe61f91/docs/rules/no-typos.md\n \"react/no-typos\": \"error\",\n\n // Validate closing tag location in JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md\n \"react/jsx-closing-tag-location\": \"error\",\n\n // Prevent missing parentheses around multilines JSX\n // https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-wrap-multilines.md\n \"react/jsx-wrap-multilines\": [\n \"error\",\n {\n // eslint-disable-next-line sonarjs/no-duplicate-string\n declaration: \"parens-new-line\",\n assignment: \"parens-new-line\",\n return: \"parens-new-line\",\n arrow: \"parens-new-line\",\n condition: \"parens-new-line\",\n logical: \"parens-new-line\",\n prop: \"parens-new-line\",\n },\n ],\n },\n },\n {\n files: [\"*.tsx\"],\n rules: {\n // Disable JS specific rules\n \"react/jsx-filename-extension\": \"off\",\n \"react/default-props-match-prop-types\": \"off\",\n \"react/prop-types\": \"off\",\n },\n },\n ],\n};\n\nexport default config;\n"]}
@@ -3,7 +3,7 @@
3
3
  var chunkYMWD4DNM_js = require('../../chunk-YMWD4DNM.js');
4
4
  var packageJsonUtils = require('@anolilab/package-json-utils');
5
5
 
6
- var e="dom";packageJsonUtils.hasAnyDep(["react"])&&(e="react");var r={};packageJsonUtils.pkg&&(r=packageJsonUtils.pkg?.anolilab?.["eslint-config"]);global.hasAnolilabEsLintTestConfigLoaded||(r?.info_on_testing_library_framework!==!1&&chunkYMWD4DNM_js.a(`testing-library: loading "${e}" ruleset`),global.hasAnolilabEsLintTestConfigLoaded=!0);var o={extends:[`plugin:testing-library/${e}`],rules:{"testing-library/await-fire-event":"off","testing-library/consistent-data-testid":"off","testing-library/no-debug":"off","testing-library/no-dom-import":"off","testing-library/no-manual-cleanup":"off","testing-library/no-render-in-setup":"off","testing-library/no-await-sync-events":"off","testing-library/no-wait-for-empty-callback":"off","testing-library/no-wait-for-snapshot":"off","testing-library/prefer-explicit-assert":"off","testing-library/prefer-presence-queries":"off","testing-library/prefer-screen-queries":"off","testing-library/prefer-wait-for":"off"}},l=o;
6
+ var r={};packageJsonUtils.pkg&&(r=packageJsonUtils.pkg?.anolilab?.["eslint-config"]);var e="dom";packageJsonUtils.hasAnyDep(["react","@testing-library/react"])&&(e="react");global.hasAnolilabEsLintTestConfigLoaded||(r?.info_on_testing_library_framework!==!1&&chunkYMWD4DNM_js.a(`testing-library: loading "${e}" ruleset`),global.hasAnolilabEsLintTestConfigLoaded=!0);var o={extends:[`plugin:testing-library/${e}`],rules:{"testing-library/await-fire-event":"off","testing-library/consistent-data-testid":"off","testing-library/no-debug":"off","testing-library/no-dom-import":"off","testing-library/no-manual-cleanup":"off","testing-library/no-render-in-setup":"off","testing-library/no-await-sync-events":"off","testing-library/no-wait-for-empty-callback":"off","testing-library/no-wait-for-snapshot":"off","testing-library/prefer-explicit-assert":"off","testing-library/prefer-presence-queries":"off","testing-library/prefer-screen-queries":"off","testing-library/prefer-wait-for":"off"}},l=o;
7
7
 
8
8
  module.exports = l;
9
9
  //# sourceMappingURL=out.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/config/plugins/testing-library.ts"],"names":["hasAnyDep","pkg","ruleset","anolilabEslintConfig","consolePlugin","config","testing_library_default"],"mappings":"4CAAA,OAAS,aAAAA,EAAW,OAAAC,MAAW,+BAK/B,IAAIC,EAAU,MAEVF,EAAU,CAAC,OAAO,CAAC,IACnBE,EAAU,SAGd,IAAIC,EAA+D,CAAC,EAEhEF,IAEAE,EAAuBF,GAAM,WAAc,eAAe,GAIzD,OAAO,oCACJE,GAAuB,oCAAyC,IAChEC,EAAc,6BAA6BF,YAAkB,EAGjE,OAAO,kCAAoC,IAG/C,IAAMG,EAAwB,CAC1B,QAAS,CAAC,0BAA0BH,GAAS,EAC7C,MAAO,CAEH,mCAAoC,MACpC,yCAA0C,MAC1C,2BAA4B,MAC5B,gCAAiC,MACjC,oCAAqC,MACrC,qCAAsC,MACtC,uCAAwC,MACxC,6CAA8C,MAC9C,uCAAwC,MACxC,yCAA0C,MAC1C,0CAA2C,MAC3C,wCAAyC,MACzC,kCAAmC,KACvC,CACJ,EAEOI,EAAQD","sourcesContent":["import { hasAnyDep, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\n\nimport { consolePlugin } from \"../../utils/loggers\";\n\nlet ruleset = \"dom\";\n\nif (hasAnyDep([\"react\"])) {\n ruleset = \"react\";\n}\n\nlet anolilabEslintConfig: { [key: string]: boolean | undefined } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintTestConfigLoaded) {\n if (anolilabEslintConfig?.[\"info_on_testing_library_framework\"] !== false) {\n consolePlugin(`testing-library: loading \"${ruleset}\" ruleset`);\n }\n\n global.hasAnolilabEsLintTestConfigLoaded = true;\n}\n\nconst config: Linter.Config = {\n extends: [`plugin:testing-library/${ruleset}`],\n rules: {\n // Not included in jest/recommended\n \"testing-library/await-fire-event\": \"off\",\n \"testing-library/consistent-data-testid\": \"off\",\n \"testing-library/no-debug\": \"off\",\n \"testing-library/no-dom-import\": \"off\",\n \"testing-library/no-manual-cleanup\": \"off\",\n \"testing-library/no-render-in-setup\": \"off\",\n \"testing-library/no-await-sync-events\": \"off\",\n \"testing-library/no-wait-for-empty-callback\": \"off\",\n \"testing-library/no-wait-for-snapshot\": \"off\",\n \"testing-library/prefer-explicit-assert\": \"off\",\n \"testing-library/prefer-presence-queries\": \"off\",\n \"testing-library/prefer-screen-queries\": \"off\",\n \"testing-library/prefer-wait-for\": \"off\",\n },\n};\n\nexport default config;\n"]}
1
+ {"version":3,"sources":["../../../src/config/plugins/testing-library.ts"],"names":["hasAnyDep","pkg","anolilabEslintConfig","ruleset","consolePlugin","config","testing_library_default"],"mappings":"4CAAA,OAAS,aAAAA,EAAW,OAAAC,MAAW,+BAK/B,IAAIC,EAA+D,CAAC,EAEhED,IAEAC,EAAuBD,GAAM,WAAc,eAAe,GAG9D,IAAIE,EAAU,MAEVH,EAAU,CAAC,QAAS,wBAAwB,CAAC,IAC7CG,EAAU,SAIT,OAAO,oCACJD,GAAuB,oCAAyC,IAChEE,EAAc,6BAA6BD,YAAkB,EAGjE,OAAO,kCAAoC,IAG/C,IAAME,EAAwB,CAC1B,QAAS,CAAC,0BAA0BF,GAAS,EAC7C,MAAO,CAEH,mCAAoC,MACpC,yCAA0C,MAC1C,2BAA4B,MAC5B,gCAAiC,MACjC,oCAAqC,MACrC,qCAAsC,MACtC,uCAAwC,MACxC,6CAA8C,MAC9C,uCAAwC,MACxC,yCAA0C,MAC1C,0CAA2C,MAC3C,wCAAyC,MACzC,kCAAmC,KACvC,CACJ,EAEOG,EAAQD","sourcesContent":["import { hasAnyDep, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\n\nimport { consolePlugin } from \"../../utils/loggers\";\n\nlet anolilabEslintConfig: { [key: string]: boolean | undefined } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\nlet ruleset = \"dom\";\n\nif (hasAnyDep([\"react\", \"@testing-library/react\"])) {\n ruleset = \"react\";\n}\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintTestConfigLoaded) {\n if (anolilabEslintConfig?.[\"info_on_testing_library_framework\"] !== false) {\n consolePlugin(`testing-library: loading \"${ruleset}\" ruleset`);\n }\n\n global.hasAnolilabEsLintTestConfigLoaded = true;\n}\n\nconst config: Linter.Config = {\n extends: [`plugin:testing-library/${ruleset}`],\n rules: {\n // Not included in jest/recommended\n \"testing-library/await-fire-event\": \"off\",\n \"testing-library/consistent-data-testid\": \"off\",\n \"testing-library/no-debug\": \"off\",\n \"testing-library/no-dom-import\": \"off\",\n \"testing-library/no-manual-cleanup\": \"off\",\n \"testing-library/no-render-in-setup\": \"off\",\n \"testing-library/no-await-sync-events\": \"off\",\n \"testing-library/no-wait-for-empty-callback\": \"off\",\n \"testing-library/no-wait-for-snapshot\": \"off\",\n \"testing-library/prefer-explicit-assert\": \"off\",\n \"testing-library/prefer-presence-queries\": \"off\",\n \"testing-library/prefer-screen-queries\": \"off\",\n \"testing-library/prefer-wait-for\": \"off\",\n },\n};\n\nexport default config;\n"]}
@@ -1,7 +1,7 @@
1
1
  import { a } from '../../chunk-G7JIJH44.mjs';
2
- import { hasAnyDep, pkg } from '@anolilab/package-json-utils';
2
+ import { pkg, hasAnyDep } from '@anolilab/package-json-utils';
3
3
 
4
- var e="dom";hasAnyDep(["react"])&&(e="react");var r={};pkg&&(r=pkg?.anolilab?.["eslint-config"]);global.hasAnolilabEsLintTestConfigLoaded||(r?.info_on_testing_library_framework!==!1&&a(`testing-library: loading "${e}" ruleset`),global.hasAnolilabEsLintTestConfigLoaded=!0);var o={extends:[`plugin:testing-library/${e}`],rules:{"testing-library/await-fire-event":"off","testing-library/consistent-data-testid":"off","testing-library/no-debug":"off","testing-library/no-dom-import":"off","testing-library/no-manual-cleanup":"off","testing-library/no-render-in-setup":"off","testing-library/no-await-sync-events":"off","testing-library/no-wait-for-empty-callback":"off","testing-library/no-wait-for-snapshot":"off","testing-library/prefer-explicit-assert":"off","testing-library/prefer-presence-queries":"off","testing-library/prefer-screen-queries":"off","testing-library/prefer-wait-for":"off"}},l=o;
4
+ var r={};pkg&&(r=pkg?.anolilab?.["eslint-config"]);var e="dom";hasAnyDep(["react","@testing-library/react"])&&(e="react");global.hasAnolilabEsLintTestConfigLoaded||(r?.info_on_testing_library_framework!==!1&&a(`testing-library: loading "${e}" ruleset`),global.hasAnolilabEsLintTestConfigLoaded=!0);var o={extends:[`plugin:testing-library/${e}`],rules:{"testing-library/await-fire-event":"off","testing-library/consistent-data-testid":"off","testing-library/no-debug":"off","testing-library/no-dom-import":"off","testing-library/no-manual-cleanup":"off","testing-library/no-render-in-setup":"off","testing-library/no-await-sync-events":"off","testing-library/no-wait-for-empty-callback":"off","testing-library/no-wait-for-snapshot":"off","testing-library/prefer-explicit-assert":"off","testing-library/prefer-presence-queries":"off","testing-library/prefer-screen-queries":"off","testing-library/prefer-wait-for":"off"}},l=o;
5
5
 
6
6
  export { l as default };
7
7
  //# sourceMappingURL=out.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/config/plugins/testing-library.ts"],"names":["hasAnyDep","pkg","ruleset","anolilabEslintConfig","consolePlugin","config","testing_library_default"],"mappings":"6CAAA,OAAS,aAAAA,EAAW,OAAAC,MAAW,+BAK/B,IAAIC,EAAU,MAEVF,EAAU,CAAC,OAAO,CAAC,IACnBE,EAAU,SAGd,IAAIC,EAA+D,CAAC,EAEhEF,IAEAE,EAAuBF,GAAM,WAAc,eAAe,GAIzD,OAAO,oCACJE,GAAuB,oCAAyC,IAChEC,EAAc,6BAA6BF,YAAkB,EAGjE,OAAO,kCAAoC,IAG/C,IAAMG,EAAwB,CAC1B,QAAS,CAAC,0BAA0BH,GAAS,EAC7C,MAAO,CAEH,mCAAoC,MACpC,yCAA0C,MAC1C,2BAA4B,MAC5B,gCAAiC,MACjC,oCAAqC,MACrC,qCAAsC,MACtC,uCAAwC,MACxC,6CAA8C,MAC9C,uCAAwC,MACxC,yCAA0C,MAC1C,0CAA2C,MAC3C,wCAAyC,MACzC,kCAAmC,KACvC,CACJ,EAEOI,EAAQD","sourcesContent":["import { hasAnyDep, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\n\nimport { consolePlugin } from \"../../utils/loggers\";\n\nlet ruleset = \"dom\";\n\nif (hasAnyDep([\"react\"])) {\n ruleset = \"react\";\n}\n\nlet anolilabEslintConfig: { [key: string]: boolean | undefined } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintTestConfigLoaded) {\n if (anolilabEslintConfig?.[\"info_on_testing_library_framework\"] !== false) {\n consolePlugin(`testing-library: loading \"${ruleset}\" ruleset`);\n }\n\n global.hasAnolilabEsLintTestConfigLoaded = true;\n}\n\nconst config: Linter.Config = {\n extends: [`plugin:testing-library/${ruleset}`],\n rules: {\n // Not included in jest/recommended\n \"testing-library/await-fire-event\": \"off\",\n \"testing-library/consistent-data-testid\": \"off\",\n \"testing-library/no-debug\": \"off\",\n \"testing-library/no-dom-import\": \"off\",\n \"testing-library/no-manual-cleanup\": \"off\",\n \"testing-library/no-render-in-setup\": \"off\",\n \"testing-library/no-await-sync-events\": \"off\",\n \"testing-library/no-wait-for-empty-callback\": \"off\",\n \"testing-library/no-wait-for-snapshot\": \"off\",\n \"testing-library/prefer-explicit-assert\": \"off\",\n \"testing-library/prefer-presence-queries\": \"off\",\n \"testing-library/prefer-screen-queries\": \"off\",\n \"testing-library/prefer-wait-for\": \"off\",\n },\n};\n\nexport default config;\n"]}
1
+ {"version":3,"sources":["../../../src/config/plugins/testing-library.ts"],"names":["hasAnyDep","pkg","anolilabEslintConfig","ruleset","consolePlugin","config","testing_library_default"],"mappings":"6CAAA,OAAS,aAAAA,EAAW,OAAAC,MAAW,+BAK/B,IAAIC,EAA+D,CAAC,EAEhED,IAEAC,EAAuBD,GAAM,WAAc,eAAe,GAG9D,IAAIE,EAAU,MAEVH,EAAU,CAAC,QAAS,wBAAwB,CAAC,IAC7CG,EAAU,SAIT,OAAO,oCACJD,GAAuB,oCAAyC,IAChEE,EAAc,6BAA6BD,YAAkB,EAGjE,OAAO,kCAAoC,IAG/C,IAAME,EAAwB,CAC1B,QAAS,CAAC,0BAA0BF,GAAS,EAC7C,MAAO,CAEH,mCAAoC,MACpC,yCAA0C,MAC1C,2BAA4B,MAC5B,gCAAiC,MACjC,oCAAqC,MACrC,qCAAsC,MACtC,uCAAwC,MACxC,6CAA8C,MAC9C,uCAAwC,MACxC,yCAA0C,MAC1C,0CAA2C,MAC3C,wCAAyC,MACzC,kCAAmC,KACvC,CACJ,EAEOG,EAAQD","sourcesContent":["import { hasAnyDep, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\n\nimport { consolePlugin } from \"../../utils/loggers\";\n\nlet anolilabEslintConfig: { [key: string]: boolean | undefined } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\nlet ruleset = \"dom\";\n\nif (hasAnyDep([\"react\", \"@testing-library/react\"])) {\n ruleset = \"react\";\n}\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintTestConfigLoaded) {\n if (anolilabEslintConfig?.[\"info_on_testing_library_framework\"] !== false) {\n consolePlugin(`testing-library: loading \"${ruleset}\" ruleset`);\n }\n\n global.hasAnolilabEsLintTestConfigLoaded = true;\n}\n\nconst config: Linter.Config = {\n extends: [`plugin:testing-library/${ruleset}`],\n rules: {\n // Not included in jest/recommended\n \"testing-library/await-fire-event\": \"off\",\n \"testing-library/consistent-data-testid\": \"off\",\n \"testing-library/no-debug\": \"off\",\n \"testing-library/no-dom-import\": \"off\",\n \"testing-library/no-manual-cleanup\": \"off\",\n \"testing-library/no-render-in-setup\": \"off\",\n \"testing-library/no-await-sync-events\": \"off\",\n \"testing-library/no-wait-for-empty-callback\": \"off\",\n \"testing-library/no-wait-for-snapshot\": \"off\",\n \"testing-library/prefer-explicit-assert\": \"off\",\n \"testing-library/prefer-presence-queries\": \"off\",\n \"testing-library/prefer-screen-queries\": \"off\",\n \"testing-library/prefer-wait-for\": \"off\",\n },\n};\n\nexport default config;\n"]}
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
10
 
11
11
  var x__default = /*#__PURE__*/_interopDefault(x);
12
12
 
13
- var v=["best-practices","errors","style","es6","variables"],E=["compat","eslint-comments","import","optimize-regex","promise","simple-import-sort","no-extend-native","node","no-secrets","sonarjs","security","jsonc","markdown","toml","yml","html","antfu","unicorn","es"],L=[{configName:"array-func",dependencies:["eslint-plugin-array-func"]},{configName:"jsdoc",dependencies:["eslint-plugin-jsdoc"]},{configName:"tsdoc",dependencies:["eslint-plugin-tsdoc","typescript"]},{configName:"lodash",dependencies:["lodash","eslint-plugin-lodash"]},{configName:"lodash-fp",dependencies:["lodash","eslint-plugin-lodash-fp"]},{configName:"you-dont-need-lodash-underscore",dependencies:["lodash","eslint-plugin-you-dont-need-lodash-underscore"]},{configName:"mdx",dependencies:["eslint-plugin-mdx"]},{configName:"no-unsanitized",dependencies:["eslint-plugin-no-unsanitized"]},{configName:"react",dependencies:["react","react-dom","eslint-plugin-react"]},{configName:"react-redux",dependencies:["eslint-plugin-react-redux"]},{configName:"jsx-a11y",dependencies:["react","react-dom","eslint-plugin-jsx-a11y"]},{configName:"react-hooks",dependencies:["react","react-dom","eslint-plugin-react-hooks"]},{configName:"you-dont-need-momentjs",dependencies:["moment","eslint-plugin-you-dont-need-momentjs"]},{configName:"you-dont-need-momentjs",dependencies:["moment-timezone","eslint-plugin-you-dont-need-momentjs"]},{configName:"tailwindcss",dependencies:["eslint-plugin-tailwindcss"]},{configName:"cypress",dependencies:["eslint-plugin-cypress"]},{configName:"jest",dependencies:["jest","eslint-plugin-jest"]},{configName:"jest-dom",dependencies:["jest","@testing-library/jest-dom","eslint-plugin-jest-dom"]},{configName:"jest-async",dependencies:["jest","eslint-plugin-jest-async"]},{configName:"jest-formatting",dependencies:["jest","eslint-plugin-jest-formatting"]},{configName:"tailwindcss",dependencies:["tailwindcss"]},{configName:"testing-library",dependencies:["@testing-library/dom","eslint-plugin-testing-library"]},{configName:"typescript",dependencies:["typescript"]},{configName:"typescript-sort-keys",dependencies:["typescript","eslint-plugin-typescript-sort-keys"]},{configName:"vitest",dependencies:["vitest","eslint-plugin-vitest"]},{configName:"zod",dependencies:["zod","eslint-plugin-zod"]},{configName:"ava",dependencies:["ava","eslint-plugin-ava"]}],u=[...E],r={},y={};packageJsonUtils.pkg&&(y=packageJsonUtils.pkg?.anolilab?.["eslint-config"]);L.forEach(e=>{let{dependencies:n,configName:o}=e;if(y?.plugin?.[o]!==!1){let f=[];n.forEach(s=>{(packageJsonUtils.hasDependency(s)||packageJsonUtils.hasDevDependency(s))&&f.push(s);}),f.length===n.length?u.push(o):(r[o]={},n.forEach(s=>{r[o][s]=packageJsonUtils.hasDependency(s)||packageJsonUtils.hasDevDependency(s);}));}});var b=v,l=u,h=r;var R={"unicorn/prefer-spread":{"5.0.0":"off"},"unicorn/no-new-buffer":{"5.10.0":"off"},"prefer-rest-params":{"6.0.0":"off"},"prefer-destructuring":{"6.0.0":"off"},"promise/prefer-await-to-then":{"7.6.0":"off"},"prefer-object-spread":{"8.3.0":"off"},"n/prefer-global/url-search-params":{"10.0.0":"off"},"n/prefer-global/url":{"10.0.0":"off"},"no-useless-catch":{"10.0.0":"off"},"prefer-named-capture-group":{"10.0.0":"off"},"n/prefer-global/text-encoder":{"11.0.0":"off"},"n/prefer-global/text-decoder":{"11.0.0":"off"},"unicorn/prefer-flat-map":{"11.0.0":"off"},"n/prefer-promises/dns":{"11.14.0":"off"},"n/prefer-promises/fs":{"11.14.0":"off"}},j=R;if(!global.hasAnolilabEsLintConfigLoaded){process.env.DEBUG&&(chunkYMWD4DNM_js.b(`
13
+ var v=["best-practices","errors","style","es6","variables"],E=["compat","eslint-comments","import","optimize-regex","promise","simple-import-sort","no-extend-native","node","no-secrets","sonarjs","security","jsonc","markdown","toml","yml","html","antfu","unicorn","es"],L=[{configName:"array-func",dependencies:["eslint-plugin-array-func"]},{configName:"jsdoc",dependencies:["eslint-plugin-jsdoc"]},{configName:"tsdoc",dependencies:["eslint-plugin-tsdoc","typescript"]},{configName:"lodash",dependencies:["lodash","eslint-plugin-lodash"]},{configName:"lodash-fp",dependencies:["lodash","eslint-plugin-lodash-fp"]},{configName:"you-dont-need-lodash-underscore",dependencies:["lodash","eslint-plugin-you-dont-need-lodash-underscore"]},{configName:"mdx",dependencies:["eslint-plugin-mdx"]},{configName:"no-unsanitized",dependencies:["eslint-plugin-no-unsanitized"]},{configName:"react",dependencies:["react","react-dom","eslint-plugin-react"]},{configName:"react-redux",dependencies:["eslint-plugin-react-redux"]},{configName:"jsx-a11y",dependencies:["react","react-dom","eslint-plugin-jsx-a11y"]},{configName:"react-hooks",dependencies:["react","react-dom","eslint-plugin-react-hooks"]},{configName:"you-dont-need-momentjs",dependencies:["moment","eslint-plugin-you-dont-need-momentjs"]},{configName:"you-dont-need-momentjs",dependencies:["moment-timezone","eslint-plugin-you-dont-need-momentjs"]},{configName:"tailwindcss",dependencies:["eslint-plugin-tailwindcss"]},{configName:"cypress",dependencies:["eslint-plugin-cypress"]},{configName:"jest",dependencies:["jest","eslint-plugin-jest"]},{configName:"jest-dom",dependencies:["jest","@testing-library/jest-dom","eslint-plugin-jest-dom"]},{configName:"jest-async",dependencies:["jest","eslint-plugin-jest-async"]},{configName:"jest-formatting",dependencies:["jest","eslint-plugin-jest-formatting"]},{configName:"tailwindcss",dependencies:["tailwindcss"]},{configName:"testing-library",dependencies:["@testing-library/dom","eslint-plugin-testing-library"]},{configName:"testing-library",dependencies:["react","@testing-library/react","eslint-plugin-testing-library"]},{configName:"typescript",dependencies:["typescript"]},{configName:"typescript-sort-keys",dependencies:["typescript","eslint-plugin-typescript-sort-keys"]},{configName:"vitest",dependencies:["vitest","eslint-plugin-vitest"]},{configName:"zod",dependencies:["zod","eslint-plugin-zod"]},{configName:"ava",dependencies:["ava","eslint-plugin-ava"]}],u=[...E],f={},y={};packageJsonUtils.pkg&&(y=packageJsonUtils.pkg?.anolilab?.["eslint-config"]);L.forEach(e=>{let{dependencies:n,configName:o}=e;if(y?.plugin?.[o]!==!1){let r=[];n.forEach(s=>{(packageJsonUtils.hasDependency(s)||packageJsonUtils.hasDevDependency(s))&&r.push(s);}),r.length===n.length?u.push(o):(f[o]={},n.forEach(s=>{f[o][s]=packageJsonUtils.hasDependency(s)||packageJsonUtils.hasDevDependency(s);}));}});var b=v,l=u,h=f;var R={"unicorn/prefer-spread":{"5.0.0":"off"},"unicorn/no-new-buffer":{"5.10.0":"off"},"prefer-rest-params":{"6.0.0":"off"},"prefer-destructuring":{"6.0.0":"off"},"promise/prefer-await-to-then":{"7.6.0":"off"},"prefer-object-spread":{"8.3.0":"off"},"n/prefer-global/url-search-params":{"10.0.0":"off"},"n/prefer-global/url":{"10.0.0":"off"},"no-useless-catch":{"10.0.0":"off"},"prefer-named-capture-group":{"10.0.0":"off"},"n/prefer-global/text-encoder":{"11.0.0":"off"},"n/prefer-global/text-decoder":{"11.0.0":"off"},"unicorn/prefer-flat-map":{"11.0.0":"off"},"n/prefer-promises/dns":{"11.14.0":"off"},"n/prefer-promises/fs":{"11.14.0":"off"}},j=R;if(!global.hasAnolilabEsLintConfigLoaded){process.env.DEBUG&&(chunkYMWD4DNM_js.b(`
14
14
  @anolilab/eslint-config loaded the following plugins:
15
15
  `),chunkYMWD4DNM_js.b(" @rushstack/eslint-plugin-security"),["compat","eslint-comments","i","optimize-regex","promise","simple-import-sort","unicorn","no-secrets","sonarjs","json","jsonc","markdown","toml","yml","es",...l].forEach(n=>chunkYMWD4DNM_js.a(n)));let e=!1;Object.entries(h).forEach(([n,o])=>{Object.values(o).some(Boolean)&&(e=!0,chunkYMWD4DNM_js.b(`
16
16
  Your package.json container dependencies for the "${n}" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`),Object.entries(o).forEach(([s,_])=>{_||chunkYMWD4DNM_js.b(` ${s}`);}));}),e&&(chunkYMWD4DNM_js.b(`
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/config.ts","../src/engine-node-overwrite.ts"],"names":["hasAnyDep","packageIsTypeModule","pkg","join","semver","hasDependency","hasDevDependency","baseConfig","internalPluginConfig","pluginConfig","loadedPlugins","possiblePlugins","anolilabEslintConfig","plugin","dependencies","configName","foundDependencies","dependency","rules","pluginRules","possiblePluginRules","engineRules","engine_node_overwrite_default","consoleLog","consolePlugin","hasLogged","installed","configRules","nodeVersion","rule","ruleConfig","minVersion","config","src_default"],"mappings":"+CAMA,MAAO,mDAEP,OAAS,aAAAA,EAAW,uBAAAC,EAAqB,OAAAC,MAAW,+BAEpD,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAY,SCXnB,OAAS,i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mB,MACnB,uBAAwB,MACxB,yBAA0B,MAC1B,uBAAwB,MACxB,cAAe,MACf,YAAa,MACb,aAAc,MACd,qBAAsB,KAC1B,GAGJ,IAAMK,EAAwB,CAQ1B,KAAM,GAEN,OAAQ,GAER,QAAS,CACL,GAAGd,EAAM,IAAKL,GAAWV,EAAK,UAAW,YAAYU,KAAUZ,EAAsB,IAAM,MAAM,CAAC,EAElG,GAAGkB,EAAY,IAAKN,GAAWV,EAAK,UAAW,oBAAoBU,KAAUZ,EAAsB,IAAM,MAAM,CAAC,CACpH,EACA,MAAO,CACH,GAAG0B,CACP,EACA,UAAW,CACP,CACI,MAAO,CAAC,yBAAyB,EACjC,MAAO,CACH,wBAAyB,KAC7B,CACJ,EACA,CACI,MAAO,CAEH,wBACA,wBAGA,6BACA,6BAGA,uBACJ,EACA,MAAO,CACH,mBAAoB,MACpB,8BAA+B,KACnC,CACJ,CACJ,EACA,eAAgB,CACZ,MAEA,QACA,gBACA,oBACA,iBACA,QAEA,WACA,YACA,eACA,UAEA,SACA,QACA,OAEA,aAKA,QACJ,CACJ,EAEOM,EAAQD","sourcesContent":["/**\n * @rushstack/eslint-patch is used to include plugins as dev\n * dependencies instead of imposing them as peer dependencies\n *\n * https://www.npmjs.com/package/@rushstack/eslint-patch\n */\nimport \"@rushstack/eslint-patch/modern-module-resolution\";\n\nimport { hasAnyDep, packageIsTypeModule, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\nimport { join } from \"node:path\";\nimport semver from \"semver\";\n\nimport { pluginRules, possiblePluginRules, rules } from \"./config\";\nimport engineRules from \"./engine-node-overwrite\";\nimport { consoleLog, consolePlugin } from \"./utils/loggers\";\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigLoaded) {\n if (process.env[\"DEBUG\"]) {\n consoleLog(\"\\n@anolilab/eslint-config loaded the following plugins:\\n\");\n\n consoleLog(\" @rushstack/eslint-plugin-security\");\n [\n \"compat\",\n \"eslint-comments\",\n \"i\",\n \"optimize-regex\",\n \"promise\",\n \"simple-import-sort\",\n \"unicorn\",\n \"no-secrets\",\n \"sonarjs\",\n \"json\",\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"es\",\n ...pluginRules,\n ].forEach((plugin) => consolePlugin(plugin));\n }\n\n let hasLogged = false;\n\n Object.entries(possiblePluginRules).forEach(([plugin, dependencies]) => {\n const hasOneDependency = Object.values(dependencies).some(Boolean);\n\n if (hasOneDependency) {\n hasLogged = true;\n consoleLog(\n `\\nYour package.json container dependencies for the \"${plugin}\" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`,\n );\n\n Object.entries(dependencies).forEach(([dependency, installed]) => {\n if (!installed) {\n consoleLog(` ${dependency}`);\n }\n });\n }\n });\n\n if (hasLogged) {\n consoleLog(\"\\nTo disable this message, add the following to your package.json:\");\n consoleLog(' \"anolilab\": { \"eslint-config\": { plugin: { \"plugin-name\": false } } }\\n');\n }\n\n consoleLog('To disable all logging, add the following to your eslint command call \"NO_LOGS=true eslint ...\"');\n\n global.hasAnolilabEsLintConfigLoaded = true;\n}\n\nlet configRules: Linter.RulesRecord = {};\nlet nodeVersion: string | undefined;\n\nif (pkg?.engines?.[\"node\"]) {\n nodeVersion = pkg.engines[\"node\"];\n}\n\nlet anolilabEslintConfig: { [key: string]: boolean | undefined } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\nObject.entries(engineRules).forEach(([rule, ruleConfig]) => {\n Object.keys(ruleConfig)\n .sort(semver.rcompare)\n .forEach((minVersion) => {\n if (nodeVersion && semver.intersects(nodeVersion, `<${minVersion}`)) {\n configRules[rule] = ruleConfig[minVersion as keyof typeof ruleConfig] as Linter.RuleEntry;\n }\n });\n});\n\nif (\n hasAnyDep([\"prettier\"], {\n peerDeps: false,\n })\n) {\n // Workaround VS Code trying to run this file twice!\n if (!global.hasAnolilabEsLintConfigPrettier) {\n global.hasAnolilabEsLintConfigPrettier = true;\n\n if (anolilabEslintConfig?.[\"info_on_disabling_prettier_conflict_rule\"] !== false) {\n consoleLog(\"\\nFound prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier\");\n }\n }\n\n configRules = {\n ...configRules,\n\n // The following rules can be used in some cases. See the README for more\n // information. (These are marked with `0` instead of `\"off\"` so that a\n // script can distinguish them.)\n curly: 0,\n \"lines-around-comment\": 0,\n \"max-len\": 0,\n \"no-confusing-arrow\": 0,\n \"no-mixed-operators\": 0,\n \"no-tabs\": 0,\n \"no-unexpected-multiline\": 0,\n quotes: 0,\n\n // The rest are rules that you never need to enable when using Prettier.\n \"array-bracket-newline\": \"off\",\n \"array-bracket-spacing\": \"off\",\n \"array-element-newline\": \"off\",\n \"arrow-parens\": \"off\",\n \"arrow-spacing\": \"off\",\n \"block-spacing\": \"off\",\n \"brace-style\": \"off\",\n \"comma-dangle\": \"off\",\n \"comma-spacing\": \"off\",\n \"comma-style\": \"off\",\n \"computed-property-spacing\": \"off\",\n \"dot-location\": \"off\",\n \"eol-last\": \"off\",\n \"func-call-spacing\": \"off\",\n \"function-call-argument-newline\": \"off\",\n \"function-paren-newline\": \"off\",\n \"generator-star-spacing\": \"off\",\n \"implicit-arrow-linebreak\": \"off\",\n indent: \"off\",\n \"jsx-quotes\": \"off\",\n \"key-spacing\": \"off\",\n \"keyword-spacing\": \"off\",\n \"linebreak-style\": \"off\",\n \"multiline-ternary\": \"off\",\n \"newline-per-chained-call\": \"off\",\n \"new-parens\": \"off\",\n \"no-extra-parens\": \"off\",\n \"no-extra-semi\": \"off\",\n \"no-floating-decimal\": \"off\",\n \"no-mixed-spaces-and-tabs\": \"off\",\n \"no-multi-spaces\": \"off\",\n \"no-multiple-empty-lines\": \"off\",\n \"no-trailing-spaces\": \"off\",\n \"no-whitespace-before-property\": \"off\",\n \"nonblock-statement-body-position\": \"off\",\n \"object-curly-newline\": \"off\",\n \"object-curly-spacing\": \"off\",\n \"object-property-newline\": \"off\",\n \"one-var-declaration-per-line\": \"off\",\n \"operator-linebreak\": \"off\",\n \"padded-blocks\": \"off\",\n \"quote-props\": \"off\",\n \"rest-spread-spacing\": \"off\",\n semi: \"off\",\n \"semi-spacing\": \"off\",\n \"semi-style\": \"off\",\n \"space-before-blocks\": \"off\",\n \"space-before-function-paren\": \"off\",\n \"space-in-parens\": \"off\",\n \"space-infix-ops\": \"off\",\n \"space-unary-ops\": \"off\",\n \"switch-colon-spacing\": \"off\",\n \"template-curly-spacing\": \"off\",\n \"template-tag-spacing\": \"off\",\n \"unicode-bom\": \"off\",\n \"wrap-iife\": \"off\",\n \"wrap-regex\": \"off\",\n \"yield-star-spacing\": \"off\",\n };\n}\n\nconst config: Linter.Config = {\n // After an .eslintrc.js file is loaded, ESLint will normally continue visiting all parent folders\n // to look for other .eslintrc.js files, and also consult a personal file ~/.eslintrc.js. If any files\n // are found, their options will be merged. This is difficult for humans to understand, and it will cause\n // nondeterministic behavior if files are loaded from outside the Git working folder.\n //\n // Setting root=true causes ESLint to stop looking for other config files after the first .eslintrc.js\n // is loaded.\n root: true,\n // Disable the parser by default\n parser: \"\",\n\n extends: [\n ...rules.map((plugin) => join(__dirname, `./config/${plugin}.${packageIsTypeModule ? \"m\" : \"\"}js`)),\n\n ...pluginRules.map((plugin) => join(__dirname, `./config/plugins/${plugin}.${packageIsTypeModule ? \"m\" : \"\"}js`)),\n ],\n rules: {\n ...configRules,\n },\n overrides: [\n {\n files: [\"**/migrations/*.{js,ts}\"],\n rules: {\n \"filenames/match-regex\": \"off\",\n },\n },\n {\n files: [\n // Test files\n \"**/*.spec.{js,ts,tsx}\",\n \"**/*.test.{js,ts,tsx}\",\n\n // Facebook convention\n \"**/__mocks__/*.{js,ts,tsx}\",\n \"**/__tests__/*.{js,ts,tsx}\",\n\n // Microsoft convention\n \"**/test/*.{js,ts,tsx}\",\n ],\n rules: {\n \"no-magic-numbers\": \"off\",\n \"sonarjs/no-duplicate-string\": \"off\",\n },\n },\n ],\n ignorePatterns: [\n \"!.*\",\n\n \".git/\",\n \"node_modules/\",\n \"bower_components/\",\n \"jspm_packages/\",\n \".npm/\",\n\n \"lib-cov/\",\n \"coverage/\",\n \".nyc_output/\",\n \".cache/\",\n\n \"build/\",\n \"dist/\",\n \"tmp/\",\n\n \"**/*.min.*\",\n\n // Manually authored .d.ts files are generally used to describe external APIs that are not expected\n // to follow our coding conventions. Linting those files tends to produce a lot of spurious suppressions,\n // so we simply ignore them.\n \"*.d.ts\",\n ],\n};\n\nexport default config;\n","import { hasDependency, hasDevDependency, pkg } from \"@anolilab/package-json-utils\";\n\nimport type { PackageRules } from \"./types\";\n\nconst baseConfig = [\"best-practices\", \"errors\", \"style\", \"es6\", \"variables\"];\n\nconst internalPluginConfig = [\n \"compat\",\n \"eslint-comments\",\n \"import\",\n \"optimize-regex\",\n \"promise\",\n \"simple-import-sort\",\n \"no-extend-native\",\n \"node\",\n // Security Rules\n \"no-secrets\",\n \"sonarjs\",\n \"security\",\n // file rules\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"html\",\n\n // custom rules\n \"antfu\",\n \"unicorn\",\n \"es\",\n];\n\nconst pluginConfig: PackageRules = [\n {\n configName: \"array-func\",\n dependencies: [\"eslint-plugin-array-func\"],\n },\n {\n configName: \"jsdoc\",\n dependencies: [\"eslint-plugin-jsdoc\"],\n },\n {\n configName: \"tsdoc\",\n dependencies: [\"eslint-plugin-tsdoc\", \"typescript\"],\n },\n {\n configName: \"lodash\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash\"],\n },\n {\n configName: \"lodash-fp\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash-fp\"],\n },\n {\n configName: \"you-dont-need-lodash-underscore\",\n dependencies: [\"lodash\", \"eslint-plugin-you-dont-need-lodash-underscore\"],\n },\n {\n configName: \"mdx\",\n dependencies: [\"eslint-plugin-mdx\"],\n },\n {\n configName: \"no-unsanitized\",\n dependencies: [\"eslint-plugin-no-unsanitized\"],\n },\n {\n configName: \"react\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react\"],\n },\n {\n configName: \"react-redux\",\n dependencies: [\"eslint-plugin-react-redux\"],\n },\n {\n configName: \"jsx-a11y\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-jsx-a11y\"],\n },\n {\n configName: \"react-hooks\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react-hooks\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment-timezone\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"eslint-plugin-tailwindcss\"],\n },\n {\n configName: \"cypress\",\n dependencies: [\"eslint-plugin-cypress\"],\n },\n {\n configName: \"jest\",\n dependencies: [\"jest\", \"eslint-plugin-jest\"],\n },\n {\n configName: \"jest-dom\",\n dependencies: [\"jest\", \"@testing-library/jest-dom\", \"eslint-plugin-jest-dom\"],\n },\n {\n configName: \"jest-async\",\n dependencies: [\"jest\", \"eslint-plugin-jest-async\"],\n },\n {\n configName: \"jest-formatting\",\n dependencies: [\"jest\", \"eslint-plugin-jest-formatting\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"tailwindcss\"],\n },\n {\n configName: \"testing-library\",\n dependencies: [\"@testing-library/dom\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"typescript\",\n dependencies: [\"typescript\"],\n },\n {\n configName: \"typescript-sort-keys\",\n dependencies: [\"typescript\", \"eslint-plugin-typescript-sort-keys\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\"],\n },\n {\n configName: \"zod\",\n dependencies: [\"zod\", \"eslint-plugin-zod\"],\n },\n {\n configName: \"ava\",\n dependencies: [\"ava\", \"eslint-plugin-ava\"],\n },\n];\n\nconst loadedPlugins: string[] = [...internalPluginConfig];\nconst possiblePlugins: { [rule: string]: { [packageName: string]: boolean } } = {};\n\nlet anolilabEslintConfig: { [key: string]: { [key: string]: false | undefined } } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\npluginConfig.forEach((plugin) => {\n const { dependencies, configName } = plugin;\n\n if (anolilabEslintConfig?.[\"plugin\"]?.[configName] !== false) {\n const foundDependencies = [];\n\n dependencies.forEach((dependency) => {\n if (hasDependency(dependency) || hasDevDependency(dependency)) {\n foundDependencies.push(dependency);\n }\n });\n\n if (foundDependencies.length === dependencies.length) {\n loadedPlugins.push(configName);\n } else {\n possiblePlugins[configName] = {};\n\n dependencies.forEach((dependency) => {\n (possiblePlugins[configName] as { [key: string]: boolean })[dependency] = hasDependency(dependency) || hasDevDependency(dependency);\n });\n }\n }\n});\n\nexport const rules = baseConfig;\nexport const pluginRules = loadedPlugins;\n\nexport const possiblePluginRules = possiblePlugins;\n","/**\nDefine the rules config that are overwritten only for specific version of Node.js based on `engines.node` in package.json or the `nodeVersion` option.\n\nThe keys are rule names and the values are an Object with a valid semver (`4.0.0` is valid `4` is not) as keys and the rule configuration as values.\n\nEach entry define the rule config and the maximum Node.js version for which to set it.\nThe entry with the lowest version that is compliant with the `engines.node`/`nodeVersion` range will be used.\n\n@type {Object}\n\n@example\n```\n{\n 'plugin/rule': {\n '6.0.0': ['error', {prop: 'node-6-conf'}],\n '8.0.0': ['error', {prop: 'node-8-conf'}]\n }\n}\n```\n\nWith `engines.node` set to `>=4` the rule `plugin/rule` will not be used.\nWith `engines.node` set to `>=6` the rule `plugin/rule` will be used with the config `{prop: 'node-6-conf'}`.\nWith `engines.node` set to `>=8` the rule `plugin/rule` will be used with the config `{prop: 'node-8-conf'}`.\n*/\nconst engineRules = {\n \"unicorn/prefer-spread\": {\n \"5.0.0\": \"off\",\n },\n \"unicorn/no-new-buffer\": {\n \"5.10.0\": \"off\",\n },\n \"prefer-rest-params\": {\n \"6.0.0\": \"off\",\n },\n \"prefer-destructuring\": {\n \"6.0.0\": \"off\",\n },\n \"promise/prefer-await-to-then\": {\n \"7.6.0\": \"off\",\n },\n \"prefer-object-spread\": {\n \"8.3.0\": \"off\",\n },\n \"n/prefer-global/url-search-params\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/url\": {\n \"10.0.0\": \"off\",\n },\n \"no-useless-catch\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-named-capture-group\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/text-encoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/text-decoder\": {\n \"11.0.0\": \"off\",\n },\n \"unicorn/prefer-flat-map\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-promises/dns\": {\n \"11.14.0\": \"off\",\n },\n \"n/prefer-promises/fs\": {\n \"11.14.0\": \"off\",\n },\n};\n\nexport default engineRules;\n"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/config.ts","../src/engine-node-overwrite.ts"],"names":["hasAnyDep","packageIsTypeModule","pkg","join","semver","hasDependency","hasDevDependency","baseConfig","internalPluginConfig","pluginConfig","loadedPlugins","possiblePlugins","anolilabEslintConfig","plugin","dependencies","configName","foundDependencies","dependency","rules","pluginRules","possiblePluginRules","engineRules","engine_node_overwrite_default","consoleLog","consolePlugin","hasLogged","installed","configRules","nodeVersion","rule","ruleConfig","minVersion","config","src_default"],"mappings":"+CAMA,MAAO,mDAEP,OAAS,aAAAA,EAAW,uBAAAC,EAAqB,OAAAC,MAAW,+BAEpD,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAY,SCXnB,OAAS,iBAAAC,EAAe,oBAAAC,EAAkB,OAAAJ,MAAW,+BAIrD,IAAMK,EAAa,CAAC,iBAAkB,SAAU,QAAS,MAAO,WAAW,EAErEC,EAAuB,C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Ae,MACf,YAAa,MACb,aAAc,MACd,qBAAsB,KAC1B,GAGJ,IAAMK,EAAwB,CAQ1B,KAAM,GAEN,OAAQ,GAER,QAAS,CACL,GAAGd,EAAM,IAAKL,GAAWV,EAAK,UAAW,YAAYU,KAAUZ,EAAsB,IAAM,MAAM,CAAC,EAElG,GAAGkB,EAAY,IAAKN,GAAWV,EAAK,UAAW,oBAAoBU,KAAUZ,EAAsB,IAAM,MAAM,CAAC,CACpH,EACA,MAAO,CACH,GAAG0B,CACP,EACA,UAAW,CACP,CACI,MAAO,CAAC,yBAAyB,EACjC,MAAO,CACH,wBAAyB,KAC7B,CACJ,EACA,CACI,MAAO,CAEH,wBACA,wBAGA,6BACA,6BAGA,uBACJ,EACA,MAAO,CACH,mBAAoB,MACpB,8BAA+B,KACnC,CACJ,CACJ,EACA,eAAgB,CACZ,MAEA,QACA,gBACA,oBACA,iBACA,QAEA,WACA,YACA,eACA,UAEA,SACA,QACA,OAEA,aAKA,QACJ,CACJ,EAEOM,EAAQD","sourcesContent":["/**\n * @rushstack/eslint-patch is used to include plugins as dev\n * dependencies instead of imposing them as peer dependencies\n *\n * https://www.npmjs.com/package/@rushstack/eslint-patch\n */\nimport \"@rushstack/eslint-patch/modern-module-resolution\";\n\nimport { hasAnyDep, packageIsTypeModule, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\nimport { join } from \"node:path\";\nimport semver from \"semver\";\n\nimport { pluginRules, possiblePluginRules, rules } from \"./config\";\nimport engineRules from \"./engine-node-overwrite\";\nimport { consoleLog, consolePlugin } from \"./utils/loggers\";\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigLoaded) {\n if (process.env[\"DEBUG\"]) {\n consoleLog(\"\\n@anolilab/eslint-config loaded the following plugins:\\n\");\n\n consoleLog(\" @rushstack/eslint-plugin-security\");\n [\n \"compat\",\n \"eslint-comments\",\n \"i\",\n \"optimize-regex\",\n \"promise\",\n \"simple-import-sort\",\n \"unicorn\",\n \"no-secrets\",\n \"sonarjs\",\n \"json\",\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"es\",\n ...pluginRules,\n ].forEach((plugin) => consolePlugin(plugin));\n }\n\n let hasLogged = false;\n\n Object.entries(possiblePluginRules).forEach(([plugin, dependencies]) => {\n const hasOneDependency = Object.values(dependencies).some(Boolean);\n\n if (hasOneDependency) {\n hasLogged = true;\n consoleLog(\n `\\nYour package.json container dependencies for the \"${plugin}\" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`,\n );\n\n Object.entries(dependencies).forEach(([dependency, installed]) => {\n if (!installed) {\n consoleLog(` ${dependency}`);\n }\n });\n }\n });\n\n if (hasLogged) {\n consoleLog(\"\\nTo disable this message, add the following to your package.json:\");\n consoleLog(' \"anolilab\": { \"eslint-config\": { plugin: { \"plugin-name\": false } } }\\n');\n }\n\n consoleLog('To disable all logging, add the following to your eslint command call \"NO_LOGS=true eslint ...\"');\n\n global.hasAnolilabEsLintConfigLoaded = true;\n}\n\nlet configRules: Linter.RulesRecord = {};\nlet nodeVersion: string | undefined;\n\nif (pkg?.engines?.[\"node\"]) {\n nodeVersion = pkg.engines[\"node\"];\n}\n\nlet anolilabEslintConfig: { [key: string]: boolean | undefined } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\nObject.entries(engineRules).forEach(([rule, ruleConfig]) => {\n Object.keys(ruleConfig)\n .sort(semver.rcompare)\n .forEach((minVersion) => {\n if (nodeVersion && semver.intersects(nodeVersion, `<${minVersion}`)) {\n configRules[rule] = ruleConfig[minVersion as keyof typeof ruleConfig] as Linter.RuleEntry;\n }\n });\n});\n\nif (\n hasAnyDep([\"prettier\"], {\n peerDeps: false,\n })\n) {\n // Workaround VS Code trying to run this file twice!\n if (!global.hasAnolilabEsLintConfigPrettier) {\n global.hasAnolilabEsLintConfigPrettier = true;\n\n if (anolilabEslintConfig?.[\"info_on_disabling_prettier_conflict_rule\"] !== false) {\n consoleLog(\"\\nFound prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier\");\n }\n }\n\n configRules = {\n ...configRules,\n\n // The following rules can be used in some cases. See the README for more\n // information. (These are marked with `0` instead of `\"off\"` so that a\n // script can distinguish them.)\n curly: 0,\n \"lines-around-comment\": 0,\n \"max-len\": 0,\n \"no-confusing-arrow\": 0,\n \"no-mixed-operators\": 0,\n \"no-tabs\": 0,\n \"no-unexpected-multiline\": 0,\n quotes: 0,\n\n // The rest are rules that you never need to enable when using Prettier.\n \"array-bracket-newline\": \"off\",\n \"array-bracket-spacing\": \"off\",\n \"array-element-newline\": \"off\",\n \"arrow-parens\": \"off\",\n \"arrow-spacing\": \"off\",\n \"block-spacing\": \"off\",\n \"brace-style\": \"off\",\n \"comma-dangle\": \"off\",\n \"comma-spacing\": \"off\",\n \"comma-style\": \"off\",\n \"computed-property-spacing\": \"off\",\n \"dot-location\": \"off\",\n \"eol-last\": \"off\",\n \"func-call-spacing\": \"off\",\n \"function-call-argument-newline\": \"off\",\n \"function-paren-newline\": \"off\",\n \"generator-star-spacing\": \"off\",\n \"implicit-arrow-linebreak\": \"off\",\n indent: \"off\",\n \"jsx-quotes\": \"off\",\n \"key-spacing\": \"off\",\n \"keyword-spacing\": \"off\",\n \"linebreak-style\": \"off\",\n \"multiline-ternary\": \"off\",\n \"newline-per-chained-call\": \"off\",\n \"new-parens\": \"off\",\n \"no-extra-parens\": \"off\",\n \"no-extra-semi\": \"off\",\n \"no-floating-decimal\": \"off\",\n \"no-mixed-spaces-and-tabs\": \"off\",\n \"no-multi-spaces\": \"off\",\n \"no-multiple-empty-lines\": \"off\",\n \"no-trailing-spaces\": \"off\",\n \"no-whitespace-before-property\": \"off\",\n \"nonblock-statement-body-position\": \"off\",\n \"object-curly-newline\": \"off\",\n \"object-curly-spacing\": \"off\",\n \"object-property-newline\": \"off\",\n \"one-var-declaration-per-line\": \"off\",\n \"operator-linebreak\": \"off\",\n \"padded-blocks\": \"off\",\n \"quote-props\": \"off\",\n \"rest-spread-spacing\": \"off\",\n semi: \"off\",\n \"semi-spacing\": \"off\",\n \"semi-style\": \"off\",\n \"space-before-blocks\": \"off\",\n \"space-before-function-paren\": \"off\",\n \"space-in-parens\": \"off\",\n \"space-infix-ops\": \"off\",\n \"space-unary-ops\": \"off\",\n \"switch-colon-spacing\": \"off\",\n \"template-curly-spacing\": \"off\",\n \"template-tag-spacing\": \"off\",\n \"unicode-bom\": \"off\",\n \"wrap-iife\": \"off\",\n \"wrap-regex\": \"off\",\n \"yield-star-spacing\": \"off\",\n };\n}\n\nconst config: Linter.Config = {\n // After an .eslintrc.js file is loaded, ESLint will normally continue visiting all parent folders\n // to look for other .eslintrc.js files, and also consult a personal file ~/.eslintrc.js. If any files\n // are found, their options will be merged. This is difficult for humans to understand, and it will cause\n // nondeterministic behavior if files are loaded from outside the Git working folder.\n //\n // Setting root=true causes ESLint to stop looking for other config files after the first .eslintrc.js\n // is loaded.\n root: true,\n // Disable the parser by default\n parser: \"\",\n\n extends: [\n ...rules.map((plugin) => join(__dirname, `./config/${plugin}.${packageIsTypeModule ? \"m\" : \"\"}js`)),\n\n ...pluginRules.map((plugin) => join(__dirname, `./config/plugins/${plugin}.${packageIsTypeModule ? \"m\" : \"\"}js`)),\n ],\n rules: {\n ...configRules,\n },\n overrides: [\n {\n files: [\"**/migrations/*.{js,ts}\"],\n rules: {\n \"filenames/match-regex\": \"off\",\n },\n },\n {\n files: [\n // Test files\n \"**/*.spec.{js,ts,tsx}\",\n \"**/*.test.{js,ts,tsx}\",\n\n // Facebook convention\n \"**/__mocks__/*.{js,ts,tsx}\",\n \"**/__tests__/*.{js,ts,tsx}\",\n\n // Microsoft convention\n \"**/test/*.{js,ts,tsx}\",\n ],\n rules: {\n \"no-magic-numbers\": \"off\",\n \"sonarjs/no-duplicate-string\": \"off\",\n },\n },\n ],\n ignorePatterns: [\n \"!.*\",\n\n \".git/\",\n \"node_modules/\",\n \"bower_components/\",\n \"jspm_packages/\",\n \".npm/\",\n\n \"lib-cov/\",\n \"coverage/\",\n \".nyc_output/\",\n \".cache/\",\n\n \"build/\",\n \"dist/\",\n \"tmp/\",\n\n \"**/*.min.*\",\n\n // Manually authored .d.ts files are generally used to describe external APIs that are not expected\n // to follow our coding conventions. Linting those files tends to produce a lot of spurious suppressions,\n // so we simply ignore them.\n \"*.d.ts\",\n ],\n};\n\nexport default config;\n","import { hasDependency, hasDevDependency, pkg } from \"@anolilab/package-json-utils\";\n\nimport type { PackageRules } from \"./types\";\n\nconst baseConfig = [\"best-practices\", \"errors\", \"style\", \"es6\", \"variables\"];\n\nconst internalPluginConfig = [\n \"compat\",\n \"eslint-comments\",\n \"import\",\n \"optimize-regex\",\n \"promise\",\n \"simple-import-sort\",\n \"no-extend-native\",\n \"node\",\n // Security Rules\n \"no-secrets\",\n \"sonarjs\",\n \"security\",\n // file rules\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"html\",\n\n // custom rules\n \"antfu\",\n \"unicorn\",\n \"es\",\n];\n\nconst pluginConfig: PackageRules = [\n {\n configName: \"array-func\",\n dependencies: [\"eslint-plugin-array-func\"],\n },\n {\n configName: \"jsdoc\",\n dependencies: [\"eslint-plugin-jsdoc\"],\n },\n {\n configName: \"tsdoc\",\n dependencies: [\"eslint-plugin-tsdoc\", \"typescript\"],\n },\n {\n configName: \"lodash\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash\"],\n },\n {\n configName: \"lodash-fp\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash-fp\"],\n },\n {\n configName: \"you-dont-need-lodash-underscore\",\n dependencies: [\"lodash\", \"eslint-plugin-you-dont-need-lodash-underscore\"],\n },\n {\n configName: \"mdx\",\n dependencies: [\"eslint-plugin-mdx\"],\n },\n {\n configName: \"no-unsanitized\",\n dependencies: [\"eslint-plugin-no-unsanitized\"],\n },\n {\n configName: \"react\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react\"],\n },\n {\n configName: \"react-redux\",\n dependencies: [\"eslint-plugin-react-redux\"],\n },\n {\n configName: \"jsx-a11y\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-jsx-a11y\"],\n },\n {\n configName: \"react-hooks\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react-hooks\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment-timezone\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"eslint-plugin-tailwindcss\"],\n },\n {\n configName: \"cypress\",\n dependencies: [\"eslint-plugin-cypress\"],\n },\n {\n configName: \"jest\",\n dependencies: [\"jest\", \"eslint-plugin-jest\"],\n },\n {\n configName: \"jest-dom\",\n dependencies: [\"jest\", \"@testing-library/jest-dom\", \"eslint-plugin-jest-dom\"],\n },\n {\n configName: \"jest-async\",\n dependencies: [\"jest\", \"eslint-plugin-jest-async\"],\n },\n {\n configName: \"jest-formatting\",\n dependencies: [\"jest\", \"eslint-plugin-jest-formatting\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"tailwindcss\"],\n },\n {\n configName: \"testing-library\",\n dependencies: [\"@testing-library/dom\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"testing-library\",\n dependencies: [\"react\", \"@testing-library/react\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"typescript\",\n dependencies: [\"typescript\"],\n },\n {\n configName: \"typescript-sort-keys\",\n dependencies: [\"typescript\", \"eslint-plugin-typescript-sort-keys\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\"],\n },\n {\n configName: \"zod\",\n dependencies: [\"zod\", \"eslint-plugin-zod\"],\n },\n {\n configName: \"ava\",\n dependencies: [\"ava\", \"eslint-plugin-ava\"],\n },\n];\n\nconst loadedPlugins: string[] = [...internalPluginConfig];\nconst possiblePlugins: { [rule: string]: { [packageName: string]: boolean } } = {};\n\nlet anolilabEslintConfig: { [key: string]: { [key: string]: false | undefined } } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\npluginConfig.forEach((plugin) => {\n const { dependencies, configName } = plugin;\n\n if (anolilabEslintConfig?.[\"plugin\"]?.[configName] !== false) {\n const foundDependencies = [];\n\n dependencies.forEach((dependency) => {\n if (hasDependency(dependency) || hasDevDependency(dependency)) {\n foundDependencies.push(dependency);\n }\n });\n\n if (foundDependencies.length === dependencies.length) {\n loadedPlugins.push(configName);\n } else {\n possiblePlugins[configName] = {};\n\n dependencies.forEach((dependency) => {\n (possiblePlugins[configName] as { [key: string]: boolean })[dependency] = hasDependency(dependency) || hasDevDependency(dependency);\n });\n }\n }\n});\n\nexport const rules = baseConfig;\nexport const pluginRules = loadedPlugins;\n\nexport const possiblePluginRules = possiblePlugins;\n","/**\nDefine the rules config that are overwritten only for specific version of Node.js based on `engines.node` in package.json or the `nodeVersion` option.\n\nThe keys are rule names and the values are an Object with a valid semver (`4.0.0` is valid `4` is not) as keys and the rule configuration as values.\n\nEach entry define the rule config and the maximum Node.js version for which to set it.\nThe entry with the lowest version that is compliant with the `engines.node`/`nodeVersion` range will be used.\n\n@type {Object}\n\n@example\n```\n{\n 'plugin/rule': {\n '6.0.0': ['error', {prop: 'node-6-conf'}],\n '8.0.0': ['error', {prop: 'node-8-conf'}]\n }\n}\n```\n\nWith `engines.node` set to `>=4` the rule `plugin/rule` will not be used.\nWith `engines.node` set to `>=6` the rule `plugin/rule` will be used with the config `{prop: 'node-6-conf'}`.\nWith `engines.node` set to `>=8` the rule `plugin/rule` will be used with the config `{prop: 'node-8-conf'}`.\n*/\nconst engineRules = {\n \"unicorn/prefer-spread\": {\n \"5.0.0\": \"off\",\n },\n \"unicorn/no-new-buffer\": {\n \"5.10.0\": \"off\",\n },\n \"prefer-rest-params\": {\n \"6.0.0\": \"off\",\n },\n \"prefer-destructuring\": {\n \"6.0.0\": \"off\",\n },\n \"promise/prefer-await-to-then\": {\n \"7.6.0\": \"off\",\n },\n \"prefer-object-spread\": {\n \"8.3.0\": \"off\",\n },\n \"n/prefer-global/url-search-params\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/url\": {\n \"10.0.0\": \"off\",\n },\n \"no-useless-catch\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-named-capture-group\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/text-encoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/text-decoder\": {\n \"11.0.0\": \"off\",\n },\n \"unicorn/prefer-flat-map\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-promises/dns\": {\n \"11.14.0\": \"off\",\n },\n \"n/prefer-promises/fs\": {\n \"11.14.0\": \"off\",\n },\n};\n\nexport default engineRules;\n"]}
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { pkg, hasDependency, hasDevDependency, hasAnyDep, packageIsTypeModule }
4
4
  import { join } from 'path';
5
5
  import x from 'semver';
6
6
 
7
- var v=["best-practices","errors","style","es6","variables"],E=["compat","eslint-comments","import","optimize-regex","promise","simple-import-sort","no-extend-native","node","no-secrets","sonarjs","security","jsonc","markdown","toml","yml","html","antfu","unicorn","es"],L=[{configName:"array-func",dependencies:["eslint-plugin-array-func"]},{configName:"jsdoc",dependencies:["eslint-plugin-jsdoc"]},{configName:"tsdoc",dependencies:["eslint-plugin-tsdoc","typescript"]},{configName:"lodash",dependencies:["lodash","eslint-plugin-lodash"]},{configName:"lodash-fp",dependencies:["lodash","eslint-plugin-lodash-fp"]},{configName:"you-dont-need-lodash-underscore",dependencies:["lodash","eslint-plugin-you-dont-need-lodash-underscore"]},{configName:"mdx",dependencies:["eslint-plugin-mdx"]},{configName:"no-unsanitized",dependencies:["eslint-plugin-no-unsanitized"]},{configName:"react",dependencies:["react","react-dom","eslint-plugin-react"]},{configName:"react-redux",dependencies:["eslint-plugin-react-redux"]},{configName:"jsx-a11y",dependencies:["react","react-dom","eslint-plugin-jsx-a11y"]},{configName:"react-hooks",dependencies:["react","react-dom","eslint-plugin-react-hooks"]},{configName:"you-dont-need-momentjs",dependencies:["moment","eslint-plugin-you-dont-need-momentjs"]},{configName:"you-dont-need-momentjs",dependencies:["moment-timezone","eslint-plugin-you-dont-need-momentjs"]},{configName:"tailwindcss",dependencies:["eslint-plugin-tailwindcss"]},{configName:"cypress",dependencies:["eslint-plugin-cypress"]},{configName:"jest",dependencies:["jest","eslint-plugin-jest"]},{configName:"jest-dom",dependencies:["jest","@testing-library/jest-dom","eslint-plugin-jest-dom"]},{configName:"jest-async",dependencies:["jest","eslint-plugin-jest-async"]},{configName:"jest-formatting",dependencies:["jest","eslint-plugin-jest-formatting"]},{configName:"tailwindcss",dependencies:["tailwindcss"]},{configName:"testing-library",dependencies:["@testing-library/dom","eslint-plugin-testing-library"]},{configName:"typescript",dependencies:["typescript"]},{configName:"typescript-sort-keys",dependencies:["typescript","eslint-plugin-typescript-sort-keys"]},{configName:"vitest",dependencies:["vitest","eslint-plugin-vitest"]},{configName:"zod",dependencies:["zod","eslint-plugin-zod"]},{configName:"ava",dependencies:["ava","eslint-plugin-ava"]}],u=[...E],r={},y={};pkg&&(y=pkg?.anolilab?.["eslint-config"]);L.forEach(e=>{let{dependencies:n,configName:o}=e;if(y?.plugin?.[o]!==!1){let f=[];n.forEach(s=>{(hasDependency(s)||hasDevDependency(s))&&f.push(s);}),f.length===n.length?u.push(o):(r[o]={},n.forEach(s=>{r[o][s]=hasDependency(s)||hasDevDependency(s);}));}});var b=v,l=u,h=r;var R={"unicorn/prefer-spread":{"5.0.0":"off"},"unicorn/no-new-buffer":{"5.10.0":"off"},"prefer-rest-params":{"6.0.0":"off"},"prefer-destructuring":{"6.0.0":"off"},"promise/prefer-await-to-then":{"7.6.0":"off"},"prefer-object-spread":{"8.3.0":"off"},"n/prefer-global/url-search-params":{"10.0.0":"off"},"n/prefer-global/url":{"10.0.0":"off"},"no-useless-catch":{"10.0.0":"off"},"prefer-named-capture-group":{"10.0.0":"off"},"n/prefer-global/text-encoder":{"11.0.0":"off"},"n/prefer-global/text-decoder":{"11.0.0":"off"},"unicorn/prefer-flat-map":{"11.0.0":"off"},"n/prefer-promises/dns":{"11.14.0":"off"},"n/prefer-promises/fs":{"11.14.0":"off"}},j=R;if(!global.hasAnolilabEsLintConfigLoaded){process.env.DEBUG&&(b$1(`
7
+ var v=["best-practices","errors","style","es6","variables"],E=["compat","eslint-comments","import","optimize-regex","promise","simple-import-sort","no-extend-native","node","no-secrets","sonarjs","security","jsonc","markdown","toml","yml","html","antfu","unicorn","es"],L=[{configName:"array-func",dependencies:["eslint-plugin-array-func"]},{configName:"jsdoc",dependencies:["eslint-plugin-jsdoc"]},{configName:"tsdoc",dependencies:["eslint-plugin-tsdoc","typescript"]},{configName:"lodash",dependencies:["lodash","eslint-plugin-lodash"]},{configName:"lodash-fp",dependencies:["lodash","eslint-plugin-lodash-fp"]},{configName:"you-dont-need-lodash-underscore",dependencies:["lodash","eslint-plugin-you-dont-need-lodash-underscore"]},{configName:"mdx",dependencies:["eslint-plugin-mdx"]},{configName:"no-unsanitized",dependencies:["eslint-plugin-no-unsanitized"]},{configName:"react",dependencies:["react","react-dom","eslint-plugin-react"]},{configName:"react-redux",dependencies:["eslint-plugin-react-redux"]},{configName:"jsx-a11y",dependencies:["react","react-dom","eslint-plugin-jsx-a11y"]},{configName:"react-hooks",dependencies:["react","react-dom","eslint-plugin-react-hooks"]},{configName:"you-dont-need-momentjs",dependencies:["moment","eslint-plugin-you-dont-need-momentjs"]},{configName:"you-dont-need-momentjs",dependencies:["moment-timezone","eslint-plugin-you-dont-need-momentjs"]},{configName:"tailwindcss",dependencies:["eslint-plugin-tailwindcss"]},{configName:"cypress",dependencies:["eslint-plugin-cypress"]},{configName:"jest",dependencies:["jest","eslint-plugin-jest"]},{configName:"jest-dom",dependencies:["jest","@testing-library/jest-dom","eslint-plugin-jest-dom"]},{configName:"jest-async",dependencies:["jest","eslint-plugin-jest-async"]},{configName:"jest-formatting",dependencies:["jest","eslint-plugin-jest-formatting"]},{configName:"tailwindcss",dependencies:["tailwindcss"]},{configName:"testing-library",dependencies:["@testing-library/dom","eslint-plugin-testing-library"]},{configName:"testing-library",dependencies:["react","@testing-library/react","eslint-plugin-testing-library"]},{configName:"typescript",dependencies:["typescript"]},{configName:"typescript-sort-keys",dependencies:["typescript","eslint-plugin-typescript-sort-keys"]},{configName:"vitest",dependencies:["vitest","eslint-plugin-vitest"]},{configName:"zod",dependencies:["zod","eslint-plugin-zod"]},{configName:"ava",dependencies:["ava","eslint-plugin-ava"]}],u=[...E],f={},y={};pkg&&(y=pkg?.anolilab?.["eslint-config"]);L.forEach(e=>{let{dependencies:n,configName:o}=e;if(y?.plugin?.[o]!==!1){let r=[];n.forEach(s=>{(hasDependency(s)||hasDevDependency(s))&&r.push(s);}),r.length===n.length?u.push(o):(f[o]={},n.forEach(s=>{f[o][s]=hasDependency(s)||hasDevDependency(s);}));}});var b=v,l=u,h=f;var R={"unicorn/prefer-spread":{"5.0.0":"off"},"unicorn/no-new-buffer":{"5.10.0":"off"},"prefer-rest-params":{"6.0.0":"off"},"prefer-destructuring":{"6.0.0":"off"},"promise/prefer-await-to-then":{"7.6.0":"off"},"prefer-object-spread":{"8.3.0":"off"},"n/prefer-global/url-search-params":{"10.0.0":"off"},"n/prefer-global/url":{"10.0.0":"off"},"no-useless-catch":{"10.0.0":"off"},"prefer-named-capture-group":{"10.0.0":"off"},"n/prefer-global/text-encoder":{"11.0.0":"off"},"n/prefer-global/text-decoder":{"11.0.0":"off"},"unicorn/prefer-flat-map":{"11.0.0":"off"},"n/prefer-promises/dns":{"11.14.0":"off"},"n/prefer-promises/fs":{"11.14.0":"off"}},j=R;if(!global.hasAnolilabEsLintConfigLoaded){process.env.DEBUG&&(b$1(`
8
8
  @anolilab/eslint-config loaded the following plugins:
9
9
  `),b$1(" @rushstack/eslint-plugin-security"),["compat","eslint-comments","i","optimize-regex","promise","simple-import-sort","unicorn","no-secrets","sonarjs","json","jsonc","markdown","toml","yml","es",...l].forEach(n=>a$1(n)));let e=!1;Object.entries(h).forEach(([n,o])=>{Object.values(o).some(Boolean)&&(e=!0,b$1(`
10
10
  Your package.json container dependencies for the "${n}" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`),Object.entries(o).forEach(([s,_])=>{_||b$1(` ${s}`);}));}),e&&(b$1(`
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/config.ts","../src/engine-node-overwrite.ts"],"names":["hasAnyDep","packageIsTypeModule","pkg","join","semver","hasDependency","hasDevDependency","baseConfig","internalPluginConfig","pluginConfig","loadedPlugins","possiblePlugins","anolilabEslintConfig","plugin","dependencies","configName","foundDependencies","dependency","rules","pluginRules","possiblePluginRules","engineRules","engine_node_overwrite_default","consoleLog","consolePlugin","hasLogged","installed","configRules","nodeVersion","rule","ruleConfig","minVersion","config","src_default"],"mappings":"gDAMA,MAAO,mDAEP,OAAS,aAAAA,EAAW,uBAAAC,EAAqB,OAAAC,MAAW,+BAEpD,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAY,SCXnB,OAAS,iBAAAC,EAAe,oBAAAC,EAAkB,OAAAJ,MAAW,+BAIrD,IAAMK,EAAa,CAAC,iBAAkB,SAAU,QAAS,MAAO,WAAW,EAErEC,EAAuB,CACzB,SACA,kBACA,SACA,iBACA,UACA,qBACA,mBACA,OAEA,aACA,UACA,WAEA,QACA,WACA,OACA,MACA,OAGA,QACA,UACA,IACJ,EAEMC,EAA6B,CAC/B,CACI,WAAY,aACZ,aAAc,CAAC,0BAA0B,CAC7C,EACA,CACI,WAAY,QACZ,aAAc,CAAC,qBAAqB,CACxC,EACA,CACI,WAAY,QAC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H,GAAG0B,CACP,EACA,UAAW,CACP,CACI,MAAO,CAAC,yBAAyB,EACjC,MAAO,CACH,wBAAyB,KAC7B,CACJ,EACA,CACI,MAAO,CAEH,wBACA,wBAGA,6BACA,6BAGA,uBACJ,EACA,MAAO,CACH,mBAAoB,MACpB,8BAA+B,KACnC,CACJ,CACJ,EACA,eAAgB,CACZ,MAEA,QACA,gBACA,oBACA,iBACA,QAEA,WACA,YACA,eACA,UAEA,SACA,QACA,OAEA,aAKA,QACJ,CACJ,EAEOM,EAAQD","sourcesContent":["/**\n * @rushstack/eslint-patch is used to include plugins as dev\n * dependencies instead of imposing them as peer dependencies\n *\n * https://www.npmjs.com/package/@rushstack/eslint-patch\n */\nimport \"@rushstack/eslint-patch/modern-module-resolution\";\n\nimport { hasAnyDep, packageIsTypeModule, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\nimport { join } from \"node:path\";\nimport semver from \"semver\";\n\nimport { pluginRules, possiblePluginRules, rules } from \"./config\";\nimport engineRules from \"./engine-node-overwrite\";\nimport { consoleLog, consolePlugin } from \"./utils/loggers\";\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigLoaded) {\n if (process.env[\"DEBUG\"]) {\n consoleLog(\"\\n@anolilab/eslint-config loaded the following plugins:\\n\");\n\n consoleLog(\" @rushstack/eslint-plugin-security\");\n [\n \"compat\",\n \"eslint-comments\",\n \"i\",\n \"optimize-regex\",\n \"promise\",\n \"simple-import-sort\",\n \"unicorn\",\n \"no-secrets\",\n \"sonarjs\",\n \"json\",\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"es\",\n ...pluginRules,\n ].forEach((plugin) => consolePlugin(plugin));\n }\n\n let hasLogged = false;\n\n Object.entries(possiblePluginRules).forEach(([plugin, dependencies]) => {\n const hasOneDependency = Object.values(dependencies).some(Boolean);\n\n if (hasOneDependency) {\n hasLogged = true;\n consoleLog(\n `\\nYour package.json container dependencies for the \"${plugin}\" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`,\n );\n\n Object.entries(dependencies).forEach(([dependency, installed]) => {\n if (!installed) {\n consoleLog(` ${dependency}`);\n }\n });\n }\n });\n\n if (hasLogged) {\n consoleLog(\"\\nTo disable this message, add the following to your package.json:\");\n consoleLog(' \"anolilab\": { \"eslint-config\": { plugin: { \"plugin-name\": false } } }\\n');\n }\n\n consoleLog('To disable all logging, add the following to your eslint command call \"NO_LOGS=true eslint ...\"');\n\n global.hasAnolilabEsLintConfigLoaded = true;\n}\n\nlet configRules: Linter.RulesRecord = {};\nlet nodeVersion: string | undefined;\n\nif (pkg?.engines?.[\"node\"]) {\n nodeVersion = pkg.engines[\"node\"];\n}\n\nlet anolilabEslintConfig: { [key: string]: boolean | undefined } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\nObject.entries(engineRules).forEach(([rule, ruleConfig]) => {\n Object.keys(ruleConfig)\n .sort(semver.rcompare)\n .forEach((minVersion) => {\n if (nodeVersion && semver.intersects(nodeVersion, `<${minVersion}`)) {\n configRules[rule] = ruleConfig[minVersion as keyof typeof ruleConfig] as Linter.RuleEntry;\n }\n });\n});\n\nif (\n hasAnyDep([\"prettier\"], {\n peerDeps: false,\n })\n) {\n // Workaround VS Code trying to run this file twice!\n if (!global.hasAnolilabEsLintConfigPrettier) {\n global.hasAnolilabEsLintConfigPrettier = true;\n\n if (anolilabEslintConfig?.[\"info_on_disabling_prettier_conflict_rule\"] !== false) {\n consoleLog(\"\\nFound prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier\");\n }\n }\n\n configRules = {\n ...configRules,\n\n // The following rules can be used in some cases. See the README for more\n // information. (These are marked with `0` instead of `\"off\"` so that a\n // script can distinguish them.)\n curly: 0,\n \"lines-around-comment\": 0,\n \"max-len\": 0,\n \"no-confusing-arrow\": 0,\n \"no-mixed-operators\": 0,\n \"no-tabs\": 0,\n \"no-unexpected-multiline\": 0,\n quotes: 0,\n\n // The rest are rules that you never need to enable when using Prettier.\n \"array-bracket-newline\": \"off\",\n \"array-bracket-spacing\": \"off\",\n \"array-element-newline\": \"off\",\n \"arrow-parens\": \"off\",\n \"arrow-spacing\": \"off\",\n \"block-spacing\": \"off\",\n \"brace-style\": \"off\",\n \"comma-dangle\": \"off\",\n \"comma-spacing\": \"off\",\n \"comma-style\": \"off\",\n \"computed-property-spacing\": \"off\",\n \"dot-location\": \"off\",\n \"eol-last\": \"off\",\n \"func-call-spacing\": \"off\",\n \"function-call-argument-newline\": \"off\",\n \"function-paren-newline\": \"off\",\n \"generator-star-spacing\": \"off\",\n \"implicit-arrow-linebreak\": \"off\",\n indent: \"off\",\n \"jsx-quotes\": \"off\",\n \"key-spacing\": \"off\",\n \"keyword-spacing\": \"off\",\n \"linebreak-style\": \"off\",\n \"multiline-ternary\": \"off\",\n \"newline-per-chained-call\": \"off\",\n \"new-parens\": \"off\",\n \"no-extra-parens\": \"off\",\n \"no-extra-semi\": \"off\",\n \"no-floating-decimal\": \"off\",\n \"no-mixed-spaces-and-tabs\": \"off\",\n \"no-multi-spaces\": \"off\",\n \"no-multiple-empty-lines\": \"off\",\n \"no-trailing-spaces\": \"off\",\n \"no-whitespace-before-property\": \"off\",\n \"nonblock-statement-body-position\": \"off\",\n \"object-curly-newline\": \"off\",\n \"object-curly-spacing\": \"off\",\n \"object-property-newline\": \"off\",\n \"one-var-declaration-per-line\": \"off\",\n \"operator-linebreak\": \"off\",\n \"padded-blocks\": \"off\",\n \"quote-props\": \"off\",\n \"rest-spread-spacing\": \"off\",\n semi: \"off\",\n \"semi-spacing\": \"off\",\n \"semi-style\": \"off\",\n \"space-before-blocks\": \"off\",\n \"space-before-function-paren\": \"off\",\n \"space-in-parens\": \"off\",\n \"space-infix-ops\": \"off\",\n \"space-unary-ops\": \"off\",\n \"switch-colon-spacing\": \"off\",\n \"template-curly-spacing\": \"off\",\n \"template-tag-spacing\": \"off\",\n \"unicode-bom\": \"off\",\n \"wrap-iife\": \"off\",\n \"wrap-regex\": \"off\",\n \"yield-star-spacing\": \"off\",\n };\n}\n\nconst config: Linter.Config = {\n // After an .eslintrc.js file is loaded, ESLint will normally continue visiting all parent folders\n // to look for other .eslintrc.js files, and also consult a personal file ~/.eslintrc.js. If any files\n // are found, their options will be merged. This is difficult for humans to understand, and it will cause\n // nondeterministic behavior if files are loaded from outside the Git working folder.\n //\n // Setting root=true causes ESLint to stop looking for other config files after the first .eslintrc.js\n // is loaded.\n root: true,\n // Disable the parser by default\n parser: \"\",\n\n extends: [\n ...rules.map((plugin) => join(__dirname, `./config/${plugin}.${packageIsTypeModule ? \"m\" : \"\"}js`)),\n\n ...pluginRules.map((plugin) => join(__dirname, `./config/plugins/${plugin}.${packageIsTypeModule ? \"m\" : \"\"}js`)),\n ],\n rules: {\n ...configRules,\n },\n overrides: [\n {\n files: [\"**/migrations/*.{js,ts}\"],\n rules: {\n \"filenames/match-regex\": \"off\",\n },\n },\n {\n files: [\n // Test files\n \"**/*.spec.{js,ts,tsx}\",\n \"**/*.test.{js,ts,tsx}\",\n\n // Facebook convention\n \"**/__mocks__/*.{js,ts,tsx}\",\n \"**/__tests__/*.{js,ts,tsx}\",\n\n // Microsoft convention\n \"**/test/*.{js,ts,tsx}\",\n ],\n rules: {\n \"no-magic-numbers\": \"off\",\n \"sonarjs/no-duplicate-string\": \"off\",\n },\n },\n ],\n ignorePatterns: [\n \"!.*\",\n\n \".git/\",\n \"node_modules/\",\n \"bower_components/\",\n \"jspm_packages/\",\n \".npm/\",\n\n \"lib-cov/\",\n \"coverage/\",\n \".nyc_output/\",\n \".cache/\",\n\n \"build/\",\n \"dist/\",\n \"tmp/\",\n\n \"**/*.min.*\",\n\n // Manually authored .d.ts files are generally used to describe external APIs that are not expected\n // to follow our coding conventions. Linting those files tends to produce a lot of spurious suppressions,\n // so we simply ignore them.\n \"*.d.ts\",\n ],\n};\n\nexport default config;\n","import { hasDependency, hasDevDependency, pkg } from \"@anolilab/package-json-utils\";\n\nimport type { PackageRules } from \"./types\";\n\nconst baseConfig = [\"best-practices\", \"errors\", \"style\", \"es6\", \"variables\"];\n\nconst internalPluginConfig = [\n \"compat\",\n \"eslint-comments\",\n \"import\",\n \"optimize-regex\",\n \"promise\",\n \"simple-import-sort\",\n \"no-extend-native\",\n \"node\",\n // Security Rules\n \"no-secrets\",\n \"sonarjs\",\n \"security\",\n // file rules\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"html\",\n\n // custom rules\n \"antfu\",\n \"unicorn\",\n \"es\",\n];\n\nconst pluginConfig: PackageRules = [\n {\n configName: \"array-func\",\n dependencies: [\"eslint-plugin-array-func\"],\n },\n {\n configName: \"jsdoc\",\n dependencies: [\"eslint-plugin-jsdoc\"],\n },\n {\n configName: \"tsdoc\",\n dependencies: [\"eslint-plugin-tsdoc\", \"typescript\"],\n },\n {\n configName: \"lodash\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash\"],\n },\n {\n configName: \"lodash-fp\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash-fp\"],\n },\n {\n configName: \"you-dont-need-lodash-underscore\",\n dependencies: [\"lodash\", \"eslint-plugin-you-dont-need-lodash-underscore\"],\n },\n {\n configName: \"mdx\",\n dependencies: [\"eslint-plugin-mdx\"],\n },\n {\n configName: \"no-unsanitized\",\n dependencies: [\"eslint-plugin-no-unsanitized\"],\n },\n {\n configName: \"react\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react\"],\n },\n {\n configName: \"react-redux\",\n dependencies: [\"eslint-plugin-react-redux\"],\n },\n {\n configName: \"jsx-a11y\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-jsx-a11y\"],\n },\n {\n configName: \"react-hooks\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react-hooks\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment-timezone\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"eslint-plugin-tailwindcss\"],\n },\n {\n configName: \"cypress\",\n dependencies: [\"eslint-plugin-cypress\"],\n },\n {\n configName: \"jest\",\n dependencies: [\"jest\", \"eslint-plugin-jest\"],\n },\n {\n configName: \"jest-dom\",\n dependencies: [\"jest\", \"@testing-library/jest-dom\", \"eslint-plugin-jest-dom\"],\n },\n {\n configName: \"jest-async\",\n dependencies: [\"jest\", \"eslint-plugin-jest-async\"],\n },\n {\n configName: \"jest-formatting\",\n dependencies: [\"jest\", \"eslint-plugin-jest-formatting\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"tailwindcss\"],\n },\n {\n configName: \"testing-library\",\n dependencies: [\"@testing-library/dom\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"typescript\",\n dependencies: [\"typescript\"],\n },\n {\n configName: \"typescript-sort-keys\",\n dependencies: [\"typescript\", \"eslint-plugin-typescript-sort-keys\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\"],\n },\n {\n configName: \"zod\",\n dependencies: [\"zod\", \"eslint-plugin-zod\"],\n },\n {\n configName: \"ava\",\n dependencies: [\"ava\", \"eslint-plugin-ava\"],\n },\n];\n\nconst loadedPlugins: string[] = [...internalPluginConfig];\nconst possiblePlugins: { [rule: string]: { [packageName: string]: boolean } } = {};\n\nlet anolilabEslintConfig: { [key: string]: { [key: string]: false | undefined } } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\npluginConfig.forEach((plugin) => {\n const { dependencies, configName } = plugin;\n\n if (anolilabEslintConfig?.[\"plugin\"]?.[configName] !== false) {\n const foundDependencies = [];\n\n dependencies.forEach((dependency) => {\n if (hasDependency(dependency) || hasDevDependency(dependency)) {\n foundDependencies.push(dependency);\n }\n });\n\n if (foundDependencies.length === dependencies.length) {\n loadedPlugins.push(configName);\n } else {\n possiblePlugins[configName] = {};\n\n dependencies.forEach((dependency) => {\n (possiblePlugins[configName] as { [key: string]: boolean })[dependency] = hasDependency(dependency) || hasDevDependency(dependency);\n });\n }\n }\n});\n\nexport const rules = baseConfig;\nexport const pluginRules = loadedPlugins;\n\nexport const possiblePluginRules = possiblePlugins;\n","/**\nDefine the rules config that are overwritten only for specific version of Node.js based on `engines.node` in package.json or the `nodeVersion` option.\n\nThe keys are rule names and the values are an Object with a valid semver (`4.0.0` is valid `4` is not) as keys and the rule configuration as values.\n\nEach entry define the rule config and the maximum Node.js version for which to set it.\nThe entry with the lowest version that is compliant with the `engines.node`/`nodeVersion` range will be used.\n\n@type {Object}\n\n@example\n```\n{\n 'plugin/rule': {\n '6.0.0': ['error', {prop: 'node-6-conf'}],\n '8.0.0': ['error', {prop: 'node-8-conf'}]\n }\n}\n```\n\nWith `engines.node` set to `>=4` the rule `plugin/rule` will not be used.\nWith `engines.node` set to `>=6` the rule `plugin/rule` will be used with the config `{prop: 'node-6-conf'}`.\nWith `engines.node` set to `>=8` the rule `plugin/rule` will be used with the config `{prop: 'node-8-conf'}`.\n*/\nconst engineRules = {\n \"unicorn/prefer-spread\": {\n \"5.0.0\": \"off\",\n },\n \"unicorn/no-new-buffer\": {\n \"5.10.0\": \"off\",\n },\n \"prefer-rest-params\": {\n \"6.0.0\": \"off\",\n },\n \"prefer-destructuring\": {\n \"6.0.0\": \"off\",\n },\n \"promise/prefer-await-to-then\": {\n \"7.6.0\": \"off\",\n },\n \"prefer-object-spread\": {\n \"8.3.0\": \"off\",\n },\n \"n/prefer-global/url-search-params\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/url\": {\n \"10.0.0\": \"off\",\n },\n \"no-useless-catch\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-named-capture-group\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/text-encoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/text-decoder\": {\n \"11.0.0\": \"off\",\n },\n \"unicorn/prefer-flat-map\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-promises/dns\": {\n \"11.14.0\": \"off\",\n },\n \"n/prefer-promises/fs\": {\n \"11.14.0\": \"off\",\n },\n};\n\nexport default engineRules;\n"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/config.ts","../src/engine-node-overwrite.ts"],"names":["hasAnyDep","packageIsTypeModule","pkg","join","semver","hasDependency","hasDevDependency","baseConfig","internalPluginConfig","pluginConfig","loadedPlugins","possiblePlugins","anolilabEslintConfig","plugin","dependencies","configName","foundDependencies","dependency","rules","pluginRules","possiblePluginRules","engineRules","engine_node_overwrite_default","consoleLog","consolePlugin","hasLogged","installed","configRules","nodeVersion","rule","ruleConfig","minVersion","config","src_default"],"mappings":"gDAMA,MAAO,mDAEP,OAAS,aAAAA,EAAW,uBAAAC,EAAqB,OAAAC,MAAW,+BAEpD,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAY,SCXnB,OAAS,iBAAAC,EAAe,oBAAAC,EAAkB,OAAAJ,MAAW,+BAIrD,IAAMK,EAAa,CAAC,iBAAkB,SAAU,QAAS,MAAO,WAAW,EAErEC,EAAuB,CACzB,SACA,kBACA,SACA,iBACA,UACA,qBACA,mBACA,OAEA,aACA,UACA,WAEA,QACA,WACA,OACA,MACA,OAGA,QACA,UACA,IACJ,EAEMC,EAA6B,CAC/B,CACI,WAAY,aACZ,aAAc,CAAC,0BAA0B,CAC7C,EACA,CACI,WAAY,QACZ,aAAc,CAAC,qBAAqB,CACxC,EACA,CACI,WAAY,QACZ,aAAc,CAAC,sBAAuB,YAAY,CACtD,EACA,CACI,WAAY,SACZ,aAAc,CAAC,SAAU,sBAAsB,CACnD,EACA,CACI,WAAY,YACZ,aAAc,C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EACjC,MAAO,CACH,wBAAyB,KAC7B,CACJ,EACA,CACI,MAAO,CAEH,wBACA,wBAGA,6BACA,6BAGA,uBACJ,EACA,MAAO,CACH,mBAAoB,MACpB,8BAA+B,KACnC,CACJ,CACJ,EACA,eAAgB,CACZ,MAEA,QACA,gBACA,oBACA,iBACA,QAEA,WACA,YACA,eACA,UAEA,SACA,QACA,OAEA,aAKA,QACJ,CACJ,EAEOM,EAAQD","sourcesContent":["/**\n * @rushstack/eslint-patch is used to include plugins as dev\n * dependencies instead of imposing them as peer dependencies\n *\n * https://www.npmjs.com/package/@rushstack/eslint-patch\n */\nimport \"@rushstack/eslint-patch/modern-module-resolution\";\n\nimport { hasAnyDep, packageIsTypeModule, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\nimport { join } from \"node:path\";\nimport semver from \"semver\";\n\nimport { pluginRules, possiblePluginRules, rules } from \"./config\";\nimport engineRules from \"./engine-node-overwrite\";\nimport { consoleLog, consolePlugin } from \"./utils/loggers\";\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigLoaded) {\n if (process.env[\"DEBUG\"]) {\n consoleLog(\"\\n@anolilab/eslint-config loaded the following plugins:\\n\");\n\n consoleLog(\" @rushstack/eslint-plugin-security\");\n [\n \"compat\",\n \"eslint-comments\",\n \"i\",\n \"optimize-regex\",\n \"promise\",\n \"simple-import-sort\",\n \"unicorn\",\n \"no-secrets\",\n \"sonarjs\",\n \"json\",\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"es\",\n ...pluginRules,\n ].forEach((plugin) => consolePlugin(plugin));\n }\n\n let hasLogged = false;\n\n Object.entries(possiblePluginRules).forEach(([plugin, dependencies]) => {\n const hasOneDependency = Object.values(dependencies).some(Boolean);\n\n if (hasOneDependency) {\n hasLogged = true;\n consoleLog(\n `\\nYour package.json container dependencies for the \"${plugin}\" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`,\n );\n\n Object.entries(dependencies).forEach(([dependency, installed]) => {\n if (!installed) {\n consoleLog(` ${dependency}`);\n }\n });\n }\n });\n\n if (hasLogged) {\n consoleLog(\"\\nTo disable this message, add the following to your package.json:\");\n consoleLog(' \"anolilab\": { \"eslint-config\": { plugin: { \"plugin-name\": false } } }\\n');\n }\n\n consoleLog('To disable all logging, add the following to your eslint command call \"NO_LOGS=true eslint ...\"');\n\n global.hasAnolilabEsLintConfigLoaded = true;\n}\n\nlet configRules: Linter.RulesRecord = {};\nlet nodeVersion: string | undefined;\n\nif (pkg?.engines?.[\"node\"]) {\n nodeVersion = pkg.engines[\"node\"];\n}\n\nlet anolilabEslintConfig: { [key: string]: boolean | undefined } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\nObject.entries(engineRules).forEach(([rule, ruleConfig]) => {\n Object.keys(ruleConfig)\n .sort(semver.rcompare)\n .forEach((minVersion) => {\n if (nodeVersion && semver.intersects(nodeVersion, `<${minVersion}`)) {\n configRules[rule] = ruleConfig[minVersion as keyof typeof ruleConfig] as Linter.RuleEntry;\n }\n });\n});\n\nif (\n hasAnyDep([\"prettier\"], {\n peerDeps: false,\n })\n) {\n // Workaround VS Code trying to run this file twice!\n if (!global.hasAnolilabEsLintConfigPrettier) {\n global.hasAnolilabEsLintConfigPrettier = true;\n\n if (anolilabEslintConfig?.[\"info_on_disabling_prettier_conflict_rule\"] !== false) {\n consoleLog(\"\\nFound prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier\");\n }\n }\n\n configRules = {\n ...configRules,\n\n // The following rules can be used in some cases. See the README for more\n // information. (These are marked with `0` instead of `\"off\"` so that a\n // script can distinguish them.)\n curly: 0,\n \"lines-around-comment\": 0,\n \"max-len\": 0,\n \"no-confusing-arrow\": 0,\n \"no-mixed-operators\": 0,\n \"no-tabs\": 0,\n \"no-unexpected-multiline\": 0,\n quotes: 0,\n\n // The rest are rules that you never need to enable when using Prettier.\n \"array-bracket-newline\": \"off\",\n \"array-bracket-spacing\": \"off\",\n \"array-element-newline\": \"off\",\n \"arrow-parens\": \"off\",\n \"arrow-spacing\": \"off\",\n \"block-spacing\": \"off\",\n \"brace-style\": \"off\",\n \"comma-dangle\": \"off\",\n \"comma-spacing\": \"off\",\n \"comma-style\": \"off\",\n \"computed-property-spacing\": \"off\",\n \"dot-location\": \"off\",\n \"eol-last\": \"off\",\n \"func-call-spacing\": \"off\",\n \"function-call-argument-newline\": \"off\",\n \"function-paren-newline\": \"off\",\n \"generator-star-spacing\": \"off\",\n \"implicit-arrow-linebreak\": \"off\",\n indent: \"off\",\n \"jsx-quotes\": \"off\",\n \"key-spacing\": \"off\",\n \"keyword-spacing\": \"off\",\n \"linebreak-style\": \"off\",\n \"multiline-ternary\": \"off\",\n \"newline-per-chained-call\": \"off\",\n \"new-parens\": \"off\",\n \"no-extra-parens\": \"off\",\n \"no-extra-semi\": \"off\",\n \"no-floating-decimal\": \"off\",\n \"no-mixed-spaces-and-tabs\": \"off\",\n \"no-multi-spaces\": \"off\",\n \"no-multiple-empty-lines\": \"off\",\n \"no-trailing-spaces\": \"off\",\n \"no-whitespace-before-property\": \"off\",\n \"nonblock-statement-body-position\": \"off\",\n \"object-curly-newline\": \"off\",\n \"object-curly-spacing\": \"off\",\n \"object-property-newline\": \"off\",\n \"one-var-declaration-per-line\": \"off\",\n \"operator-linebreak\": \"off\",\n \"padded-blocks\": \"off\",\n \"quote-props\": \"off\",\n \"rest-spread-spacing\": \"off\",\n semi: \"off\",\n \"semi-spacing\": \"off\",\n \"semi-style\": \"off\",\n \"space-before-blocks\": \"off\",\n \"space-before-function-paren\": \"off\",\n \"space-in-parens\": \"off\",\n \"space-infix-ops\": \"off\",\n \"space-unary-ops\": \"off\",\n \"switch-colon-spacing\": \"off\",\n \"template-curly-spacing\": \"off\",\n \"template-tag-spacing\": \"off\",\n \"unicode-bom\": \"off\",\n \"wrap-iife\": \"off\",\n \"wrap-regex\": \"off\",\n \"yield-star-spacing\": \"off\",\n };\n}\n\nconst config: Linter.Config = {\n // After an .eslintrc.js file is loaded, ESLint will normally continue visiting all parent folders\n // to look for other .eslintrc.js files, and also consult a personal file ~/.eslintrc.js. If any files\n // are found, their options will be merged. This is difficult for humans to understand, and it will cause\n // nondeterministic behavior if files are loaded from outside the Git working folder.\n //\n // Setting root=true causes ESLint to stop looking for other config files after the first .eslintrc.js\n // is loaded.\n root: true,\n // Disable the parser by default\n parser: \"\",\n\n extends: [\n ...rules.map((plugin) => join(__dirname, `./config/${plugin}.${packageIsTypeModule ? \"m\" : \"\"}js`)),\n\n ...pluginRules.map((plugin) => join(__dirname, `./config/plugins/${plugin}.${packageIsTypeModule ? \"m\" : \"\"}js`)),\n ],\n rules: {\n ...configRules,\n },\n overrides: [\n {\n files: [\"**/migrations/*.{js,ts}\"],\n rules: {\n \"filenames/match-regex\": \"off\",\n },\n },\n {\n files: [\n // Test files\n \"**/*.spec.{js,ts,tsx}\",\n \"**/*.test.{js,ts,tsx}\",\n\n // Facebook convention\n \"**/__mocks__/*.{js,ts,tsx}\",\n \"**/__tests__/*.{js,ts,tsx}\",\n\n // Microsoft convention\n \"**/test/*.{js,ts,tsx}\",\n ],\n rules: {\n \"no-magic-numbers\": \"off\",\n \"sonarjs/no-duplicate-string\": \"off\",\n },\n },\n ],\n ignorePatterns: [\n \"!.*\",\n\n \".git/\",\n \"node_modules/\",\n \"bower_components/\",\n \"jspm_packages/\",\n \".npm/\",\n\n \"lib-cov/\",\n \"coverage/\",\n \".nyc_output/\",\n \".cache/\",\n\n \"build/\",\n \"dist/\",\n \"tmp/\",\n\n \"**/*.min.*\",\n\n // Manually authored .d.ts files are generally used to describe external APIs that are not expected\n // to follow our coding conventions. Linting those files tends to produce a lot of spurious suppressions,\n // so we simply ignore them.\n \"*.d.ts\",\n ],\n};\n\nexport default config;\n","import { hasDependency, hasDevDependency, pkg } from \"@anolilab/package-json-utils\";\n\nimport type { PackageRules } from \"./types\";\n\nconst baseConfig = [\"best-practices\", \"errors\", \"style\", \"es6\", \"variables\"];\n\nconst internalPluginConfig = [\n \"compat\",\n \"eslint-comments\",\n \"import\",\n \"optimize-regex\",\n \"promise\",\n \"simple-import-sort\",\n \"no-extend-native\",\n \"node\",\n // Security Rules\n \"no-secrets\",\n \"sonarjs\",\n \"security\",\n // file rules\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"html\",\n\n // custom rules\n \"antfu\",\n \"unicorn\",\n \"es\",\n];\n\nconst pluginConfig: PackageRules = [\n {\n configName: \"array-func\",\n dependencies: [\"eslint-plugin-array-func\"],\n },\n {\n configName: \"jsdoc\",\n dependencies: [\"eslint-plugin-jsdoc\"],\n },\n {\n configName: \"tsdoc\",\n dependencies: [\"eslint-plugin-tsdoc\", \"typescript\"],\n },\n {\n configName: \"lodash\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash\"],\n },\n {\n configName: \"lodash-fp\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash-fp\"],\n },\n {\n configName: \"you-dont-need-lodash-underscore\",\n dependencies: [\"lodash\", \"eslint-plugin-you-dont-need-lodash-underscore\"],\n },\n {\n configName: \"mdx\",\n dependencies: [\"eslint-plugin-mdx\"],\n },\n {\n configName: \"no-unsanitized\",\n dependencies: [\"eslint-plugin-no-unsanitized\"],\n },\n {\n configName: \"react\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react\"],\n },\n {\n configName: \"react-redux\",\n dependencies: [\"eslint-plugin-react-redux\"],\n },\n {\n configName: \"jsx-a11y\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-jsx-a11y\"],\n },\n {\n configName: \"react-hooks\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react-hooks\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment-timezone\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"eslint-plugin-tailwindcss\"],\n },\n {\n configName: \"cypress\",\n dependencies: [\"eslint-plugin-cypress\"],\n },\n {\n configName: \"jest\",\n dependencies: [\"jest\", \"eslint-plugin-jest\"],\n },\n {\n configName: \"jest-dom\",\n dependencies: [\"jest\", \"@testing-library/jest-dom\", \"eslint-plugin-jest-dom\"],\n },\n {\n configName: \"jest-async\",\n dependencies: [\"jest\", \"eslint-plugin-jest-async\"],\n },\n {\n configName: \"jest-formatting\",\n dependencies: [\"jest\", \"eslint-plugin-jest-formatting\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"tailwindcss\"],\n },\n {\n configName: \"testing-library\",\n dependencies: [\"@testing-library/dom\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"testing-library\",\n dependencies: [\"react\", \"@testing-library/react\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"typescript\",\n dependencies: [\"typescript\"],\n },\n {\n configName: \"typescript-sort-keys\",\n dependencies: [\"typescript\", \"eslint-plugin-typescript-sort-keys\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\"],\n },\n {\n configName: \"zod\",\n dependencies: [\"zod\", \"eslint-plugin-zod\"],\n },\n {\n configName: \"ava\",\n dependencies: [\"ava\", \"eslint-plugin-ava\"],\n },\n];\n\nconst loadedPlugins: string[] = [...internalPluginConfig];\nconst possiblePlugins: { [rule: string]: { [packageName: string]: boolean } } = {};\n\nlet anolilabEslintConfig: { [key: string]: { [key: string]: false | undefined } } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\npluginConfig.forEach((plugin) => {\n const { dependencies, configName } = plugin;\n\n if (anolilabEslintConfig?.[\"plugin\"]?.[configName] !== false) {\n const foundDependencies = [];\n\n dependencies.forEach((dependency) => {\n if (hasDependency(dependency) || hasDevDependency(dependency)) {\n foundDependencies.push(dependency);\n }\n });\n\n if (foundDependencies.length === dependencies.length) {\n loadedPlugins.push(configName);\n } else {\n possiblePlugins[configName] = {};\n\n dependencies.forEach((dependency) => {\n (possiblePlugins[configName] as { [key: string]: boolean })[dependency] = hasDependency(dependency) || hasDevDependency(dependency);\n });\n }\n }\n});\n\nexport const rules = baseConfig;\nexport const pluginRules = loadedPlugins;\n\nexport const possiblePluginRules = possiblePlugins;\n","/**\nDefine the rules config that are overwritten only for specific version of Node.js based on `engines.node` in package.json or the `nodeVersion` option.\n\nThe keys are rule names and the values are an Object with a valid semver (`4.0.0` is valid `4` is not) as keys and the rule configuration as values.\n\nEach entry define the rule config and the maximum Node.js version for which to set it.\nThe entry with the lowest version that is compliant with the `engines.node`/`nodeVersion` range will be used.\n\n@type {Object}\n\n@example\n```\n{\n 'plugin/rule': {\n '6.0.0': ['error', {prop: 'node-6-conf'}],\n '8.0.0': ['error', {prop: 'node-8-conf'}]\n }\n}\n```\n\nWith `engines.node` set to `>=4` the rule `plugin/rule` will not be used.\nWith `engines.node` set to `>=6` the rule `plugin/rule` will be used with the config `{prop: 'node-6-conf'}`.\nWith `engines.node` set to `>=8` the rule `plugin/rule` will be used with the config `{prop: 'node-8-conf'}`.\n*/\nconst engineRules = {\n \"unicorn/prefer-spread\": {\n \"5.0.0\": \"off\",\n },\n \"unicorn/no-new-buffer\": {\n \"5.10.0\": \"off\",\n },\n \"prefer-rest-params\": {\n \"6.0.0\": \"off\",\n },\n \"prefer-destructuring\": {\n \"6.0.0\": \"off\",\n },\n \"promise/prefer-await-to-then\": {\n \"7.6.0\": \"off\",\n },\n \"prefer-object-spread\": {\n \"8.3.0\": \"off\",\n },\n \"n/prefer-global/url-search-params\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/url\": {\n \"10.0.0\": \"off\",\n },\n \"no-useless-catch\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-named-capture-group\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/text-encoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/text-decoder\": {\n \"11.0.0\": \"off\",\n },\n \"unicorn/prefer-flat-map\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-promises/dns\": {\n \"11.14.0\": \"off\",\n },\n \"n/prefer-promises/fs\": {\n \"11.14.0\": \"off\",\n },\n};\n\nexport default engineRules;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/eslint-config",
3
- "version": "6.1.7",
3
+ "version": "6.1.8",
4
4
  "description": "ESLint shareable config for the Anolilab JavaScript style guide.",
5
5
  "keywords": [
6
6
  "anolilab",