@anolilab/eslint-config 11.3.1 → 11.3.2

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,15 @@
1
+ ## @anolilab/eslint-config [11.3.2](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@11.3.1...@anolilab/eslint-config@11.3.2) (2023-08-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Add second "vitest" configuration in eslint-config with eslint-plugin-vitest-globals check ([78105cf](https://github.com/anolilab/javascript-style-guide/commit/78105cf64b049245aa292b3c82e859661ce23c0d))
7
+
8
+
9
+ ### Miscellaneous Chores
10
+
11
+ * **deps:** update dependency eslint-plugin-testing-library to v6 ([#731](https://github.com/anolilab/javascript-style-guide/issues/731)) ([5643435](https://github.com/anolilab/javascript-style-guide/commit/56434350afc2f092569e74c9c5bac36e9ecec700))
12
+
1
13
  ## @anolilab/eslint-config [11.3.1](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@11.3.0...@anolilab/eslint-config@11.3.1) (2023-08-14)
2
14
 
3
15
 
package/dist/index.js CHANGED
@@ -5,22 +5,22 @@ var chunkOCCLNRZC_js = require('./chunk-OCCLNRZC.js');
5
5
  require('./chunk-MFE6DF6Y.js');
6
6
  require('@rushstack/eslint-patch/modern-module-resolution');
7
7
  var packageJsonUtils = require('@anolilab/package-json-utils');
8
- var x = require('globals');
8
+ var N = require('globals');
9
9
  var path = require('path');
10
10
  var k = require('semver');
11
11
 
12
12
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
13
 
14
- var x__default = /*#__PURE__*/_interopDefault(x);
14
+ var N__default = /*#__PURE__*/_interopDefault(N);
15
15
  var k__default = /*#__PURE__*/_interopDefault(k);
16
16
 
17
- var R=["best-practices","errors","style","es6","variables"],c=["compat","eslint-comments","import","promise","simple-import-sort","no-extend-native","node","no-secrets","sonarjs","security","regexp","jsonc","markdown","toml","yml","html","antfu","unicorn","es","perfectionist"],E=[{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"],oneOfDependency:["nextra","docz","@docusaurus/core","gatsby-plugin-mdx"],resolve:["@mdx-js/mdx","remark-mdx","@mdx-js/loader","@mdx-js/rollup","@mdx-js/react"]},{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"],oneOfDependency:["@reduxjs/toolkit","redux"]},{configName:"jsx-a11y",dependencies:["react","react-dom","eslint-plugin-jsx-a11y"]},{configName:"react-hooks",dependencies:["react","react-dom","eslint-plugin-react-hooks"]},{configName:"react-usememo",dependencies:["react","react-dom","@arthurgeron/eslint-plugin-react-usememo"]},{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:["cypress","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-dom",dependencies:["@testing-library/dom","eslint-plugin-testing-library"]},{configName:"testing-library-react",dependencies:["react","@testing-library/react","eslint-plugin-testing-library"]},{configName:"typescript",dependencies:["typescript"],files:["tsconfig.json","tsconfig.eslint.json"]},{configName:"etc",dependencies:["typescript","eslint-plugin-etc"]},{configName:"vitest",dependencies:["vitest","eslint-plugin-vitest","eslint-plugin-vitest-globals"]},{configName:"zod",dependencies:["zod","eslint-plugin-zod"]},{configName:"ava",dependencies:["ava","eslint-plugin-ava"]},{configName:"editorconfig",dependencies:["eslint-plugin-editorconfig"],files:[".editorconfig"]},{configName:"storybook",dependencies:["storybook","eslint-plugin-storybook"]},{configName:"playwright",dependencies:["playwright","eslint-plugin-playwright"]},{configName:"tanstack-query",dependencies:["@tanstack/react-query","@tanstack/eslint-plugin-query"]}],p=[...c],t={};p.length===c.length&&E.forEach(s=>{let{configName:e,dependencies:i}=s;if(chunkOCCLNRZC_js.a.plugin?.[e]!==!1){let a=[];if(i.forEach(n=>{(packageJsonUtils.hasDependency(n)||packageJsonUtils.hasDevDependency(n))&&a.push(n);}),t[e]={},a.length===0){if(s.oneOfDependency!==void 0){let n=!1;s.oneOfDependency.forEach(r=>{!n&&(packageJsonUtils.hasDependency(r)||packageJsonUtils.hasDevDependency(r))&&(n=!0,t[e][r]=!0);});}s.resolve!==void 0&&s.resolve.forEach(n=>{packageJsonUtils.resolvePackage(n)!==void 0&&(t[e][n]=!0);}),s.files!==void 0&&s.files.forEach(n=>{packageJsonUtils.hasFile(n)&&(t[e][n]=!0);});}a.length===i.length?(delete t[e],p.push(e)):i.forEach(n=>{t[e][n]=packageJsonUtils.hasDependency(n)||packageJsonUtils.hasDevDependency(n);});}});var m=R,b=p,h=t;var O={"n/prefer-global/text-decoder":{"11.0.0":"off"},"n/prefer-global/text-encoder":{"11.0.0":"off"},"n/prefer-global/url":{"10.0.0":"off"},"n/prefer-global/url-search-params":{"10.0.0":"off"},"n/prefer-promises/dns":{"11.14.0":"off"},"n/prefer-promises/fs":{"11.14.0":"off"},"no-useless-catch":{"10.0.0":"off"},"prefer-destructuring":{"6.0.0":"off"},"prefer-named-capture-group":{"10.0.0":"off"},"prefer-object-spread":{"8.3.0":"off"},"prefer-rest-params":{"6.0.0":"off"},"promise/prefer-await-to-then":{"7.6.0":"off"},"unicorn/no-new-buffer":{"5.10.0":"off"},"unicorn/prefer-flat-map":{"11.0.0":"off"},"unicorn/prefer-spread":{"5.0.0":"off"}},y=O;if(!global.hasAnolilabEsLintConfigLoaded){process.env.DEBUG&&(chunkSEYYGHPU_js.b(`
17
+ var R=["best-practices","errors","style","es6","variables"],c=["compat","eslint-comments","import","promise","simple-import-sort","no-extend-native","node","no-secrets","sonarjs","security","regexp","jsonc","markdown","toml","yml","html","antfu","unicorn","es","perfectionist"],E=[{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"],oneOfDependency:["nextra","docz","@docusaurus/core","gatsby-plugin-mdx"],resolve:["@mdx-js/mdx","remark-mdx","@mdx-js/loader","@mdx-js/rollup","@mdx-js/react"]},{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"],oneOfDependency:["@reduxjs/toolkit","redux"]},{configName:"jsx-a11y",dependencies:["react","react-dom","eslint-plugin-jsx-a11y"]},{configName:"react-hooks",dependencies:["react","react-dom","eslint-plugin-react-hooks"]},{configName:"react-usememo",dependencies:["react","react-dom","@arthurgeron/eslint-plugin-react-usememo"]},{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:["cypress","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-dom",dependencies:["@testing-library/dom","eslint-plugin-testing-library"]},{configName:"testing-library-react",dependencies:["react","@testing-library/react","eslint-plugin-testing-library"]},{configName:"typescript",dependencies:["typescript"],files:["tsconfig.json","tsconfig.eslint.json"]},{configName:"etc",dependencies:["typescript","eslint-plugin-etc"]},{configName:"vitest",dependencies:["vitest","eslint-plugin-vitest"]},{configName:"vitest",dependencies:["vitest","eslint-plugin-vitest","eslint-plugin-vitest-globals"]},{configName:"zod",dependencies:["zod","eslint-plugin-zod"]},{configName:"ava",dependencies:["ava","eslint-plugin-ava"]},{configName:"editorconfig",dependencies:["eslint-plugin-editorconfig"],files:[".editorconfig"]},{configName:"storybook",dependencies:["storybook","eslint-plugin-storybook"]},{configName:"playwright",dependencies:["playwright","eslint-plugin-playwright"]},{configName:"tanstack-query",dependencies:["@tanstack/react-query","@tanstack/eslint-plugin-query"]}],p=[...c],t={};p.length===c.length&&E.forEach(s=>{let{configName:e,dependencies:i}=s;if(chunkOCCLNRZC_js.a.plugin?.[e]!==!1){let a=[];if(i.forEach(n=>{(packageJsonUtils.hasDependency(n)||packageJsonUtils.hasDevDependency(n))&&a.push(n);}),t[e]={},a.length===0){if(s.oneOfDependency!==void 0){let n=!1;s.oneOfDependency.forEach(r=>{!n&&(packageJsonUtils.hasDependency(r)||packageJsonUtils.hasDevDependency(r))&&(n=!0,t[e][r]=!0);});}s.resolve!==void 0&&s.resolve.forEach(n=>{packageJsonUtils.resolvePackage(n)!==void 0&&(t[e][n]=!0);}),s.files!==void 0&&s.files.forEach(n=>{packageJsonUtils.hasFile(n)&&(t[e][n]=!0);});}a.length===i.length?(delete t[e],p.push(e)):i.forEach(n=>{t[e][n]=packageJsonUtils.hasDependency(n)||packageJsonUtils.hasDevDependency(n);});}});var m=R,b=p,h=t;var O={"n/prefer-global/text-decoder":{"11.0.0":"off"},"n/prefer-global/text-encoder":{"11.0.0":"off"},"n/prefer-global/url":{"10.0.0":"off"},"n/prefer-global/url-search-params":{"10.0.0":"off"},"n/prefer-promises/dns":{"11.14.0":"off"},"n/prefer-promises/fs":{"11.14.0":"off"},"no-useless-catch":{"10.0.0":"off"},"prefer-destructuring":{"6.0.0":"off"},"prefer-named-capture-group":{"10.0.0":"off"},"prefer-object-spread":{"8.3.0":"off"},"prefer-rest-params":{"6.0.0":"off"},"promise/prefer-await-to-then":{"7.6.0":"off"},"unicorn/no-new-buffer":{"5.10.0":"off"},"unicorn/prefer-flat-map":{"11.0.0":"off"},"unicorn/prefer-spread":{"5.0.0":"off"}},y=O;if(!global.hasAnolilabEsLintConfigLoaded){process.env.DEBUG&&(chunkSEYYGHPU_js.b(`
18
18
  @anolilab/eslint-config loaded the following plugins:
19
19
  `),chunkSEYYGHPU_js.b(" @rushstack/eslint-plugin-security"),c.map(e=>e==="import"?"i":e==="node"?"n":e).forEach(e=>chunkSEYYGHPU_js.a(e)));let s=!1;Object.entries(h).forEach(([e,i])=>{Object.values(i).some(Boolean)&&(s=!0,chunkSEYYGHPU_js.b(`
20
20
  Your package.json container dependencies for the "${e}" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`),Object.entries(i).forEach(([n,r])=>{r||chunkSEYYGHPU_js.b(` ${n}`);}));}),s&&(chunkSEYYGHPU_js.b(`
21
21
  To disable this message, add the following to your package.json:`),chunkSEYYGHPU_js.b(` "anolilab": { "eslint-config": { plugin: { "plugin-name": false } } }
22
22
  `)),chunkSEYYGHPU_js.b('To disable all logging, add the following to your eslint command call "NO_LOGS=true eslint ..."'),global.hasAnolilabEsLintConfigLoaded=!0;}var v={},g;packageJsonUtils.pkg?.engines?.node&&(g=packageJsonUtils.pkg.engines.node);Object.entries(y).forEach(([s,e])=>{Object.keys(e).sort(k__default.default.rcompare).forEach(i=>{g&&k__default.default.intersects(g,`<${i}`)&&(v[s]=e[i]);});});!global.hasAnolilabEsLintConfigPrettier&&(packageJsonUtils.hasDependency("prettier")||packageJsonUtils.hasDevDependency("prettier"))&&(global.hasAnolilabEsLintConfigPrettier=!0,chunkOCCLNRZC_js.a.info_on_disabling_prettier_conflict_rule!==!1&&chunkSEYYGHPU_js.b(`
23
- Found prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier`));var C={extends:[...m.map(s=>path.join(__dirname,`./config/${s}.js`)),...b.map(s=>path.join(__dirname,`./config/plugins/${s}.js`))],globals:{...x__default.default.browser,...x__default.default.nodeBuiltin},ignorePatterns:["!.*",".git/","node_modules/","bower_components/","jspm_packages/",".npm/","lib-cov/","coverage/",".nyc_output/",".cache/","build/","dist/","tmp/","**/*.min.*","*.d.ts","pnpm-lock.yaml"],overrides:[{files:["**/migrations/*.{js,ts}"],rules:{"filenames/match-regex":"off"}},{files:["**/*.spec.{js,ts,tsx}","**/*.test.{js,ts,tsx}","**/__mocks__/*.{js,ts,tsx}","**/__tests__/*.{js,ts,tsx}","**/test/*.{js,ts,tsx}"],rules:{"no-magic-numbers":"off","sonarjs/no-duplicate-string":"off"}},{files:packageJsonUtils.packageIsTypeModule?["*.js","*.mjs"]:["*.mjs"],parser:"@babel/eslint-parser",parserOptions:{babelOptions:{plugins:["@babel/plugin-syntax-import-assertions"]},requireConfigFile:!1}}],parser:"",rules:{...v}},H=C;
23
+ Found prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier`));var C={extends:[...m.map(s=>path.join(__dirname,`./config/${s}.js`)),...b.map(s=>path.join(__dirname,`./config/plugins/${s}.js`))],globals:{...N__default.default.browser,...N__default.default.nodeBuiltin},ignorePatterns:["!.*",".git/","node_modules/","bower_components/","jspm_packages/",".npm/","lib-cov/","coverage/",".nyc_output/",".cache/","build/","dist/","tmp/","**/*.min.*","*.d.ts","pnpm-lock.yaml"],overrides:[{files:["**/migrations/*.{js,ts}"],rules:{"filenames/match-regex":"off"}},{files:["**/*.spec.{js,ts,tsx}","**/*.test.{js,ts,tsx}","**/__mocks__/*.{js,ts,tsx}","**/__tests__/*.{js,ts,tsx}","**/test/*.{js,ts,tsx}"],rules:{"no-magic-numbers":"off","sonarjs/no-duplicate-string":"off"}},{files:packageJsonUtils.packageIsTypeModule?["*.js","*.mjs"]:["*.mjs"],parser:"@babel/eslint-parser",parserOptions:{babelOptions:{plugins:["@babel/plugin-syntax-import-assertions"]},requireConfigFile:!1}}],parser:"",rules:{...v}},H=C;
24
24
 
25
25
  module.exports = H;
26
26
  //# sourceMappingURL=out.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/config.ts","../src/engine-node-overwrite.ts"],"names":["hasDependency","hasDevDependency","packageIsTypeModule","pkg","globals","join","semver","hasFile","resolvePackage","baseConfig","internalPluginConfig","pluginConfig","loadedPlugins","possiblePlugins","plugin","configName","dependencies","eslint_config_default","foundDependencies","dependency","foundOneOfDependency","rdependency","file","rules","pluginRules","possiblePluginRules","engineRules","engine_node_overwrite_default","consoleLog","name","consolePlugin","hasLogged","installed","configRules","nodeVersion","rule","ruleConfig","minVersion","config","src_default"],"mappings":"mHAYA,MAAO,mDAEP,OAAS,iBAAAA,EAAe,oBAAAC,EAAkB,uBAAAC,EAAqB,OAAAC,MAAW,+BAE1E,OAAOC,MAAa,UACpB,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAY,SClBnB,OAAS,iBAAAN,EAAe,oBAAAC,EAAkB,WAAAM,EAAS,kBAAAC,MAAsB,+BAKzE,IAAMC,EAAa,CAAC,iBAAkB,SAAU,QAAS,M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,UAAU,KACpG,OAAO,gCAAkC,GAErCgB,EAAqB,2CAAgD,IACrEW,EAAW;AAAA,8GAAiH,GAIpI,IAAMU,EAAwB,CAO1B,QAAS,CACL,GAAGf,EAAM,IAAKT,GAAWT,EAAK,UAAW,YAAYS,CAAM,KAAK,CAAC,EAEjE,GAAGU,EAAY,IAAKV,GAAWT,EAAK,UAAW,oBAAoBS,CAAM,KAAK,CAAC,CACnF,EACA,QAAS,CACL,GAAGV,EAAQ,QACX,GAAGA,EAAQ,WACf,EACA,eAAgB,CACZ,MAEA,QACA,gBACA,oBACA,iBACA,QAEA,WACA,YACA,eACA,UAEA,SACA,QACA,OAEA,aAKA,SAEA,gBACJ,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,EAEA,CACI,MAAOF,EAAsB,CAAC,OAAQ,OAAO,EAAI,CAAC,OAAO,EACzD,OAAQ,uBACR,cAAe,CACX,aAAc,CACV,QAAS,CAAC,wCAAwC,CACtD,EACA,kBAAmB,EACvB,CACJ,CACJ,EAEA,OAAQ,GAER,MAAO,CACH,GAAG+B,CACP,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 * {@link https://www.npmjs.com/package/@rushstack/eslint-patch}\n * {@link https://stackoverflow.com/a/74478635/1392749}\n * {@link https://github.com/eslint/eslint/issues/3458}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-1/}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-2/}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-3/}\n * {@link https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new}\n */\nimport \"@rushstack/eslint-patch/modern-module-resolution\";\n\nimport { hasDependency, hasDevDependency, packageIsTypeModule, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\nimport globals from \"globals\";\nimport { join } from \"node:path\";\nimport semver from \"semver\";\n\nimport { internalPluginConfig, pluginRules, possiblePluginRules, rules } from \"./config\";\nimport engineRules from \"./engine-node-overwrite\";\nimport anolilabEslintConfig from \"./utils/eslint-config\";\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 internalPluginConfig\n .map((name: string) => {\n if (name === \"import\") {\n return \"i\";\n }\n\n if (name === \"node\") {\n return \"n\";\n }\n\n return name;\n })\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\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 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\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\nconst configRules: Linter.RulesRecord = {};\nlet nodeVersion: string | undefined;\n\nif (pkg?.engines?.[\"node\"]) {\n nodeVersion = pkg.engines[\"node\"];\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 // eslint-disable-next-line security/detect-object-injection\n configRules[rule] = ruleConfig[minVersion as keyof typeof ruleConfig] as Linter.RuleEntry;\n }\n });\n});\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigPrettier && (hasDependency(\"prettier\") || hasDevDependency(\"prettier\"))) {\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\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 extends: [\n ...rules.map((plugin) => join(__dirname, `./config/${plugin}.js`)),\n\n ...pluginRules.map((plugin) => join(__dirname, `./config/plugins/${plugin}.js`)),\n ],\n globals: {\n ...globals.browser,\n ...globals.nodeBuiltin,\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 \"pnpm-lock.yaml\",\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 // Fixes https://github.com/eslint/eslint/discussions/15305\n {\n files: packageIsTypeModule ? [\"*.js\", \"*.mjs\"] : [\"*.mjs\"],\n parser: \"@babel/eslint-parser\",\n parserOptions: {\n babelOptions: {\n plugins: [\"@babel/plugin-syntax-import-assertions\"],\n },\n requireConfigFile: false,\n },\n },\n ],\n // Disable the parser by default\n parser: \"\",\n // is loaded.\n rules: {\n ...configRules,\n },\n};\n\nexport default config;\n","import { hasDependency, hasDevDependency, hasFile, resolvePackage } from \"@anolilab/package-json-utils\";\n\nimport type { PackageRules } from \"./types\";\nimport anolilabEslintConfig from \"./utils/eslint-config\";\n\nconst baseConfig = [\"best-practices\", \"errors\", \"style\", \"es6\", \"variables\"];\n\n// eslint-disable-next-line import/exports-last\nexport const internalPluginConfig = [\n \"compat\",\n \"eslint-comments\",\n \"import\",\n \"promise\",\n \"simple-import-sort\",\n \"no-extend-native\",\n \"node\",\n // Security Rules\n \"no-secrets\",\n \"sonarjs\",\n \"security\",\n \"regexp\",\n // file rules\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"html\",\n\n // custom rules\n \"antfu\",\n \"unicorn\",\n \"es\",\n \"perfectionist\",\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 oneOfDependency: [\"nextra\", \"docz\", \"@docusaurus/core\", \"gatsby-plugin-mdx\"],\n resolve: [\"@mdx-js/mdx\", \"remark-mdx\", \"@mdx-js/loader\", \"@mdx-js/rollup\", \"@mdx-js/react\"],\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 oneOfDependency: [\"@reduxjs/toolkit\", \"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: \"react-usememo\",\n dependencies: [\"react\", \"react-dom\", \"@arthurgeron/eslint-plugin-react-usememo\"],\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: [\"cypress\", \"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-dom\",\n dependencies: [\"@testing-library/dom\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"testing-library-react\",\n dependencies: [\"react\", \"@testing-library/react\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"typescript\",\n dependencies: [\"typescript\"],\n files: [\"tsconfig.json\", \"tsconfig.eslint.json\"],\n },\n {\n configName: \"etc\",\n dependencies: [\"typescript\", \"eslint-plugin-etc\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\", \"eslint-plugin-vitest-globals\"],\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 configName: \"editorconfig\",\n dependencies: [\"eslint-plugin-editorconfig\"],\n files: [\".editorconfig\"],\n },\n {\n configName: \"storybook\",\n dependencies: [\"storybook\", \"eslint-plugin-storybook\"],\n },\n {\n configName: \"playwright\",\n dependencies: [\"playwright\", \"eslint-plugin-playwright\"],\n },\n {\n configName: \"tanstack-query\",\n dependencies: [\"@tanstack/react-query\", \"@tanstack/eslint-plugin-query\"],\n },\n];\n\nconst loadedPlugins: string[] = [...internalPluginConfig];\nconst possiblePlugins: Record<string, Record<string, boolean>> = {};\n\nif (loadedPlugins.length === internalPluginConfig.length) {\n // eslint-disable-next-line sonarjs/cognitive-complexity\n pluginConfig.forEach((plugin) => {\n const { configName, dependencies } = plugin;\n\n // eslint-disable-next-line security/detect-object-injection\n if ((anolilabEslintConfig as unknown as Record<string, Record<string, false | undefined>>)[\"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 // eslint-disable-next-line security/detect-object-injection\n possiblePlugins[configName] = {};\n\n if (foundDependencies.length === 0) {\n if (plugin.oneOfDependency !== undefined) {\n let foundOneOfDependency = false;\n\n plugin.oneOfDependency.forEach((dependency) => {\n if (!foundOneOfDependency && (hasDependency(dependency) || hasDevDependency(dependency))) {\n foundOneOfDependency = true;\n\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[dependency] = true;\n }\n });\n }\n\n if (plugin.resolve !== undefined) {\n plugin.resolve.forEach((rdependency) => {\n if (resolvePackage(rdependency) !== undefined) {\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[rdependency] = true;\n }\n });\n }\n\n if (plugin.files !== undefined) {\n plugin.files.forEach((file) => {\n if (hasFile(file)) {\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[file] = true;\n }\n });\n }\n }\n\n if (foundDependencies.length === dependencies.length) {\n // eslint-disable-next-line security/detect-object-injection,@typescript-eslint/no-dynamic-delete\n delete possiblePlugins[configName];\n\n loadedPlugins.push(configName);\n } else {\n dependencies.forEach((dependency) => {\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[dependency] = hasDependency(dependency) || hasDevDependency(dependency);\n });\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 \"n/prefer-global/text-decoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/text-encoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/url\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/url-search-params\": {\n \"10.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 \"no-useless-catch\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-destructuring\": {\n \"6.0.0\": \"off\",\n },\n \"prefer-named-capture-group\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-object-spread\": {\n \"8.3.0\": \"off\",\n },\n \"prefer-rest-params\": {\n \"6.0.0\": \"off\",\n },\n \"promise/prefer-await-to-then\": {\n \"7.6.0\": \"off\",\n },\n \"unicorn/no-new-buffer\": {\n \"5.10.0\": \"off\",\n },\n \"unicorn/prefer-flat-map\": {\n \"11.0.0\": \"off\",\n },\n \"unicorn/prefer-spread\": {\n \"5.0.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":["hasDependency","hasDevDependency","packageIsTypeModule","pkg","globals","join","semver","hasFile","resolvePackage","baseConfig","internalPluginConfig","pluginConfig","loadedPlugins","possiblePlugins","plugin","configName","dependencies","eslint_config_default","foundDependencies","dependency","foundOneOfDependency","rdependency","file","rules","pluginRules","possiblePluginRules","engineRules","engine_node_overwrite_default","consoleLog","name","consolePlugin","hasLogged","installed","configRules","nodeVersion","rule","ru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n * dependencies instead of imposing them as peer dependencies\n *\n * {@link https://www.npmjs.com/package/@rushstack/eslint-patch}\n * {@link https://stackoverflow.com/a/74478635/1392749}\n * {@link https://github.com/eslint/eslint/issues/3458}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-1/}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-2/}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-3/}\n * {@link https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new}\n */\nimport \"@rushstack/eslint-patch/modern-module-resolution\";\n\nimport { hasDependency, hasDevDependency, packageIsTypeModule, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\nimport globals from \"globals\";\nimport { join } from \"node:path\";\nimport semver from \"semver\";\n\nimport { internalPluginConfig, pluginRules, possiblePluginRules, rules } from \"./config\";\nimport engineRules from \"./engine-node-overwrite\";\nimport anolilabEslintConfig from \"./utils/eslint-config\";\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 internalPluginConfig\n .map((name: string) => {\n if (name === \"import\") {\n return \"i\";\n }\n\n if (name === \"node\") {\n return \"n\";\n }\n\n return name;\n })\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\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 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\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\nconst configRules: Linter.RulesRecord = {};\nlet nodeVersion: string | undefined;\n\nif (pkg?.engines?.[\"node\"]) {\n nodeVersion = pkg.engines[\"node\"];\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 // eslint-disable-next-line security/detect-object-injection\n configRules[rule] = ruleConfig[minVersion as keyof typeof ruleConfig] as Linter.RuleEntry;\n }\n });\n});\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigPrettier && (hasDependency(\"prettier\") || hasDevDependency(\"prettier\"))) {\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\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 extends: [\n ...rules.map((plugin) => join(__dirname, `./config/${plugin}.js`)),\n\n ...pluginRules.map((plugin) => join(__dirname, `./config/plugins/${plugin}.js`)),\n ],\n globals: {\n ...globals.browser,\n ...globals.nodeBuiltin,\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 \"pnpm-lock.yaml\",\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 // Fixes https://github.com/eslint/eslint/discussions/15305\n {\n files: packageIsTypeModule ? [\"*.js\", \"*.mjs\"] : [\"*.mjs\"],\n parser: \"@babel/eslint-parser\",\n parserOptions: {\n babelOptions: {\n plugins: [\"@babel/plugin-syntax-import-assertions\"],\n },\n requireConfigFile: false,\n },\n },\n ],\n // Disable the parser by default\n parser: \"\",\n // is loaded.\n rules: {\n ...configRules,\n },\n};\n\nexport default config;\n","import { hasDependency, hasDevDependency, hasFile, resolvePackage } from \"@anolilab/package-json-utils\";\n\nimport type { PackageRules } from \"./types\";\nimport anolilabEslintConfig from \"./utils/eslint-config\";\n\nconst baseConfig = [\"best-practices\", \"errors\", \"style\", \"es6\", \"variables\"];\n\n// eslint-disable-next-line import/exports-last\nexport const internalPluginConfig = [\n \"compat\",\n \"eslint-comments\",\n \"import\",\n \"promise\",\n \"simple-import-sort\",\n \"no-extend-native\",\n \"node\",\n // Security Rules\n \"no-secrets\",\n \"sonarjs\",\n \"security\",\n \"regexp\",\n // file rules\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"html\",\n\n // custom rules\n \"antfu\",\n \"unicorn\",\n \"es\",\n \"perfectionist\",\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 oneOfDependency: [\"nextra\", \"docz\", \"@docusaurus/core\", \"gatsby-plugin-mdx\"],\n resolve: [\"@mdx-js/mdx\", \"remark-mdx\", \"@mdx-js/loader\", \"@mdx-js/rollup\", \"@mdx-js/react\"],\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 oneOfDependency: [\"@reduxjs/toolkit\", \"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: \"react-usememo\",\n dependencies: [\"react\", \"react-dom\", \"@arthurgeron/eslint-plugin-react-usememo\"],\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: [\"cypress\", \"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-dom\",\n dependencies: [\"@testing-library/dom\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"testing-library-react\",\n dependencies: [\"react\", \"@testing-library/react\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"typescript\",\n dependencies: [\"typescript\"],\n files: [\"tsconfig.json\", \"tsconfig.eslint.json\"],\n },\n {\n configName: \"etc\",\n dependencies: [\"typescript\", \"eslint-plugin-etc\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\", \"eslint-plugin-vitest-globals\"],\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 configName: \"editorconfig\",\n dependencies: [\"eslint-plugin-editorconfig\"],\n files: [\".editorconfig\"],\n },\n {\n configName: \"storybook\",\n dependencies: [\"storybook\", \"eslint-plugin-storybook\"],\n },\n {\n configName: \"playwright\",\n dependencies: [\"playwright\", \"eslint-plugin-playwright\"],\n },\n {\n configName: \"tanstack-query\",\n dependencies: [\"@tanstack/react-query\", \"@tanstack/eslint-plugin-query\"],\n },\n];\n\nconst loadedPlugins: string[] = [...internalPluginConfig];\nconst possiblePlugins: Record<string, Record<string, boolean>> = {};\n\nif (loadedPlugins.length === internalPluginConfig.length) {\n // eslint-disable-next-line sonarjs/cognitive-complexity\n pluginConfig.forEach((plugin) => {\n const { configName, dependencies } = plugin;\n\n // eslint-disable-next-line security/detect-object-injection\n if ((anolilabEslintConfig as unknown as Record<string, Record<string, false | undefined>>)[\"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 // eslint-disable-next-line security/detect-object-injection\n possiblePlugins[configName] = {};\n\n if (foundDependencies.length === 0) {\n if (plugin.oneOfDependency !== undefined) {\n let foundOneOfDependency = false;\n\n plugin.oneOfDependency.forEach((dependency) => {\n if (!foundOneOfDependency && (hasDependency(dependency) || hasDevDependency(dependency))) {\n foundOneOfDependency = true;\n\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[dependency] = true;\n }\n });\n }\n\n if (plugin.resolve !== undefined) {\n plugin.resolve.forEach((rdependency) => {\n if (resolvePackage(rdependency) !== undefined) {\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[rdependency] = true;\n }\n });\n }\n\n if (plugin.files !== undefined) {\n plugin.files.forEach((file) => {\n if (hasFile(file)) {\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[file] = true;\n }\n });\n }\n }\n\n if (foundDependencies.length === dependencies.length) {\n // eslint-disable-next-line security/detect-object-injection,@typescript-eslint/no-dynamic-delete\n delete possiblePlugins[configName];\n\n loadedPlugins.push(configName);\n } else {\n dependencies.forEach((dependency) => {\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[dependency] = hasDependency(dependency) || hasDevDependency(dependency);\n });\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 \"n/prefer-global/text-decoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/text-encoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/url\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/url-search-params\": {\n \"10.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 \"no-useless-catch\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-destructuring\": {\n \"6.0.0\": \"off\",\n },\n \"prefer-named-capture-group\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-object-spread\": {\n \"8.3.0\": \"off\",\n },\n \"prefer-rest-params\": {\n \"6.0.0\": \"off\",\n },\n \"promise/prefer-await-to-then\": {\n \"7.6.0\": \"off\",\n },\n \"unicorn/no-new-buffer\": {\n \"5.10.0\": \"off\",\n },\n \"unicorn/prefer-flat-map\": {\n \"11.0.0\": \"off\",\n },\n \"unicorn/prefer-spread\": {\n \"5.0.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": "11.3.1",
3
+ "version": "11.3.2",
4
4
  "description": "ESLint shareable config for the Anolilab JavaScript style guide.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -196,7 +196,7 @@
196
196
  "eslint-plugin-react-redux": "^4.0.0",
197
197
  "eslint-plugin-storybook": "^0.6.13",
198
198
  "eslint-plugin-tailwindcss": "^3.13.0",
199
- "eslint-plugin-testing-library": "^5.11.1",
199
+ "eslint-plugin-testing-library": "^6.0.0",
200
200
  "eslint-plugin-vitest": "^0.2.8",
201
201
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0",
202
202
  "eslint-plugin-you-dont-need-momentjs": "^1.6.0",
@@ -236,7 +236,7 @@
236
236
  "eslint-plugin-react-redux": "^4.0.0",
237
237
  "eslint-plugin-storybook": "^0.6.13",
238
238
  "eslint-plugin-tailwindcss": "^3.13.0",
239
- "eslint-plugin-testing-library": "^5.11.1",
239
+ "eslint-plugin-testing-library": "^6.0.0",
240
240
  "eslint-plugin-tsdoc": "^0.2.17",
241
241
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0",
242
242
  "eslint-plugin-you-dont-need-momentjs": "^1.6.0"