@anolilab/eslint-config 7.0.1 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/chunk-55ITTPFD.js +7 -0
  3. package/dist/chunk-55ITTPFD.js.map +1 -0
  4. package/dist/{chunk-KNKUBOMM.mjs → chunk-BMAMDZC7.mjs} +2 -2
  5. package/dist/chunk-BMAMDZC7.mjs.map +1 -0
  6. package/dist/{chunk-MLDIWITS.js → chunk-LL423FL5.js} +2 -2
  7. package/dist/chunk-LL423FL5.js.map +1 -0
  8. package/dist/chunk-U52VQNGF.mjs +5 -0
  9. package/dist/chunk-U52VQNGF.mjs.map +1 -0
  10. package/dist/config/es6.js +2 -2
  11. package/dist/config/es6.mjs +1 -1
  12. package/dist/config/plugins/babel.js +2 -2
  13. package/dist/config/plugins/babel.mjs +1 -1
  14. package/dist/config/plugins/etc.d.ts +5 -0
  15. package/dist/config/plugins/etc.js +9 -0
  16. package/dist/config/plugins/etc.js.map +1 -0
  17. package/dist/config/plugins/etc.mjs +7 -0
  18. package/dist/config/plugins/etc.mjs.map +1 -0
  19. package/dist/config/plugins/html.js +2 -2
  20. package/dist/config/plugins/html.mjs +1 -1
  21. package/dist/config/plugins/jsx-a11y.js +4 -2
  22. package/dist/config/plugins/jsx-a11y.js.map +1 -1
  23. package/dist/config/plugins/jsx-a11y.mjs +4 -2
  24. package/dist/config/plugins/jsx-a11y.mjs.map +1 -1
  25. package/dist/config/plugins/playwright.d.ts +5 -0
  26. package/dist/config/plugins/playwright.js +9 -0
  27. package/dist/config/plugins/playwright.js.map +1 -0
  28. package/dist/config/plugins/playwright.mjs +7 -0
  29. package/dist/config/plugins/playwright.mjs.map +1 -0
  30. package/dist/config/plugins/react.js +2 -2
  31. package/dist/config/plugins/react.mjs +1 -1
  32. package/dist/config/plugins/storybook.d.ts +5 -0
  33. package/dist/config/plugins/storybook.js +7 -0
  34. package/dist/config/plugins/storybook.js.map +1 -0
  35. package/dist/config/plugins/storybook.mjs +5 -0
  36. package/dist/config/plugins/storybook.mjs.map +1 -0
  37. package/dist/config/plugins/tanstack-query.d.ts +5 -0
  38. package/dist/config/plugins/tanstack-query.js +9 -0
  39. package/dist/config/plugins/tanstack-query.js.map +1 -0
  40. package/dist/config/plugins/tanstack-query.mjs +7 -0
  41. package/dist/config/plugins/tanstack-query.mjs.map +1 -0
  42. package/dist/config/plugins/typescript.js +3 -3
  43. package/dist/config/plugins/typescript.mjs +2 -2
  44. package/dist/config/plugins/unicorn.js +2 -2
  45. package/dist/config/plugins/unicorn.mjs +1 -1
  46. package/dist/config/style.js +2 -2
  47. package/dist/config/style.mjs +1 -1
  48. package/dist/index.js +4 -4
  49. package/dist/index.js.map +1 -1
  50. package/dist/index.mjs +3 -3
  51. package/dist/index.mjs.map +1 -1
  52. package/package.json +59 -2
  53. package/dist/chunk-KNKUBOMM.mjs.map +0 -1
  54. package/dist/chunk-MLDIWITS.js.map +0 -1
  55. package/dist/chunk-PCIKFIV2.js +0 -7
  56. package/dist/chunk-PCIKFIV2.js.map +0 -1
  57. package/dist/chunk-WSETOOIE.mjs +0 -5
  58. package/dist/chunk-WSETOOIE.mjs.map +0 -1
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":"+CAYA,MAAO,mDAEP,OAAS,aAAAA,EAAW,uBAAAC,EAAqB,OAAAC,MAAW,+BAEpD,OAAS,QAAAC,MAAY,OACrB,O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B,MAChB,aAAc,MACd,sBAAuB,MACvB,8BAA+B,MAC/B,kBAAmB,MACnB,kBAAmB,MACnB,kBAAmB,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 * {@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 { 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 \"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 \"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];\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"]}
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":"+CAYA,MAAO,mDAEP,OAAS,aAAAA,EAAW,uBAAAC,EAAqB,OAAAC,MAAW,+BAEpD,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAY,SCjBnB,OAAS,iBAAAC,EAAe,oBAAAC,EAAkB,OAAAJ,MAAW,+BAIrD,IAAMK,EAAa,CAAC,iBAAkB,SAAU,QAAS,MAAO,WAAW,EAErEC,EAAuB,CACzB,SACA,kBACA,SACA,UACA,qBACA,mBACA,OAEA,aACA,UACA,WACA,SAEA,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,CAAC,SAAU,yBAAyB,CACtD,EACA,CACI,WAAY,kCACZ,aAAc,CAAC,SAAU,+CAA+C,CAC5E,EACA,CACI,WAAY,MACZ,aAAc,CAAC,mBAAmB,CACtC,EACA,CACI,WAAY,iBACZ,aAAc,CAAC,8BAA8B,CACjD,EACA,CACI,WAAY,QACZ,aAAc,CAAC,QAAS,YAAa,qBAAqB,CAC9D,EACA,CACI,WAAY,cACZ,aAAc,CAAC,2BAA2B,CAC9C,EACA,CACI,WAAY,WACZ,aAAc,CAAC,QAAS,YAAa,wBAAwB,CACjE,EACA,CACI,WAAY,cACZ,aAAc,CAAC,QAAS,YAAa,2BAA2B,CACpE,EACA,CACI,WAAY,yBACZ,aAAc,CAAC,SAAU,sCAAsC,CACnE,EACA,CACI,WAAY,yBACZ,aAAc,CAAC,kBAAmB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ch 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 { 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 \"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 \"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];\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: \"etc\",\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 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: { [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
@@ -2,14 +2,14 @@ import { b as b$1, a as a$1 } from './chunk-G7JIJH44.mjs';
2
2
  import '@rushstack/eslint-patch/modern-module-resolution';
3
3
  import { pkg, hasDependency, hasDevDependency, hasAnyDep, packageIsTypeModule } from '@anolilab/package-json-utils';
4
4
  import { join } from 'path';
5
- import x from 'semver';
5
+ import N from 'semver';
6
6
 
7
- var v=["best-practices","errors","style","es6","variables"],E=["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"],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(`
7
+ var v=["best-practices","errors","style","es6","variables"],E=["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"],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:"etc",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"]},{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"]}],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","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(`
11
11
  To disable this message, add the following to your package.json:`),b$1(` "anolilab": { "eslint-config": { plugin: { "plugin-name": false } } }
12
- `)),b$1('To disable all logging, add the following to your eslint command call "NO_LOGS=true eslint ..."'),global.hasAnolilabEsLintConfigLoaded=!0;}var a={},c;pkg?.engines?.node&&(c=pkg.engines.node);var N={};pkg&&(N=pkg?.anolilab?.["eslint-config"]);Object.entries(j).forEach(([e,n])=>{Object.keys(n).sort(x.rcompare).forEach(o=>{c&&x.intersects(c,`<${o}`)&&(a[e]=n[o]);});});hasAnyDep(["prettier"],{peerDeps:!1})&&(global.hasAnolilabEsLintConfigPrettier||(global.hasAnolilabEsLintConfigPrettier=!0,N?.info_on_disabling_prettier_conflict_rule!==!1&&b$1(`
12
+ `)),b$1('To disable all logging, add the following to your eslint command call "NO_LOGS=true eslint ..."'),global.hasAnolilabEsLintConfigLoaded=!0;}var a={},c;pkg?.engines?.node&&(c=pkg.engines.node);var x={};pkg&&(x=pkg?.anolilab?.["eslint-config"]);Object.entries(j).forEach(([e,n])=>{Object.keys(n).sort(N.rcompare).forEach(o=>{c&&N.intersects(c,`<${o}`)&&(a[e]=n[o]);});});hasAnyDep(["prettier"],{peerDeps:!1})&&(global.hasAnolilabEsLintConfigPrettier||(global.hasAnolilabEsLintConfigPrettier=!0,x?.info_on_disabling_prettier_conflict_rule!==!1&&b$1(`
13
13
  Found prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier`)),a={...a,curly:0,"lines-around-comment":0,"max-len":0,"no-confusing-arrow":0,"no-mixed-operators":0,"no-tabs":0,"no-unexpected-multiline":0,quotes:0,"array-bracket-newline":"off","array-bracket-spacing":"off","array-element-newline":"off","arrow-parens":"off","arrow-spacing":"off","block-spacing":"off","brace-style":"off","comma-dangle":"off","comma-spacing":"off","comma-style":"off","computed-property-spacing":"off","dot-location":"off","eol-last":"off","func-call-spacing":"off","function-call-argument-newline":"off","function-paren-newline":"off","generator-star-spacing":"off","implicit-arrow-linebreak":"off",indent:"off","jsx-quotes":"off","key-spacing":"off","keyword-spacing":"off","linebreak-style":"off","multiline-ternary":"off","newline-per-chained-call":"off","new-parens":"off","no-extra-parens":"off","no-extra-semi":"off","no-floating-decimal":"off","no-mixed-spaces-and-tabs":"off","no-multi-spaces":"off","no-multiple-empty-lines":"off","no-trailing-spaces":"off","no-whitespace-before-property":"off","nonblock-statement-body-position":"off","object-curly-newline":"off","object-curly-spacing":"off","object-property-newline":"off","one-var-declaration-per-line":"off","operator-linebreak":"off","padded-blocks":"off","quote-props":"off","rest-spread-spacing":"off",semi:"off","semi-spacing":"off","semi-style":"off","space-before-blocks":"off","space-before-function-paren":"off","space-in-parens":"off","space-infix-ops":"off","space-unary-ops":"off","switch-colon-spacing":"off","template-curly-spacing":"off","template-tag-spacing":"off","unicode-bom":"off","wrap-iife":"off","wrap-regex":"off","yield-star-spacing":"off"});var C={root:!0,parser:"",extends:[...b.map(e=>join(__dirname,`./config/${e}.${packageIsTypeModule?"m":""}js`)),...l.map(e=>join(__dirname,`./config/plugins/${e}.${packageIsTypeModule?"m":""}js`))],rules:{...a},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"}}],ignorePatterns:["!.*",".git/","node_modules/","bower_components/","jspm_packages/",".npm/","lib-cov/","coverage/",".nyc_output/",".cache/","build/","dist/","tmp/","**/*.min.*","*.d.ts"]},I=C;
14
14
 
15
15
  export { I as default };
@@ -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":"gDAYA,MAAO,mDAEP,OAAS,aAAAA,EAAW,uBAAAC,EAAqB,OAAAC,MAAW,+BAEpD,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAY,SCjBnB,OAAS,iBAAAC,EAAe,oBAAAC,EAAkB,OAAAJ,MAAW,+BAIrD,IAAMK,EAAa,CAAC,iBAAkB,SAAU,QAAS,MAAO,WAAW,EAErEC,EAAuB,CACzB,SACA,kBACA,SACA,UACA,qBACA,mBACA,OAEA,aACA,UACA,WACA,SAEA,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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B,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 * {@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 { 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 \"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 \"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];\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"]}
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":"gDAYA,MAAO,mDAEP,OAAS,aAAAA,EAAW,uBAAAC,EAAqB,OAAAC,MAAW,+BAEpD,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAY,SCjBnB,OAAS,iBAAAC,EAAe,oBAAAC,EAAkB,OAAAJ,MAAW,+BAIrD,IAAMK,EAAa,CAAC,iBAAkB,SAAU,QAAS,MAAO,WAAW,EAErEC,EAAuB,CACzB,SACA,kBACA,SACA,UACA,qBACA,mBACA,OAEA,aACA,UACA,WACA,SAEA,QACA,WACA,OACA,MACA,OAGA,QACA,UACA,IACJ,EAEMC,EAA6B,CAC/B,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MACnB,kBAAmB,MACnB,kBAAmB,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 * {@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 { 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 \"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 \"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];\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: \"etc\",\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 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: { [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": "7.0.1",
3
+ "version": "7.2.0",
4
4
  "description": "ESLint shareable config for the Anolilab JavaScript style guide.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -8,13 +8,61 @@
8
8
  "styleguide",
9
9
  "eslint",
10
10
  "eslintconfig",
11
+ "eslint-config",
11
12
  "config",
12
13
  "javascript",
13
14
  "es2015",
14
15
  "es2016",
15
16
  "es2017",
16
17
  "es2018",
17
- "es2020"
18
+ "es2020",
19
+ "eslint-import-resolver-node",
20
+ "eslint-import-resolver-typescript",
21
+ "eslint-plugin-antfu",
22
+ "eslint-plugin-compat",
23
+ "eslint-plugin-es",
24
+ "eslint-plugin-eslint-comments",
25
+ "eslint-plugin-html",
26
+ "eslint-plugin-i",
27
+ "eslint-plugin-jsonc",
28
+ "eslint-plugin-markdown",
29
+ "eslint-plugin-mdx",
30
+ "eslint-plugin-no-loops",
31
+ "eslint-plugin-no-secrets",
32
+ "eslint-plugin-no-use-extend-native",
33
+ "eslint-plugin-promise",
34
+ "eslint-plugin-regexp",
35
+ "eslint-plugin-simple-import-sort",
36
+ "eslint-plugin-sonarjs",
37
+ "eslint-plugin-sort-keys-fix",
38
+ "eslint-plugin-toml",
39
+ "eslint-plugin-typescript-sort-keys",
40
+ "eslint-plugin-unicorn",
41
+ "eslint-plugin-yml",
42
+ "eslint-plugin-array-func",
43
+ "eslint-plugin-ava",
44
+ "eslint-plugin-babel",
45
+ "eslint-plugin-cypress",
46
+ "eslint-plugin-jest",
47
+ "eslint-plugin-jest-async",
48
+ "eslint-plugin-jest-dom",
49
+ "eslint-plugin-jest-formatting",
50
+ "eslint-plugin-playwright",
51
+ "eslint-plugin-jsdoc",
52
+ "eslint-plugin-jsx-a11y",
53
+ "eslint-plugin-n",
54
+ "eslint-plugin-no-unsanitized",
55
+ "eslint-plugin-prefer-object-spread",
56
+ "eslint-plugin-react",
57
+ "eslint-plugin-react-hooks",
58
+ "eslint-plugin-react-redux",
59
+ "eslint-plugin-storybook",
60
+ "eslint-plugin-tailwindcss",
61
+ "eslint-plugin-testing-library",
62
+ "eslint-plugin-tsdoc",
63
+ "eslint-plugin-etc",
64
+ "eslint-plugin-you-dont-need-lodash-underscore",
65
+ "eslint-plugin-you-dont-need-momentjs"
18
66
  ],
19
67
  "homepage": "https://anolilab.com/nodejs/packages/eslint-config",
20
68
  "repository": {
@@ -126,7 +174,9 @@
126
174
  "eslint-plugin-react": "^7.32.2",
127
175
  "eslint-plugin-react-hooks": "^4.6.0",
128
176
  "eslint-plugin-react-redux": "^4.0.0",
177
+ "eslint-plugin-storybook": "^0.6.11",
129
178
  "eslint-plugin-tailwindcss": "^3.12.1",
179
+ "eslint-plugin-etc": "^2.0.3",
130
180
  "eslint-plugin-testing-library": "^5.11.0",
131
181
  "eslint-plugin-vitest": "^0.2.6",
132
182
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0",
@@ -150,14 +200,17 @@
150
200
  "eslint-plugin-jest-async": "^1.0.3",
151
201
  "eslint-plugin-jest-dom": "^5.0.1",
152
202
  "eslint-plugin-jest-formatting": "^3.1.0",
203
+ "eslint-plugin-playwright": "^0.15.1",
153
204
  "eslint-plugin-jsdoc": "^46.2.6",
154
205
  "eslint-plugin-jsx-a11y": "^6.7.1",
155
206
  "eslint-plugin-n": "^16.0.0",
156
207
  "eslint-plugin-no-unsanitized": "^4.0.2",
157
208
  "eslint-plugin-prefer-object-spread": "^1.2.1",
209
+ "@tanstack/eslint-plugin-query": "^4.29.9",
158
210
  "eslint-plugin-react": "^7.32.2",
159
211
  "eslint-plugin-react-hooks": "^4.6.0",
160
212
  "eslint-plugin-react-redux": "^4.0.0",
213
+ "eslint-plugin-storybook": "^0.6.11",
161
214
  "eslint-plugin-tailwindcss": "^3.12.1",
162
215
  "eslint-plugin-testing-library": "^5.11.0",
163
216
  "eslint-plugin-tsdoc": "^0.2.17",
@@ -183,6 +236,7 @@
183
236
  "src/config/plugins/cypress.ts",
184
237
  "src/config/plugins/es.ts",
185
238
  "src/config/plugins/eslint-comments.ts",
239
+ "src/config/plugins/etc.ts",
186
240
  "src/config/plugins/html.ts",
187
241
  "src/config/plugins/import.ts",
188
242
  "src/config/plugins/jest-async.ts",
@@ -201,6 +255,7 @@
201
255
  "src/config/plugins/no-secrets.ts",
202
256
  "src/config/plugins/no-unsanitized.ts",
203
257
  "src/config/plugins/node.ts",
258
+ "src/config/plugins/playwright.ts",
204
259
  "src/config/plugins/promise.ts",
205
260
  "src/config/plugins/react-hooks.ts",
206
261
  "src/config/plugins/react-redux.ts",
@@ -210,7 +265,9 @@
210
265
  "src/config/plugins/simple-import-sort.ts",
211
266
  "src/config/plugins/sonarjs.ts",
212
267
  "src/config/plugins/sort-keys-fix.ts",
268
+ "src/config/plugins/storybook.ts",
213
269
  "src/config/plugins/tailwindcss.ts",
270
+ "src/config/plugins/tanstack-query.ts",
214
271
  "src/config/plugins/testing-library.ts",
215
272
  "src/config/plugins/toml.ts",
216
273
  "src/config/plugins/tsdoc.ts",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/config/style.ts"],"names":["pkg","anolilabEslintConfig","indent","config","style_default"],"mappings":"AAAA,OAAS,OAAAA,MAAW,+BAGpB,IAAIC,EAA6D,CAAC,EAE9DD,IAEAC,EAAuBD,GAAM,WAAc,eAAe,GAG9D,IAAIE,EAAiB,EAErB,GAAID,GAAuB,OAAW,CAClC,GAAI,OAAO,MAAMA,EAAqB,MAAS,EAC3C,MAAM,IAAI,UAAU,yBAAyB,EAGjDC,EAAS,OAAOD,EAAqB,MAAS,CAClD,CAEA,IAAME,EAAwB,CAC1B,MAAO,CAGH,wBAAyB,MAIzB,wBAAyB,MAGzB,wBAAyB,CAAC,QAAS,OAAO,EAI1C,gBAAiB,CAAC,QAAS,QAAQ,EAGnC,cAAe,CAAC,QAAS,OAAQ,CAAE,gBAAiB,EAAK,CAAC,EAG1D,UAAW,CAAC,QAAS,CAAE,WAAY,QAAS,oBAAqB,E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B,QAAS,CAAC,IAAK,IAAK,GAAG,CAC3B,EACA,MAAO,CACH,WAAY,CAAC,IAAK,GAAG,EACrB,QAAS,CAAC,IAAK,IAAK,IAAK,IAAI,EAC7B,SAAU,EACd,CACJ,CACJ,EAIA,uBAAwB,CAAC,QAAS,CAAE,MAAO,GAAM,OAAQ,EAAM,CAAC,EAIhE,uBAAwB,CAAC,QAAS,OAAO,EAIzC,cAAe,CAAC,QAAS,OAAO,EAGhC,aAAc,KAClB,CACJ,EAEOE,EAAQD","sourcesContent":["import { pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\n\nlet anolilabEslintConfig: { [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\nlet indent: number = 4;\n\nif (anolilabEslintConfig?.[\"indent\"]) {\n if (Number.isNaN(anolilabEslintConfig[\"indent\"])) {\n throw new TypeError(\"Indent must be a number\");\n }\n\n indent = Number(anolilabEslintConfig[\"indent\"]);\n}\n\nconst config: Linter.Config = {\n rules: {\n // enforce line breaks after opening and before closing array brackets\n // https://eslint.org/docs/rules/array-bracket-newline\n \"array-bracket-newline\": \"off\",\n\n // enforce line breaks between array elements\n // https://eslint.org/docs/rules/array-element-newline\n \"array-element-newline\": \"off\",\n\n // enforce spacing inside array brackets\n \"array-bracket-spacing\": [\"error\", \"never\"],\n\n // enforce spacing inside single-line blocks\n // https://eslint.org/docs/rules/block-spacing\n \"block-spacing\": [\"error\", \"always\"],\n\n // enforce one true brace style\n \"brace-style\": [\"error\", \"1tbs\", { allowSingleLine: true }],\n\n // require camel case names\n camelcase: [\"error\", { properties: \"never\", ignoreDestructuring: false }],\n\n // enforce or disallow capitalization of the first letter of a comment\n // https://eslint.org/docs/rules/capitalized-comments\n \"capitalized-comments\": [\n \"off\",\n \"never\",\n {\n line: {\n ignorePattern: \".*\",\n ignoreInlineComments: true,\n ignoreConsecutiveComments: true,\n },\n block: {\n ignorePattern: \".*\",\n ignoreInlineComments: true,\n ignoreConsecutiveComments: true,\n },\n },\n ],\n\n // require trailing commas in multiline object literals\n \"comma-dangle\": [\n \"error\",\n {\n arrays: \"always-multiline\",\n objects: \"always-multiline\",\n imports: \"always-multiline\",\n exports: \"always-multiline\",\n functions: \"always-multiline\",\n },\n ],\n\n // enforce spacing before and after comma\n \"comma-spacing\": [\"error\", { before: false, after: true }],\n\n // enforce one true comma style\n \"comma-style\": [\n \"error\",\n \"last\",\n {\n exceptions: {\n ArrayExpression: false,\n ArrayPattern: false,\n ArrowFunctionExpression: false,\n CallExpression: false,\n FunctionDeclaration: false,\n FunctionExpression: false,\n ImportDeclaration: false,\n ObjectExpression: false,\n ObjectPattern: false,\n VariableDeclaration: false,\n NewExpression: false,\n },\n },\n ],\n\n // disallow padding inside computed properties\n \"computed-property-spacing\": [\"error\", \"never\"],\n\n // enforces consistent naming when capturing the current execution context\n \"consistent-this\": \"off\",\n\n // enforce that default parameters should come last\n \"default-param-last\": [\"error\"],\n\n // enforce newline at the end of file, with no multiple empty lines\n \"eol-last\": [\"error\", \"always\"],\n\n // https://eslint.org/docs/rules/function-call-argument-newline\n \"function-call-argument-newline\": [\"error\", \"consistent\"],\n\n // enforce spacing between functions and their invocations\n // https://eslint.org/docs/rules/func-call-spacing\n \"func-call-spacing\": [\"error\", \"never\"],\n\n // requires function names to match the name of the variable or property to which they are\n // assigned\n // https://eslint.org/docs/rules/func-name-matching\n \"func-name-matching\": [\n \"off\",\n \"always\",\n {\n includeCommonJSModuleExports: false,\n considerPropertyDescriptor: true,\n },\n ],\n\n // require function expressions to have a name\n // https://eslint.org/docs/rules/func-names\n \"func-names\": [\"error\", \"as-needed\"],\n\n // enforces use of function declarations or expressions\n // https://eslint.org/docs/rules/func-style\n \"func-style\": [\"error\", \"expression\"],\n\n // enforce consistent line breaks inside function parentheses\n // https://eslint.org/docs/rules/function-paren-newline\n \"function-paren-newline\": [\"error\", \"consistent\"],\n\n // Blacklist certain identifiers to prevent them being used\n // https://eslint.org/docs/rules/id-blacklist\n \"id-blacklist\": \"error\",\n\n // disallow specified identifiers\n // https://eslint.org/docs/rules/id-denylist\n \"id-denylist\": \"off\",\n\n // this option enforces minimum and maximum identifier lengths\n // (variable names, property names etc.)\n \"id-length\": \"off\",\n\n // require identifiers to match the provided regular expression\n \"id-match\": \"off\",\n\n // Enforce the location of arrow function bodies with implicit returns\n // https://eslint.org/docs/rules/implicit-arrow-linebreak\n \"implicit-arrow-linebreak\": [\"error\", \"beside\"],\n\n // this option sets a specific tab width for your code\n // https://eslint.org/docs/rules/indent\n indent: [\n \"error\",\n indent,\n {\n SwitchCase: 1,\n VariableDeclarator: 1,\n outerIIFEBody: 1,\n // MemberExpression: null,\n FunctionDeclaration: {\n parameters: 1,\n body: 1,\n },\n FunctionExpression: {\n parameters: 1,\n body: 1,\n },\n CallExpression: {\n arguments: 1,\n },\n ArrayExpression: 1,\n ObjectExpression: 1,\n ImportDeclaration: 1,\n flatTernaryExpressions: false,\n // list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js\n ignoredNodes: [\n \"JSXElement\",\n \"JSXElement > *\",\n \"JSXAttribute\",\n \"JSXIdentifier\",\n \"JSXNamespacedName\",\n \"JSXMemberExpression\",\n \"JSXSpreadAttribute\",\n \"JSXExpressionContainer\",\n \"JSXOpeningElement\",\n \"JSXClosingElement\",\n \"JSXFragment\",\n \"JSXOpeningFragment\",\n \"JSXClosingFragment\",\n \"JSXText\",\n \"JSXEmptyExpression\",\n \"JSXSpreadChild\",\n ],\n ignoreComments: false,\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\": [\"off\", \"prefer-double\"],\n\n // enforces spacing between keys and values in object literal properties\n \"key-spacing\": [\"error\", { beforeColon: false, afterColon: true }],\n\n // require a space before & after certain keywords\n \"keyword-spacing\": [\n \"error\",\n {\n before: true,\n after: true,\n overrides: {\n return: { after: true },\n throw: { after: true },\n case: { after: true },\n },\n },\n ],\n\n // enforce position of line comments\n // https://eslint.org/docs/rules/line-comment-position\n // TODO: enable?\n \"line-comment-position\": [\n \"off\",\n {\n position: \"above\",\n ignorePattern: \"\",\n applyDefaultPatterns: true,\n },\n ],\n\n // disallow mixed 'LF' and 'CRLF' as linebreaks\n // https://eslint.org/docs/rules/linebreak-style\n \"linebreak-style\": [\"error\", \"unix\"],\n\n // require or disallow an empty line between class members\n // https://eslint.org/docs/rules/lines-between-class-members\n \"lines-between-class-members\": [\"error\", \"always\", { exceptAfterSingleLine: false }],\n\n // enforces empty lines around comments\n \"lines-around-comment\": \"off\",\n\n // require or disallow newlines around directives\n // https://eslint.org/docs/rules/lines-around-directive\n \"lines-around-directive\": [\n \"error\",\n {\n before: \"always\",\n after: \"always\",\n },\n ],\n\n // specify the maximum depth that blocks can be nested\n \"max-depth\": [\"off\", 4],\n\n // specify the maximum length of a line in your program\n // https://eslint.org/docs/rules/max-len\n \"max-len\": [\n \"error\",\n 160,\n 2,\n {\n ignoreUrls: true,\n ignoreComments: false,\n ignoreRegExpLiterals: true,\n ignoreStrings: true,\n ignoreTemplateLiterals: true,\n },\n ],\n\n // specify the max number of lines in a file\n // https://eslint.org/docs/rules/max-lines\n \"max-lines\": [\n \"off\",\n {\n max: 300,\n skipBlankLines: true,\n skipComments: true,\n },\n ],\n\n // enforce a maximum function length\n // https://eslint.org/docs/rules/max-lines-per-function\n \"max-lines-per-function\": [\n \"off\",\n {\n max: 50,\n skipBlankLines: true,\n skipComments: true,\n IIFEs: true,\n },\n ],\n\n // specify the maximum depth callbacks can be nested\n \"max-nested-callbacks\": \"off\",\n\n // limits the number of parameters that can be used in the function declaration.\n \"max-params\": [\"off\", 3],\n\n // specify the maximum number of statement allowed in a function\n \"max-statements\": [\"off\", 10],\n\n // restrict the number of statements per line\n // https://eslint.org/docs/rules/max-statements-per-line\n \"max-statements-per-line\": [\"off\", { max: 1 }],\n\n // enforce a particular style for multiline comments\n // https://eslint.org/docs/rules/multiline-comment-style\n \"multiline-comment-style\": [\"off\", \"starred-block\"],\n\n // require multiline ternary\n // https://eslint.org/docs/rules/multiline-ternary\n // TODO: enable?\n \"multiline-ternary\": [\"off\", \"never\"],\n\n // require a capital letter for constructors\n \"new-cap\": [\n \"error\",\n {\n newIsCap: true,\n newIsCapExceptions: [],\n capIsNew: false,\n capIsNewExceptions: [\"Immutable.Map\", \"Immutable.Set\", \"Immutable.List\"],\n },\n ],\n\n // disallow the omission of parentheses when invoking a constructor with no arguments\n // https://eslint.org/docs/rules/new-parens\n \"new-parens\": \"error\",\n\n // allow/disallow an empty newline after var statement\n \"newline-after-var\": \"off\",\n\n // https://eslint.org/docs/rules/newline-before-return\n \"newline-before-return\": \"off\",\n\n // enforces new line after each method call in the chain to make it\n // more readable and easy to maintain\n // https://eslint.org/docs/rules/newline-per-chained-call\n \"newline-per-chained-call\": [\"error\", { ignoreChainWithDepth: 4 }],\n\n // disallow use of the Array constructor\n \"no-array-constructor\": \"error\",\n\n // disallow use of bitwise operators\n // https://eslint.org/docs/rules/no-bitwise\n \"no-bitwise\": \"error\",\n\n // disallow use of the continue statement\n // https://eslint.org/docs/rules/no-continue\n \"no-continue\": \"error\",\n\n // disallow comments inline after code\n \"no-inline-comments\": \"off\",\n\n // disallow if as the only statement in an else block\n // https://eslint.org/docs/rules/no-lonely-if\n \"no-lonely-if\": \"error\",\n\n // disallow un-paren'd mixes of different operators\n // https://eslint.org/docs/rules/no-mixed-operators\n \"no-mixed-operators\": [\n \"error\",\n {\n // the list of arithmetic groups disallows mixing `%` and `**`\n // with other arithmetic operators.\n groups: [\n [\"%\", \"**\"],\n [\"%\", \"+\"],\n [\"%\", \"-\"],\n [\"%\", \"*\"],\n [\"%\", \"/\"],\n [\"/\", \"*\"],\n [\"&\", \"|\", \"<<\", \">>\", \">>>\"],\n [\"==\", \"!=\", \"===\", \"!==\"],\n [\"&&\", \"||\"],\n [\"in\", \"instanceof\"],\n ],\n allowSamePrecedence: false,\n },\n ],\n\n // disallow mixed spaces and tabs for indentation\n \"no-mixed-spaces-and-tabs\": \"error\",\n\n // disallow use of chained assignment expressions\n // https://eslint.org/docs/rules/no-multi-assign\n \"no-multi-assign\": [\"error\"],\n\n // disallow multiple empty lines, only one newline at the end, and no new lines at the beginning\n // https://eslint.org/docs/rules/no-multiple-empty-lines\n \"no-multiple-empty-lines\": [\"error\", { max: 1, maxBOF: 0, maxEOF: 0 }],\n\n // disallow negated conditions\n // https://eslint.org/docs/rules/no-negated-condition\n \"no-negated-condition\": \"off\",\n\n // disallow nested ternary expressions\n \"no-nested-ternary\": \"error\",\n\n // disallow use of the Object constructor\n \"no-new-object\": \"error\",\n\n // disallow use of unary operators, ++ and --\n // https://eslint.org/docs/rules/no-plusplus\n \"no-plusplus\": \"error\",\n\n // disallow certain syntax forms\n // https://eslint.org/docs/rules/no-restricted-syntax\n \"no-restricted-syntax\": [\n \"error\",\n {\n selector: \"ForInStatement\",\n message:\n \"for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.\",\n },\n {\n selector: \"ForOfStatement\",\n message:\n \"iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.\",\n },\n {\n selector: \"LabeledStatement\",\n message: \"Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.\",\n },\n {\n selector: \"WithStatement\",\n message: \"`with` is disallowed in strict mode because it makes code impossible to predict and optimize.\",\n },\n ],\n\n // disallow space between function identifier and application\n // deprecated in favor of func-call-spacing\n \"no-spaced-func\": \"off\",\n\n // disallow tab characters entirely\n \"no-tabs\": \"error\",\n\n // disallow the use of ternary operators\n \"no-ternary\": \"off\",\n\n // disallow trailing whitespace at the end of lines\n \"no-trailing-spaces\": [\n \"error\",\n {\n skipBlankLines: false,\n ignoreComments: false,\n },\n ],\n\n // disallow dangling underscores in identifiers\n // https://eslint.org/docs/rules/no-underscore-dangle\n \"no-underscore-dangle\": [\n \"error\",\n {\n allow: [\"__DEV__\"],\n allowAfterThis: false,\n allowAfterSuper: false,\n enforceInMethodNames: true,\n },\n ],\n\n // disallow the use of Boolean literals in conditional expressions\n // also, prefer `a || b` over `a ? a : b`\n // https://eslint.org/docs/rules/no-unneeded-ternary\n \"no-unneeded-ternary\": [\"error\", { defaultAssignment: false }],\n\n // disallow whitespace before properties\n // https://eslint.org/docs/rules/no-whitespace-before-property\n \"no-whitespace-before-property\": \"error\",\n\n // enforce the location of single-line statements\n // https://eslint.org/docs/rules/nonblock-statement-body-position\n \"nonblock-statement-body-position\": [\"error\", \"beside\", { overrides: {} }],\n\n // require padding inside curly braces\n \"object-curly-spacing\": [\"error\", \"always\"],\n\n // enforce line breaks between braces\n // https://eslint.org/docs/rules/object-curly-newline\n \"object-curly-newline\": [\n \"error\",\n {\n ObjectExpression: { minProperties: 4, multiline: true, consistent: true },\n ObjectPattern: { minProperties: 4, multiline: true, consistent: true },\n ImportDeclaration: { minProperties: 4, multiline: true, consistent: true },\n ExportDeclaration: { minProperties: 4, multiline: true, consistent: true },\n },\n ],\n\n // enforce \"same line\" or \"multiple line\" on object properties.\n // https://eslint.org/docs/rules/object-property-newline\n \"object-property-newline\": [\n \"error\",\n {\n allowAllPropertiesOnSameLine: true,\n },\n ],\n\n // allow just one var statement per function\n \"one-var\": [\"error\", \"never\"],\n\n // require a newline around variable declaration\n // https://eslint.org/docs/rules/one-var-declaration-per-line\n \"one-var-declaration-per-line\": [\"error\", \"always\"],\n\n // require assignment operator shorthand where possible or prohibit it entirely\n // https://eslint.org/docs/rules/operator-assignment\n \"operator-assignment\": [\"error\", \"always\"],\n\n // Requires operator at the beginning of the line in multiline statements\n // https://eslint.org/docs/rules/operator-linebreak\n \"operator-linebreak\": [\"error\", \"before\", { overrides: { \"=\": \"none\" } }],\n\n // disallow padding within blocks\n \"padded-blocks\": [\n \"error\",\n {\n blocks: \"never\",\n classes: \"never\",\n switches: \"never\",\n },\n {\n allowSingleLineBlocks: true,\n },\n ],\n\n // Require or disallow padding lines between statements\n // https://eslint.org/docs/rules/padding-line-between-statements\n \"padding-line-between-statements\": \"off\",\n\n // Disallow the use of Math.pow in favor of the ** operator\n // https://eslint.org/docs/rules/prefer-exponentiation-operator\n \"prefer-exponentiation-operator\": \"error\",\n\n // Prefer use of an object spread over Object.assign\n // https://eslint.org/docs/rules/prefer-object-spread\n \"prefer-object-spread\": \"error\",\n\n // require quotes around object literal property names\n // https://eslint.org/docs/rules/quote-props.html\n \"quote-props\": [\"error\", \"as-needed\", { keywords: false, unnecessary: true, numbers: false }],\n\n // specify whether double or single quotes should be used\n quotes: [\"error\", \"double\", { avoidEscape: true }],\n\n // do not require jsdoc\n // https://eslint.org/docs/rules/require-jsdoc\n \"require-jsdoc\": \"off\",\n\n // require or disallow use of semicolons instead of ASI\n semi: [\"error\", \"always\"],\n\n // enforce spacing before and after semicolons\n \"semi-spacing\": [\"error\", { before: false, after: true }],\n\n // Enforce location of semicolons\n // https://eslint.org/docs/rules/semi-style\n \"semi-style\": [\"error\", \"last\"],\n\n // requires object keys to be sorted\n \"sort-keys\": [\"off\", \"asc\", { caseSensitive: false, natural: true }],\n\n // sort variables within the same declaration block\n \"sort-vars\": \"off\",\n\n // require or disallow space before blocks\n \"space-before-blocks\": \"error\",\n\n // require or disallow space before function opening parenthesis\n // https://eslint.org/docs/rules/space-before-function-paren\n \"space-before-function-paren\": [\n \"error\",\n {\n anonymous: \"always\",\n named: \"never\",\n asyncArrow: \"always\",\n },\n ],\n\n // require or disallow spaces inside parentheses\n \"space-in-parens\": [\"error\", \"never\"],\n\n // require spaces around operators\n \"space-infix-ops\": \"error\",\n\n // Require or disallow spaces before/after unary operators\n // https://eslint.org/docs/rules/space-unary-ops\n \"space-unary-ops\": [\n \"error\",\n {\n words: true,\n nonwords: false,\n overrides: {},\n },\n ],\n\n // require or disallow a space immediately following the // or /* in a comment\n // https://eslint.org/docs/rules/spaced-comment\n \"spaced-comment\": [\n \"error\",\n \"always\",\n {\n line: {\n exceptions: [\"-\", \"+\", \"*\"],\n markers: [\"=\", \"!\", \"/\"], // space here to support sprockets directives, slash for TS /// comments\n },\n block: {\n exceptions: [\"-\", \"+\"],\n markers: [\"=\", \"!\", \":\", \"::\"], // space here to support sprockets directives and flow comment types\n balanced: true,\n },\n },\n ],\n\n // Enforce spacing around colons of switch statements\n // https://eslint.org/docs/rules/switch-colon-spacing\n \"switch-colon-spacing\": [\"error\", { after: true, before: false }],\n\n // Require or disallow spacing between template tags and their literals\n // https://eslint.org/docs/rules/template-tag-spacing\n \"template-tag-spacing\": [\"error\", \"never\"],\n\n // require or disallow the Unicode Byte Order Mark\n // https://eslint.org/docs/rules/unicode-bom\n \"unicode-bom\": [\"error\", \"never\"],\n\n // require regex literals to be wrapped in parentheses\n \"wrap-regex\": \"off\",\n },\n};\n\nexport default config;\n"]}