@anolilab/eslint-config 14.0.8 → 14.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/config.ts","../src/engine-node-overwrite.ts"],"names":["join","hasDependency","hasDevDependency","packageIsTypeModule","pkg","globals","semver","hasFile","resolvePackage","baseConfig","internalPluginConfig","pluginConfig","loadedPlugins","possiblePlugins","plugin","configName","dependencies","eslint_config_default","foundDependencies","dependency","foundOneOfDependency","rdependency","file","rules","pluginRules","possiblePluginRules","engineRules","engine_node_overwrite_default","consoleLog","name","consolePlugin","hasLogged","installed","configRules","nodeVersion","rule","ruleConfig","minVersion","config","src_default"],"mappings":"mHAYA,MAAO,mDAEP,OAAS,QAAAA,MAAY,OAErB,OAAS,iBAAAC,EAAe,oBAAAC,EAAkB,uBAAAC,EAAqB,OAAAC,MAAW,+BAE1E,OAAOC,MAAa,UACpB,OAAOC,MAAY,SCnBnB,OAAS,iBAAAL,EAAe,oBAAAC,EAAkB,WAAAK,EAAS,kBAAAC,MAAsB,+BAKzE,IAAMC,EAAa,CAAC,iBAAkB,SAAU,QAAS,MAAO,WAAW,EAG9DC,EAAuB,CAChC,SACA,kBACA,SACA,UACA,qBACA,mBACA,OAEA,aACA,UACA,WACA,SAEA,QACA,WACA,OACA,MACA,OACA,WAGA,QACA,UACA,KACA,eACJ,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,kCACZ,aAAc,CAAC,+CAA+C,EAC9D,gBAAiB,CACb,SACA,aACA,YACA,gBAEA,eACA,iBACA,gBACA,oBACA,sBACA,wBACA,cACA,mBACA,wBACA,mBACA,cACA,mBACA,uBACA,iBACA,qBACA,sBACA,mBACA,cACA,iBACA,iBACA,sBACA,wBACA,0BACA,cACA,cACA,qBACA,aACA,cACA,iBACA,mBACA,qBACA,gBACA,gBACA,iBACA,eACA,qBACA,uBACA,uBACA,yBACA,2BACA,2BACA,oBACA,sBACA,cACA,cACA,mBACA,wBACA,mBACA,eACA,iBACA,mBACA,cACA,gBACA,kBACA,eACA,mBACA,iBACA,aACA,eACA,iBACA,aACA,mBACA,uBACA,iBACA,iBACA,eACA,gBACA,cACA,kBACA,iBACA,qBACA,sBACA,iBACA,sBACA,iBACA,kBACA,mBACA,eACA,aACA,iBACA,mBACA,gBACA,qBACA,gBACA,gBACA,oBACA,iBACA,cACA,cACA,gBACA,aACA,eACA,aACA,gBACA,cACA,iBACA,eACA,oBACA,kBACA,eACA,eACA,cACA,iBACA,gBACA,cACA,kBACA,iBACA,sBACA,eACA,cACA,gBACA,kBACA,eACA,cACA,mBACA,eACA,mBACA,uBACA,mBACA,oBACA,YACA,YACA,aACA,qBACA,iBACA,uBACA,qBACA,2BACA,mBACA,kBACA,gBACA,mBACA,iBACA,iBACA,qBACA,iBACA,kBACA,oBACA,mBACA,kBACA,eACA,iBACA,qBACA,eACA,kBACA,eACA,gBACA,kBACA,kBACA,sBACA,uBACA,kBACA,uBACA,eACA,kBACA,kBACA,sBACA,qBACA,mBACA,mBACA,YACA,aACA,iBACA,kBACA,mBACA,kBACA,kBACA,uBACA,uBACA,kBACA,aACA,cACA,gBACA,eACA,aACA,eACA,cACA,gBACA,aACA,eACA,kBACA,eACA,kBACA,aACA,eACA,eACA,iBACA,gBACA,gBACA,kBACA,sBACA,oBACA,YACA,gBACA,kBACA,sBACA,iBACA,qBACA,eACA,oBACA,gBACA,qBACA,mBACA,qBACA,aACA,aACA,eACA,gBACA,kBACA,gBACA,cACA,gBACA,iBACA,mBACA,eACA,mBACA,cACA,gBACA,cACA,gBACA,gBACA,aACA,iBACA,iBACA,mBACA,mBACA,eACA,gBACA,oBACA,gBACA,kBACA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AAC,wCAAwC,CACtD,EACA,kBAAmB,EACvB,CACJ,CACJ,EAEA,OAAQ,GAER,MAAO,CACH,GAAG8B,CACP,CACJ,EAEOM,EAAQD","sourcesContent":["/**\n * rushstack eslint-patch is used to include plugins as dev\n * dependencies instead of imposing them as peer dependencies\n *\n * {@link https://www.npmjs.com/package/@rushstack/eslint-patch}\n * {@link https://stackoverflow.com/a/74478635/1392749}\n * {@link https://github.com/eslint/eslint/issues/3458}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-1/}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-2/}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-3/}\n * {@link https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new}\n */\nimport \"@rushstack/eslint-patch/modern-module-resolution\";\n\nimport { join } from \"node:path\";\n\nimport { hasDependency, hasDevDependency, packageIsTypeModule, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\nimport globals from \"globals\";\nimport semver from \"semver\";\n\nimport { internalPluginConfig, pluginRules, possiblePluginRules, rules } from \"./config\";\nimport engineRules from \"./engine-node-overwrite\";\nimport anolilabEslintConfig from \"./utils/eslint-config\";\nimport { consoleLog, consolePlugin } from \"./utils/loggers\";\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigLoaded) {\n if (process.env[\"DEBUG\"]) {\n consoleLog(\"\\n@anolilab/eslint-config loaded the following plugins:\\n\");\n\n consoleLog(\" @rushstack/eslint-plugin-security\");\n internalPluginConfig\n .map((name: string) => {\n if (name === \"import\") {\n return \"i\";\n }\n\n if (name === \"node\") {\n return \"n\";\n }\n\n return name;\n })\n .forEach((plugin) => consolePlugin(plugin));\n }\n\n let hasLogged = false;\n\n Object.entries(possiblePluginRules).forEach(([plugin, dependencies]) => {\n const hasOneDependency = Object.values(dependencies).some(Boolean);\n\n if (hasOneDependency) {\n hasLogged = true;\n\n consoleLog(\n `\\nYour package.json container dependencies for the \"${plugin}\" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`,\n );\n\n Object.entries(dependencies).forEach(([dependency, installed]) => {\n if (!installed) {\n consoleLog(` ${dependency}`);\n }\n });\n }\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (hasLogged) {\n consoleLog(\"\\nTo disable this message, add the following to your package.json:\");\n consoleLog(' \"anolilab\": { \"eslint-config\": { plugin: { \"plugin-name\": false } } }\\n');\n }\n\n consoleLog('To disable all logging, add the following to your eslint command call \"NO_LOGS=true eslint ...\"');\n\n global.hasAnolilabEsLintConfigLoaded = true;\n}\n\nconst configRules: Linter.RulesRecord = {};\nlet nodeVersion: string | undefined;\n\nif (pkg?.engines?.[\"node\"]) {\n nodeVersion = pkg.engines[\"node\"];\n}\n\nObject.entries(engineRules).forEach(([rule, ruleConfig]) => {\n Object.keys(ruleConfig)\n .sort(semver.rcompare)\n .forEach((minVersion) => {\n if (nodeVersion && semver.intersects(nodeVersion, `<${minVersion}`)) {\n // eslint-disable-next-line security/detect-object-injection\n configRules[rule] = ruleConfig[minVersion as keyof typeof ruleConfig] as Linter.RuleEntry;\n }\n });\n});\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigPrettier && (hasDependency(\"prettier\") || hasDevDependency(\"prettier\"))) {\n global.hasAnolilabEsLintConfigPrettier = true;\n\n if (anolilabEslintConfig[\"info_on_disabling_prettier_conflict_rule\"] !== false) {\n consoleLog(\"\\nFound prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier\");\n }\n}\n\nconst config: Linter.Config = {\n // After an .eslintrc.js file is loaded, ESLint will normally continue visiting all parent folders\n // to look for other .eslintrc.js files, and also consult a personal file ~/.eslintrc.js. If any files\n // are found, their options will be merged. This is difficult for humans to understand, and it will cause\n // nondeterministic behavior if files are loaded from outside the Git working folder.\n //\n // Setting root=true causes ESLint to stop looking for other config files after the first .eslintrc.js\n extends: [\n ...rules.map((plugin) => join(__dirname, `./config/${plugin}.js`)),\n\n ...pluginRules.map((plugin) => join(__dirname, `./config/plugins/${plugin}.js`)),\n ],\n globals: {\n ...globals.browser,\n ...globals.nodeBuiltin,\n },\n ignorePatterns: [\n \"!.*\",\n\n \".git/\",\n \"node_modules/\",\n \"bower_components/\",\n \"jspm_packages/\",\n \".npm/\",\n\n \"lib-cov/\",\n \"coverage/\",\n \".nyc_output/\",\n \".cache/\",\n\n \"build/\",\n \"dist/\",\n \"tmp/\",\n\n \"**/*.min.*\",\n\n // Manually authored .d.ts files are generally used to describe external APIs that are not expected\n // to follow our coding conventions. Linting those files tends to produce a lot of spurious suppressions,\n // so we simply ignore them.\n \"*.d.ts\",\n\n \"pnpm-lock.yaml\",\n ],\n overrides: [\n {\n files: [\"**/migrations/*.{js,ts}\"],\n rules: {\n \"filenames/match-regex\": \"off\",\n },\n },\n {\n files: [\n // Test files\n \"**/*.spec.{js,ts,tsx}\",\n \"**/*.test.{js,ts,tsx}\",\n\n // Facebook convention\n \"**/__mocks__/*.{js,ts,tsx}\",\n \"**/__tests__/*.{js,ts,tsx}\",\n\n // Microsoft convention\n \"**/test/*.{js,ts,tsx}\",\n ],\n rules: {\n \"no-magic-numbers\": \"off\",\n \"sonarjs/no-duplicate-string\": \"off\",\n },\n },\n // Fixes https://github.com/eslint/eslint/discussions/15305\n {\n files: packageIsTypeModule ? [\"*.js\", \"*.mjs\"] : [\"*.mjs\"],\n parser: \"@babel/eslint-parser\",\n parserOptions: {\n babelOptions: {\n plugins: [\"@babel/plugin-syntax-import-assertions\"],\n },\n requireConfigFile: false,\n },\n },\n ],\n // Disable the parser by default\n parser: \"\",\n // is loaded.\n rules: {\n ...configRules,\n },\n};\n\nexport default config;\n","import { hasDependency, hasDevDependency, hasFile, resolvePackage } from \"@anolilab/package-json-utils\";\n\nimport type { PackageRules } from \"./types\";\nimport anolilabEslintConfig from \"./utils/eslint-config\";\n\nconst baseConfig = [\"best-practices\", \"errors\", \"style\", \"es6\", \"variables\"];\n\n// eslint-disable-next-line import/exports-last\nexport const internalPluginConfig = [\n \"compat\",\n \"eslint-comments\",\n \"import\",\n \"promise\",\n \"simple-import-sort\",\n \"no-extend-native\",\n \"node\",\n // Security Rules\n \"no-secrets\",\n \"sonarjs\",\n \"security\",\n \"regexp\",\n // file rules\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"html\",\n \"no-loops\",\n\n // custom rules\n \"antfu\",\n \"unicorn\",\n \"es\",\n \"perfectionist\",\n];\n\nconst pluginConfig: PackageRules = [\n {\n configName: \"array-func\",\n dependencies: [\"eslint-plugin-array-func\"],\n },\n {\n configName: \"jsdoc\",\n dependencies: [\"eslint-plugin-jsdoc\"],\n },\n {\n configName: \"tsdoc\",\n dependencies: [\"eslint-plugin-tsdoc\", \"typescript\"],\n },\n {\n configName: \"you-dont-need-lodash-underscore\",\n dependencies: [\"eslint-plugin-you-dont-need-lodash-underscore\"],\n oneOfDependency: [\n \"lodash\",\n \"underscore\",\n \"lodash-es\",\n \"@types/lodash\",\n\n \"lodash.chunk\",\n \"lodash.compact\",\n \"lodash.concat\",\n \"lodash.difference\",\n \"lodash.differenceby\",\n \"lodash.differencewith\",\n \"lodash.drop\",\n \"lodash.dropright\",\n \"lodash.droprightwhile\",\n \"lodash.dropwhile\",\n \"lodash.fill\",\n \"lodash.findindex\",\n \"lodash.findlastindex\",\n \"lodash.flatten\",\n \"lodash.flattendeep\",\n \"lodash.flattendepth\",\n \"lodash.frompairs\",\n \"lodash.head\",\n \"lodash.indexof\",\n \"lodash.initial\",\n \"lodash.intersection\",\n \"lodash.intersectionby\",\n \"lodash.intersectionwith\",\n \"lodash.join\",\n \"lodash.last\",\n \"lodash.lastindexof\",\n \"lodash.nth\",\n \"lodash.pull\",\n \"lodash.pullall\",\n \"lodash.pullallby\",\n \"lodash.pullallwith\",\n \"lodash.pullat\",\n \"lodash.remove\",\n \"lodash.reverse\",\n \"lodash.slice\",\n \"lodash.sortedindex\",\n \"lodash.sortedindexby\",\n \"lodash.sortedindexof\",\n \"lodash.sortedlastindex\",\n \"lodash.sortedlastindexby\",\n \"lodash.sortedlastindexof\",\n \"lodash.sorteduniq\",\n \"lodash.sorteduniqby\",\n \"lodash.tail\",\n \"lodash.take\",\n \"lodash.takeright\",\n \"lodash.takerightwhile\",\n \"lodash.takewhile\",\n \"lodash.union\",\n \"lodash.unionby\",\n \"lodash.unionwith\",\n \"lodash.uniq\",\n \"lodash.uniqby\",\n \"lodash.uniqwith\",\n \"lodash.unzip\",\n \"lodash.unzipwith\",\n \"lodash.without\",\n \"lodash.xor\",\n \"lodash.xorby\",\n \"lodash.xorwith\",\n \"lodash.zip\",\n \"lodash.zipobject\",\n \"lodash.zipobjectdeep\",\n \"lodash.zipwith\",\n \"lodash.countby\",\n \"lodash.every\",\n \"lodash.filter\",\n \"lodash.find\",\n \"lodash.findlast\",\n \"lodash.flatmap\",\n \"lodash.flatmapdeep\",\n \"lodash.flatmapdepth\",\n \"lodash.foreach\",\n \"lodash.foreachright\",\n \"lodash.groupby\",\n \"lodash.includes\",\n \"lodash.invokemap\",\n \"lodash.keyby\",\n \"lodash.map\",\n \"lodash.orderby\",\n \"lodash.partition\",\n \"lodash.reduce\",\n \"lodash.reduceright\",\n \"lodash.reject\",\n \"lodash.sample\",\n \"lodash.samplesize\",\n \"lodash.shuffle\",\n \"lodash.size\",\n \"lodash.some\",\n \"lodash.sortby\",\n \"lodash.now\",\n \"lodash.after\",\n \"lodash.ary\",\n \"lodash.before\",\n \"lodash.bind\",\n \"lodash.bindkey\",\n \"lodash.curry\",\n \"lodash.curryright\",\n \"lodash.debounce\",\n \"lodash.defer\",\n \"lodash.delay\",\n \"lodash.flip\",\n \"lodash.memoize\",\n \"lodash.negate\",\n \"lodash.once\",\n \"lodash.overargs\",\n \"lodash.partial\",\n \"lodash.partialright\",\n \"lodash.rearg\",\n \"lodash.rest\",\n \"lodash.spread\",\n \"lodash.throttle\",\n \"lodash.unary\",\n \"lodash.wrap\",\n \"lodash.castarray\",\n \"lodash.clone\",\n \"lodash.clonedeep\",\n \"lodash.clonedeepwith\",\n \"lodash.clonewith\",\n \"lodash.conformsto\",\n \"lodash.eq\",\n \"lodash.gt\",\n \"lodash.gte\",\n \"lodash.isarguments\",\n \"lodash.isarray\",\n \"lodash.isarraybuffer\",\n \"lodash.isarraylike\",\n \"lodash.isarraylikeobject\",\n \"lodash.isboolean\",\n \"lodash.isbuffer\",\n \"lodash.isdate\",\n \"lodash.iselement\",\n \"lodash.isempty\",\n \"lodash.isequal\",\n \"lodash.isequalwith\",\n \"lodash.iserror\",\n \"lodash.isfinite\",\n \"lodash.isfunction\",\n \"lodash.isinteger\",\n \"lodash.islength\",\n \"lodash.ismap\",\n \"lodash.ismatch\",\n \"lodash.ismatchwith\",\n \"lodash.isnan\",\n \"lodash.isnative\",\n \"lodash.isnil\",\n \"lodash.isnull\",\n \"lodash.isnumber\",\n \"lodash.isobject\",\n \"lodash.isobjectlike\",\n \"lodash.isplainobject\",\n \"lodash.isregexp\",\n \"lodash.issafeinteger\",\n \"lodash.isset\",\n \"lodash.isstring\",\n \"lodash.issymbol\",\n \"lodash.istypedarray\",\n \"lodash.isundefined\",\n \"lodash.isweakmap\",\n \"lodash.isweakset\",\n \"lodash.lt\",\n \"lodash.lte\",\n \"lodash.toarray\",\n \"lodash.tofinite\",\n \"lodash.tointeger\",\n \"lodash.tolength\",\n \"lodash.tonumber\",\n \"lodash.toplainobject\",\n \"lodash.tosafeinteger\",\n \"lodash.tostring\",\n \"lodash.add\",\n \"lodash.ceil\",\n \"lodash.divide\",\n \"lodash.floor\",\n \"lodash.max\",\n \"lodash.maxby\",\n \"lodash.mean\",\n \"lodash.meanby\",\n \"lodash.min\",\n \"lodash.minby\",\n \"lodash.multiply\",\n \"lodash.round\",\n \"lodash.subtract\",\n \"lodash.sum\",\n \"lodash.sumby\",\n \"lodash.clamp\",\n \"lodash.inrange\",\n \"lodash.random\",\n \"lodash.assign\",\n \"lodash.assignin\",\n \"lodash.assigninwith\",\n \"lodash.assignwith\",\n \"lodash.at\",\n \"lodash.create\",\n \"lodash.defaults\",\n \"lodash.defaultsdeep\",\n \"lodash.findkey\",\n \"lodash.findlastkey\",\n \"lodash.forin\",\n \"lodash.forinright\",\n \"lodash.forown\",\n \"lodash.forownright\",\n \"lodash.functions\",\n \"lodash.functionsin\",\n \"lodash.get\",\n \"lodash.has\",\n \"lodash.hasin\",\n \"lodash.invert\",\n \"lodash.invertby\",\n \"lodash.invoke\",\n \"lodash.keys\",\n \"lodash.keysin\",\n \"lodash.mapkeys\",\n \"lodash.mapvalues\",\n \"lodash.merge\",\n \"lodash.mergewith\",\n \"lodash.omit\",\n \"lodash.omitby\",\n \"lodash.pick\",\n \"lodash.pickby\",\n \"lodash.result\",\n \"lodash.set\",\n \"lodash.setwith\",\n \"lodash.topairs\",\n \"lodash.topairsin\",\n \"lodash.transform\",\n \"lodash.unset\",\n \"lodash.update\",\n \"lodash.updatewith\",\n \"lodash.values\",\n \"lodash.valuesin\",\n \"lodash.chain\",\n \"lodash.tap\",\n \"lodash.thru\",\n \"lodash.camelcase\",\n \"lodash.capitalize\",\n \"lodash.deburr\",\n \"lodash.endswith\",\n \"lodash.escape\",\n \"lodash.escaperegexp\",\n \"lodash.kebabcase\",\n \"lodash.lowercase\",\n \"lodash.lowerfirst\",\n \"lodash.pad\",\n \"lodash.padend\",\n \"lodash.padstart\",\n \"lodash.parseint\",\n \"lodash.repeat\",\n \"lodash.replace\",\n \"lodash.snakecase\",\n \"lodash.split\",\n \"lodash.startcase\",\n \"lodash.startswith\",\n \"lodash.template\",\n \"lodash.tolower\",\n \"lodash.toupper\",\n \"lodash.trim\",\n \"lodash.trimend\",\n \"lodash.trimstart\",\n \"lodash.truncate\",\n \"lodash.unescape\",\n \"lodash.uppercase\",\n \"lodash.upperfirst\",\n \"lodash.words\",\n \"lodash.attempt\",\n \"lodash.bindall\",\n \"lodash.cond\",\n \"lodash.conforms\",\n \"lodash.constant\",\n \"lodash.defaultto\",\n \"lodash.flow\",\n \"lodash.flowright\",\n \"lodash.identity\",\n \"lodash.iteratee\",\n \"lodash.matches\",\n \"lodash.matchesproperty\",\n \"lodash.method\",\n \"lodash.methodof\",\n \"lodash.mixin\",\n \"lodash.noconflict\",\n \"lodash.noop\",\n \"lodash.ntharg\",\n \"lodash.over\",\n \"lodash.overevery\",\n \"lodash.oversome\",\n \"lodash.property\",\n \"lodash.propertyof\",\n \"lodash.range\",\n \"lodash.rangeright\",\n \"lodash.runincontext\",\n \"lodash.stubarray\",\n \"lodash.stubfalse\",\n \"lodash.stubobject\",\n \"lodash.stubstring\",\n \"lodash.stubtrue\",\n \"lodash.times\",\n \"lodash.topath\",\n \"lodash.uniqueid\",\n ],\n },\n {\n configName: \"mdx\",\n dependencies: [\"eslint-plugin-mdx\"],\n oneOfDependency: [\"nextra\", \"docz\", \"@docusaurus/core\", \"gatsby-plugin-mdx\"],\n resolve: [\"@mdx-js/mdx\", \"remark-mdx\", \"@mdx-js/loader\", \"@mdx-js/rollup\", \"@mdx-js/react\"],\n },\n {\n configName: \"no-unsanitized\",\n dependencies: [\"eslint-plugin-no-unsanitized\"],\n },\n {\n configName: \"react\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react\"],\n },\n {\n configName: \"validate-jsx-nesting\",\n dependencies: [\"eslint-plugin-validate-jsx-nesting\"],\n oneOfDependency: [\"react\", \"react-dom\", \"preact\", \"preact/compat\"],\n },\n {\n configName: \"ssr-friendly\",\n dependencies: [\"eslint-plugin-ssr-friendly\"],\n oneOfDependency: [\"react\", \"react-dom\", \"preact\", \"preact/compat\"],\n },\n {\n configName: \"react-redux\",\n dependencies: [\"eslint-plugin-react-redux\"],\n oneOfDependency: [\"@reduxjs/toolkit\", \"redux\"],\n },\n {\n configName: \"jsx-a11y\",\n dependencies: [\"eslint-plugin-jsx-a11y\"],\n oneOfDependency: [\"react\", \"react-dom\", \"preact\", \"preact/compat\"],\n },\n {\n configName: \"react-hooks\",\n dependencies: [\"eslint-plugin-react-hooks\"],\n oneOfDependency: [\"react\", \"react-dom\", \"preact\", \"preact/compat\"],\n },\n {\n configName: \"react-usememo\",\n dependencies: [\"@arthurgeron/eslint-plugin-react-usememo\"],\n oneOfDependency: [\"react\", \"react-dom\", \"preact\", \"preact/compat\"],\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 oneOfDependency: [\"tailwindcss\", \"@tailwindcss/typography\", \"@tailwindcss/forms\", \"@tailwindcss/aspect-ratio\", \"@tailwindcss/line-clamp\"],\n },\n {\n configName: \"cypress\",\n dependencies: [\"cypress\", \"eslint-plugin-cypress\"],\n },\n {\n configName: \"jest\",\n dependencies: [\"jest\", \"eslint-plugin-jest\"],\n },\n {\n configName: \"jest-dom\",\n dependencies: [\"jest\", \"@testing-library/jest-dom\", \"eslint-plugin-jest-dom\"],\n },\n {\n configName: \"jest-async\",\n dependencies: [\"jest\", \"eslint-plugin-jest-async\"],\n },\n {\n configName: \"jest-formatting\",\n dependencies: [\"jest\", \"eslint-plugin-jest-formatting\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"tailwindcss\"],\n },\n {\n configName: \"testing-library-dom\",\n dependencies: [\"@testing-library/dom\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"testing-library-react\",\n dependencies: [\"react\", \"@testing-library/react\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"typescript\",\n dependencies: [\"typescript\"],\n files: [\"tsconfig.json\", \"tsconfig.eslint.json\"],\n },\n {\n configName: \"deprecation\",\n dependencies: [\"typescript\"],\n files: [\"tsconfig.json\", \"tsconfig.eslint.json\"],\n },\n {\n configName: \"no-only-tests\",\n dependencies: [],\n oneOfDependency: [\"jest\", \"mocha\", \"jasmine\", \"tape\", \"ava\", \"qunit\", \"cypress\"],\n },\n {\n configName: \"etc\",\n dependencies: [\"typescript\", \"eslint-plugin-etc\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\", \"eslint-plugin-vitest-globals\"],\n },\n {\n configName: \"zod\",\n dependencies: [\"zod\", \"eslint-plugin-zod\"],\n },\n {\n configName: \"ava\",\n dependencies: [\"ava\", \"eslint-plugin-ava\"],\n },\n {\n configName: \"editorconfig\",\n dependencies: [\"eslint-plugin-editorconfig\"],\n files: [\".editorconfig\"],\n },\n {\n configName: \"storybook\",\n dependencies: [\"storybook\", \"eslint-plugin-storybook\"],\n },\n {\n configName: \"playwright\",\n dependencies: [\"playwright\", \"eslint-plugin-playwright\"],\n },\n {\n configName: \"tanstack-query\",\n dependencies: [\"@tanstack/react-query\", \"@tanstack/eslint-plugin-query\"],\n },\n];\n\nconst loadedPlugins: string[] = [...internalPluginConfig];\nconst possiblePlugins: Record<string, Record<string, boolean>> = {};\n\nif (loadedPlugins.length === internalPluginConfig.length) {\n // eslint-disable-next-line sonarjs/cognitive-complexity\n pluginConfig.forEach((plugin) => {\n const { configName, dependencies } = plugin;\n\n // eslint-disable-next-line security/detect-object-injection\n if ((anolilabEslintConfig as unknown as Record<string, Record<string, false | undefined>>)[\"plugin\"]?.[configName] !== false) {\n const foundDependencies = [];\n\n dependencies.forEach((dependency) => {\n if (hasDependency(dependency) || hasDevDependency(dependency)) {\n foundDependencies.push(dependency);\n }\n });\n\n // eslint-disable-next-line security/detect-object-injection\n possiblePlugins[configName] = {};\n\n if (foundDependencies.length === 0) {\n if (plugin.oneOfDependency !== undefined) {\n let foundOneOfDependency = false;\n\n plugin.oneOfDependency.forEach((dependency) => {\n if (!foundOneOfDependency && (hasDependency(dependency) || hasDevDependency(dependency))) {\n foundOneOfDependency = true;\n\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[dependency] = true;\n }\n });\n }\n\n if (plugin.resolve !== undefined) {\n plugin.resolve.forEach((rdependency) => {\n if (resolvePackage(rdependency) !== undefined) {\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[rdependency] = true;\n }\n });\n }\n\n if (plugin.files !== undefined) {\n plugin.files.forEach((file) => {\n if (hasFile(file)) {\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[file] = true;\n }\n });\n }\n }\n\n if (foundDependencies.length === dependencies.length) {\n // eslint-disable-next-line security/detect-object-injection,@typescript-eslint/no-dynamic-delete\n delete possiblePlugins[configName];\n\n loadedPlugins.push(configName);\n } else {\n dependencies.forEach((dependency) => {\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[dependency] = hasDependency(dependency) || hasDevDependency(dependency);\n });\n }\n }\n });\n}\n\nexport const rules = baseConfig;\nexport const pluginRules = loadedPlugins;\n\nexport const possiblePluginRules = possiblePlugins;\n","/**\nDefine the rules config that are overwritten only for specific version of Node.js based on `engines.node` in package.json or the `nodeVersion` option.\n\nThe keys are rule names and the values are an Object with a valid semver (`4.0.0` is valid `4` is not) as keys and the rule configuration as values.\n\nEach entry define the rule config and the maximum Node.js version for which to set it.\nThe entry with the lowest version that is compliant with the `engines.node`/`nodeVersion` range will be used.\n\n@type {Object}\n\n@example\n```\n{\n 'plugin/rule': {\n '6.0.0': ['error', {prop: 'node-6-conf'}],\n '8.0.0': ['error', {prop: 'node-8-conf'}]\n }\n}\n```\n\nWith `engines.node` set to `>=4` the rule `plugin/rule` will not be used.\nWith `engines.node` set to `>=6` the rule `plugin/rule` will be used with the config `{prop: 'node-6-conf'}`.\nWith `engines.node` set to `>=8` the rule `plugin/rule` will be used with the config `{prop: 'node-8-conf'}`.\n*/\nconst engineRules = {\n \"n/prefer-global/text-decoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/text-encoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/url\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/url-search-params\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-promises/dns\": {\n \"11.14.0\": \"off\",\n },\n \"n/prefer-promises/fs\": {\n \"11.14.0\": \"off\",\n },\n \"no-useless-catch\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-destructuring\": {\n \"6.0.0\": \"off\",\n },\n \"prefer-named-capture-group\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-object-spread\": {\n \"8.3.0\": \"off\",\n },\n \"prefer-rest-params\": {\n \"6.0.0\": \"off\",\n },\n \"promise/prefer-await-to-then\": {\n \"7.6.0\": \"off\",\n },\n \"unicorn/no-new-buffer\": {\n \"5.10.0\": \"off\",\n },\n \"unicorn/prefer-flat-map\": {\n \"11.0.0\": \"off\",\n },\n \"unicorn/prefer-spread\": {\n \"5.0.0\": \"off\",\n },\n};\n\nexport default engineRules;\n"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/config.ts","../src/engine-node-overwrite.ts"],"names":["join","hasDependency","hasDevDependency","packageIsTypeModule","pkg","globals","intersects","rcompare","hasFile","resolvePackage","baseConfig","internalPluginConfig","pluginConfig","loadedPlugins","possiblePlugins","plugin","configName","dependencies","eslint_config_default","foundDependencies","dependency","foundOneOfDependency","rdependency","file","rules","pluginRules","possiblePluginRules","engineRules","engine_node_overwrite_default","consoleLog","name","consolePlugin","hasLogged","installed","configRules","nodeVersion","rule","ruleConfig","minVersion","config","src_default"],"mappings":"mHAYA,MAAO,mDAEP,OAAS,QAAAA,MAAY,OAErB,OAAS,iBAAAC,EAAe,oBAAAC,EAAkB,uBAAAC,EAAqB,OAAAC,MAAW,+BAE1E,OAAOC,MAAa,UACpB,OAAS,cAAAC,EAAY,YAAAC,MAAgB,SCnBrC,OAAS,iBAAAN,EAAe,oBAAAC,EAAkB,WAAAM,EAAS,kBAAAC,MAAsB,+BAKzE,IAAMC,EAAa,CAAC,iBAAkB,SAAU,QAAS,MAAO,WAAW,EAG9DC,EAAuB,CAChC,SACA,kBACA,SACA,UACA,qBACA,mBACA,OAEA,aACA,UACA,WACA,SAEA,QACA,WACA,OACA,MACA,OACA,WAGA,QACA,UACA,KACA,eACJ,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,kCACZ,aAAc,CAAC,+CAA+C,EAC9D,gBAAiB,CACb,SACA,aACA,YACA,gBAEA,eACA,iBACA,gBACA,oBACA,sBACA,wBACA,cACA,mBACA,wBACA,mBACA,cACA,mBACA,uBACA,iBACA,qBACA,sBACA,mBACA,cACA,iBACA,iBACA,sBACA,wBACA,0BACA,cACA,cACA,qBACA,aACA,cACA,iBACA,mBACA,qBACA,gBACA,gBACA,iBACA,eACA,qBACA,uBACA,uBACA,yBACA,2BACA,2BACA,oBACA,sBACA,cACA,cACA,mBACA,wBACA,mBACA,eACA,iBACA,mBACA,cACA,gBACA,kBACA,eACA,mBACA,iBACA,aACA,eACA,iBACA,aACA,mBACA,uBACA,iBACA,iBACA,eACA,gBACA,cACA,kBACA,iBACA,qBACA,sBACA,iBACA,sBACA,iBACA,kBACA,mBACA,eACA,aACA,iBACA,mBACA,gBACA,qBACA,gBACA,gBACA,oBACA,iBACA,cACA,cACA,gBACA,aACA,eACA,aACA,gBACA,cACA,iBACA,eACA,oBACA,kBACA,eACA,eACA,cACA,iBACA,gBACA,cACA,kBACA,iBACA,sBACA,eACA,cACA,gBACA,kBACA,eACA,cACA,mBACA,eACA,mBACA,uBACA,mBACA,oBACA,YACA,YACA,aACA,qBACA,iBACA,uBACA,qBACA,2BACA,mBACA,kBACA,gBACA,mBACA,iBACA,iBACA,qBACA,iBACA,kBACA,oBACA,mBACA,kBACA,eACA,iBACA,qBACA,eACA,kBACA,eACA,gBACA,kBACA,kBACA,sBACA,uBACA,kBACA,uBACA,eACA,kBACA,kBACA,sBACA,qBACA,mBACA,mBACA,YACA,aACA,iBACA,kBACA,mBACA,kBACA,kBACA,uBACA,uBACA,kBACA,aACA,cACA,gBACA,eACA,aACA,eACA,cACA,gBACA,aACA,eACA,kBACA,eACA,kBACA,aACA,eACA,eACA,iBACA,gBACA,gBACA,kBACA,sBACA,oBACA,YACA,gBACA,kBACA,sBACA,iBACA,qBACA,eACA,oBACA,gBACA,qBACA,mBACA,qBACA,aACA,aACA,eACA,gBACA,kBACA,gBACA,cACA,gBACA,iBACA,mBACA,eACA,mBACA,cACA,gBACA,cACA,gBACA,gBACA,aACA,iBACA,iBACA,mBACA,mBACA,eACA,gBACA,oBACA,gBACA,kBACA,eACA,aACA,cACA,mBACA,oBACA,gBACA,kBACA,gBACA,sBACA,mBACA,mBACA,oBACA,aACA,gBACA,kBACA,kBACA,gBACA,iBACA,mBACA,eACA,mBACA,oBACA,kBACA,iBACA,iBACA,cACA,iBACA,mBACA,kBACA,kBACA,mBACA,oBACA,eACA,iBACA,iBACA,cACA,kBACA,kBACA,mBACA,cACA,mBACA,kBACA,kBACA,iBACA,yBACA,gBACA,kBACA,eACA,oBACA,cACA,gBACA,cACA,mBACA,kBACA,kBACA,oBACA,eACA,oBACA,sBACA,mBACA,mBACA,oBACA,oBACA,kBACA,eACA,gBACA,iBACJ,CACJ,EACA,CACI,WAAY,MACZ,aAAc,CAAC,mBAAmB,EAClC,gBAAiB,CAAC,SAAU,OAAQ,mBAAoB,mBAAmB,EAC3E,QAAS,CAAC,cAAe,aAAc,iBAAkB,iBAAkB,eAAe,CAC9F,EACA,CACI,WAAY,iBACZ,aAAc,CAAC,8BAA8B,CACjD,EACA,CACI,WAAY,QACZ,aAAc,CAAC,QAAS,YAAa,qBAAqB,CAC9D,EACA,CACI,WAAY,uBACZ,aAAc,CAAC,oCAAoC,EACnD,gBAAiB,CAAC,QAAS,YAAa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AoBe,CAAM,KAAK,CAAC,CACnF,EACA,QAAS,CACL,GAAGV,EAAQ,QACX,GAAGA,EAAQ,YACX,GAAIF,EACE,CACE,UAAW,MACX,WAAY,MACZ,QAAS,MACT,QAAS,KACb,EACE,CAAE,UAAW,GAAM,WAAY,GAAM,QAAS,GAAM,QAAS,EAAK,CAC5E,EACA,eAAgB,CACZ,MAEA,QACA,gBACA,oBACA,iBACA,QAEA,WACA,YACA,eACA,UAEA,SACA,QACA,OAEA,aAKA,SAEA,gBACJ,EACA,UAAW,CACP,CACI,MAAO,CAAC,yBAAyB,EACjC,MAAO,CACH,wBAAyB,KAC7B,CACJ,EACA,CACI,MAAO,CAEH,wBACA,wBAGA,6BACA,6BAGA,uBACJ,EACA,MAAO,CACH,mBAAoB,MACpB,8BAA+B,KACnC,CACJ,EAEA,CACI,MAAOA,EAAsB,CAAC,UAAW,UAAU,EAAI,CAAC,UAAU,EAClE,OAAQ,uBACR,cAAe,CACX,aAAc,CACV,QAAS,CAAC,wCAAwC,CACtD,EACA,kBAAmB,EACvB,CACJ,EACA,CACI,IAAK,CACD,SAAU,EACd,EACA,MAAO,CAAC,UAAU,EAElB,QAAS,CACL,UAAW,GACX,WAAY,GACZ,QAAS,GACT,QAAS,EACb,CACJ,EACA,CACI,IAAK,CACD,SAAU,EACd,EACA,MAAO,CAAC,UAAU,EAClB,QAAS,CACL,UAAW,MACX,WAAY,MACZ,QAAS,MACT,QAAS,KACb,CACJ,CACJ,EAEA,OAAQ,GAER,MAAO,CACH,GAAG+B,CACP,CACJ,EAEOM,EAAQD","sourcesContent":["/**\n * rushstack eslint-patch is used to include plugins as dev\n * dependencies instead of imposing them as peer dependencies\n *\n * {@link https://www.npmjs.com/package/@rushstack/eslint-patch}\n * {@link https://stackoverflow.com/a/74478635/1392749}\n * {@link https://github.com/eslint/eslint/issues/3458}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-1/}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-2/}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-3/}\n * {@link https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new}\n */\nimport \"@rushstack/eslint-patch/modern-module-resolution\";\n\nimport { join } from \"node:path\";\n\nimport { hasDependency, hasDevDependency, packageIsTypeModule, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\nimport globals from \"globals\";\nimport { intersects, rcompare } from \"semver\";\n\nimport { internalPluginConfig, pluginRules, possiblePluginRules, rules } from \"./config\";\nimport engineRules from \"./engine-node-overwrite\";\nimport anolilabEslintConfig from \"./utils/eslint-config\";\nimport { consoleLog, consolePlugin } from \"./utils/loggers\";\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigLoaded) {\n if (process.env[\"DEBUG\"]) {\n consoleLog(\"\\n@anolilab/eslint-config loaded the following plugins:\\n\");\n\n consoleLog(\" @rushstack/eslint-plugin-security\");\n internalPluginConfig\n .map((name: string) => {\n if (name === \"import\") {\n return \"i\";\n }\n\n if (name === \"node\") {\n return \"n\";\n }\n\n return name;\n })\n .forEach((plugin) => consolePlugin(plugin));\n }\n\n let hasLogged = false;\n\n Object.entries(possiblePluginRules).forEach(([plugin, dependencies]) => {\n const hasOneDependency = Object.values(dependencies).some(Boolean);\n\n if (hasOneDependency) {\n hasLogged = true;\n\n consoleLog(\n `\\nYour package.json container dependencies for the \"${plugin}\" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`,\n );\n\n Object.entries(dependencies).forEach(([dependency, installed]) => {\n if (!installed) {\n consoleLog(` ${dependency}`);\n }\n });\n }\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (hasLogged) {\n consoleLog(\"\\nTo disable this message, add the following to your package.json:\");\n consoleLog(' \"anolilab\": { \"eslint-config\": { plugin: { \"plugin-name\": false } } }\\n');\n }\n\n consoleLog('To disable all logging, add the following to your eslint command call \"NO_LOGS=true eslint ...\"');\n\n global.hasAnolilabEsLintConfigLoaded = true;\n}\n\nconst configRules: Linter.RulesRecord = {};\n\nlet nodeVersion: string | undefined;\n\nif (pkg?.engines?.[\"node\"]) {\n nodeVersion = pkg.engines[\"node\"];\n}\n\nObject.entries(engineRules).forEach(([rule, ruleConfig]) => {\n Object.keys(ruleConfig)\n .sort(rcompare)\n .forEach((minVersion) => {\n if (nodeVersion && intersects(nodeVersion, `<${minVersion}`)) {\n // eslint-disable-next-line security/detect-object-injection\n configRules[rule] = ruleConfig[minVersion as keyof typeof ruleConfig] as Linter.RuleEntry;\n }\n });\n});\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigPrettier && (hasDependency(\"prettier\") || hasDevDependency(\"prettier\"))) {\n global.hasAnolilabEsLintConfigPrettier = true;\n\n if (anolilabEslintConfig[\"info_on_disabling_prettier_conflict_rule\"] !== false) {\n consoleLog(\"\\nFound prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier\");\n }\n}\n\nconst config: Linter.Config = {\n // After an .eslintrc.js file is loaded, ESLint will normally continue visiting all parent folders\n // to look for other .eslintrc.js files, and also consult a personal file ~/.eslintrc.js. If any files\n // are found, their options will be merged. This is difficult for humans to understand, and it will cause\n // nondeterministic behavior if files are loaded from outside the Git working folder.\n //\n // Setting root=true causes ESLint to stop looking for other config files after the first .eslintrc.js\n extends: [\n ...rules.map((plugin) => join(__dirname, `./config/${plugin}.js`)),\n\n ...pluginRules.map((plugin) => join(__dirname, `./config/plugins/${plugin}.js`)),\n ],\n globals: {\n ...globals.browser,\n ...globals.nodeBuiltin,\n ...(packageIsTypeModule\n ? {\n __dirname: \"off\",\n __filename: \"off\",\n exports: \"off\",\n require: \"off\",\n }\n : { __dirname: true, __filename: true, exports: true, require: true }),\n },\n ignorePatterns: [\n \"!.*\",\n\n \".git/\",\n \"node_modules/\",\n \"bower_components/\",\n \"jspm_packages/\",\n \".npm/\",\n\n \"lib-cov/\",\n \"coverage/\",\n \".nyc_output/\",\n \".cache/\",\n\n \"build/\",\n \"dist/\",\n \"tmp/\",\n\n \"**/*.min.*\",\n\n // Manually authored .d.ts files are generally used to describe external APIs that are not expected\n // to follow our coding conventions. Linting those files tends to produce a lot of spurious suppressions,\n // so we simply ignore them.\n \"*.d.ts\",\n\n \"pnpm-lock.yaml\",\n ],\n overrides: [\n {\n files: [\"**/migrations/*.{js,ts}\"],\n rules: {\n \"filenames/match-regex\": \"off\",\n },\n },\n {\n files: [\n // Test files\n \"**/*.spec.{js,ts,tsx}\",\n \"**/*.test.{js,ts,tsx}\",\n\n // Facebook convention\n \"**/__mocks__/*.{js,ts,tsx}\",\n \"**/__tests__/*.{js,ts,tsx}\",\n\n // Microsoft convention\n \"**/test/*.{js,ts,tsx}\",\n ],\n rules: {\n \"no-magic-numbers\": \"off\",\n \"sonarjs/no-duplicate-string\": \"off\",\n },\n },\n // Fixes https://github.com/eslint/eslint/discussions/15305\n {\n files: packageIsTypeModule ? [\"**/*.js\", \"**/*.mjs\"] : [\"**/*.mjs\"],\n parser: \"@babel/eslint-parser\",\n parserOptions: {\n babelOptions: {\n plugins: [\"@babel/plugin-syntax-import-assertions\"],\n },\n requireConfigFile: false,\n },\n },\n {\n env: {\n commonjs: true,\n },\n files: [\"**/*.cjs\"],\n // inside *.cjs files. restore commonJS \"globals\"\n globals: {\n __dirname: true,\n __filename: true,\n exports: true,\n require: true,\n },\n },\n {\n env: {\n commonjs: false,\n },\n files: [\"**/*.mjs\"],\n globals: {\n __dirname: \"off\",\n __filename: \"off\",\n exports: \"off\",\n require: \"off\",\n },\n },\n ],\n // Disable the parser by default\n parser: \"\",\n // is loaded.\n rules: {\n ...configRules,\n },\n};\n\nexport default config;\n","import { hasDependency, hasDevDependency, hasFile, resolvePackage } from \"@anolilab/package-json-utils\";\n\nimport type { PackageRules } from \"./types\";\nimport anolilabEslintConfig from \"./utils/eslint-config\";\n\nconst baseConfig = [\"best-practices\", \"errors\", \"style\", \"es6\", \"variables\"];\n\n// eslint-disable-next-line import/exports-last\nexport const internalPluginConfig = [\n \"compat\",\n \"eslint-comments\",\n \"import\",\n \"promise\",\n \"simple-import-sort\",\n \"no-extend-native\",\n \"node\",\n // Security Rules\n \"no-secrets\",\n \"sonarjs\",\n \"security\",\n \"regexp\",\n // file rules\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"html\",\n \"no-loops\",\n\n // custom rules\n \"antfu\",\n \"unicorn\",\n \"es\",\n \"perfectionist\",\n];\n\nconst pluginConfig: PackageRules = [\n {\n configName: \"array-func\",\n dependencies: [\"eslint-plugin-array-func\"],\n },\n {\n configName: \"jsdoc\",\n dependencies: [\"eslint-plugin-jsdoc\"],\n },\n {\n configName: \"tsdoc\",\n dependencies: [\"eslint-plugin-tsdoc\", \"typescript\"],\n },\n {\n configName: \"you-dont-need-lodash-underscore\",\n dependencies: [\"eslint-plugin-you-dont-need-lodash-underscore\"],\n oneOfDependency: [\n \"lodash\",\n \"underscore\",\n \"lodash-es\",\n \"@types/lodash\",\n\n \"lodash.chunk\",\n \"lodash.compact\",\n \"lodash.concat\",\n \"lodash.difference\",\n \"lodash.differenceby\",\n \"lodash.differencewith\",\n \"lodash.drop\",\n \"lodash.dropright\",\n \"lodash.droprightwhile\",\n \"lodash.dropwhile\",\n \"lodash.fill\",\n \"lodash.findindex\",\n \"lodash.findlastindex\",\n \"lodash.flatten\",\n \"lodash.flattendeep\",\n \"lodash.flattendepth\",\n \"lodash.frompairs\",\n \"lodash.head\",\n \"lodash.indexof\",\n \"lodash.initial\",\n \"lodash.intersection\",\n \"lodash.intersectionby\",\n \"lodash.intersectionwith\",\n \"lodash.join\",\n \"lodash.last\",\n \"lodash.lastindexof\",\n \"lodash.nth\",\n \"lodash.pull\",\n \"lodash.pullall\",\n \"lodash.pullallby\",\n \"lodash.pullallwith\",\n \"lodash.pullat\",\n \"lodash.remove\",\n \"lodash.reverse\",\n \"lodash.slice\",\n \"lodash.sortedindex\",\n \"lodash.sortedindexby\",\n \"lodash.sortedindexof\",\n \"lodash.sortedlastindex\",\n \"lodash.sortedlastindexby\",\n \"lodash.sortedlastindexof\",\n \"lodash.sorteduniq\",\n \"lodash.sorteduniqby\",\n \"lodash.tail\",\n \"lodash.take\",\n \"lodash.takeright\",\n \"lodash.takerightwhile\",\n \"lodash.takewhile\",\n \"lodash.union\",\n \"lodash.unionby\",\n \"lodash.unionwith\",\n \"lodash.uniq\",\n \"lodash.uniqby\",\n \"lodash.uniqwith\",\n \"lodash.unzip\",\n \"lodash.unzipwith\",\n \"lodash.without\",\n \"lodash.xor\",\n \"lodash.xorby\",\n \"lodash.xorwith\",\n \"lodash.zip\",\n \"lodash.zipobject\",\n \"lodash.zipobjectdeep\",\n \"lodash.zipwith\",\n \"lodash.countby\",\n \"lodash.every\",\n \"lodash.filter\",\n \"lodash.find\",\n \"lodash.findlast\",\n \"lodash.flatmap\",\n \"lodash.flatmapdeep\",\n \"lodash.flatmapdepth\",\n \"lodash.foreach\",\n \"lodash.foreachright\",\n \"lodash.groupby\",\n \"lodash.includes\",\n \"lodash.invokemap\",\n \"lodash.keyby\",\n \"lodash.map\",\n \"lodash.orderby\",\n \"lodash.partition\",\n \"lodash.reduce\",\n \"lodash.reduceright\",\n \"lodash.reject\",\n \"lodash.sample\",\n \"lodash.samplesize\",\n \"lodash.shuffle\",\n \"lodash.size\",\n \"lodash.some\",\n \"lodash.sortby\",\n \"lodash.now\",\n \"lodash.after\",\n \"lodash.ary\",\n \"lodash.before\",\n \"lodash.bind\",\n \"lodash.bindkey\",\n \"lodash.curry\",\n \"lodash.curryright\",\n \"lodash.debounce\",\n \"lodash.defer\",\n \"lodash.delay\",\n \"lodash.flip\",\n \"lodash.memoize\",\n \"lodash.negate\",\n \"lodash.once\",\n \"lodash.overargs\",\n \"lodash.partial\",\n \"lodash.partialright\",\n \"lodash.rearg\",\n \"lodash.rest\",\n \"lodash.spread\",\n \"lodash.throttle\",\n \"lodash.unary\",\n \"lodash.wrap\",\n \"lodash.castarray\",\n \"lodash.clone\",\n \"lodash.clonedeep\",\n \"lodash.clonedeepwith\",\n \"lodash.clonewith\",\n \"lodash.conformsto\",\n \"lodash.eq\",\n \"lodash.gt\",\n \"lodash.gte\",\n \"lodash.isarguments\",\n \"lodash.isarray\",\n \"lodash.isarraybuffer\",\n \"lodash.isarraylike\",\n \"lodash.isarraylikeobject\",\n \"lodash.isboolean\",\n \"lodash.isbuffer\",\n \"lodash.isdate\",\n \"lodash.iselement\",\n \"lodash.isempty\",\n \"lodash.isequal\",\n \"lodash.isequalwith\",\n \"lodash.iserror\",\n \"lodash.isfinite\",\n \"lodash.isfunction\",\n \"lodash.isinteger\",\n \"lodash.islength\",\n \"lodash.ismap\",\n \"lodash.ismatch\",\n \"lodash.ismatchwith\",\n \"lodash.isnan\",\n \"lodash.isnative\",\n \"lodash.isnil\",\n \"lodash.isnull\",\n \"lodash.isnumber\",\n \"lodash.isobject\",\n \"lodash.isobjectlike\",\n \"lodash.isplainobject\",\n \"lodash.isregexp\",\n \"lodash.issafeinteger\",\n \"lodash.isset\",\n \"lodash.isstring\",\n \"lodash.issymbol\",\n \"lodash.istypedarray\",\n \"lodash.isundefined\",\n \"lodash.isweakmap\",\n \"lodash.isweakset\",\n \"lodash.lt\",\n \"lodash.lte\",\n \"lodash.toarray\",\n \"lodash.tofinite\",\n \"lodash.tointeger\",\n \"lodash.tolength\",\n \"lodash.tonumber\",\n \"lodash.toplainobject\",\n \"lodash.tosafeinteger\",\n \"lodash.tostring\",\n \"lodash.add\",\n \"lodash.ceil\",\n \"lodash.divide\",\n \"lodash.floor\",\n \"lodash.max\",\n \"lodash.maxby\",\n \"lodash.mean\",\n \"lodash.meanby\",\n \"lodash.min\",\n \"lodash.minby\",\n \"lodash.multiply\",\n \"lodash.round\",\n \"lodash.subtract\",\n \"lodash.sum\",\n \"lodash.sumby\",\n \"lodash.clamp\",\n \"lodash.inrange\",\n \"lodash.random\",\n \"lodash.assign\",\n \"lodash.assignin\",\n \"lodash.assigninwith\",\n \"lodash.assignwith\",\n \"lodash.at\",\n \"lodash.create\",\n \"lodash.defaults\",\n \"lodash.defaultsdeep\",\n \"lodash.findkey\",\n \"lodash.findlastkey\",\n \"lodash.forin\",\n \"lodash.forinright\",\n \"lodash.forown\",\n \"lodash.forownright\",\n \"lodash.functions\",\n \"lodash.functionsin\",\n \"lodash.get\",\n \"lodash.has\",\n \"lodash.hasin\",\n \"lodash.invert\",\n \"lodash.invertby\",\n \"lodash.invoke\",\n \"lodash.keys\",\n \"lodash.keysin\",\n \"lodash.mapkeys\",\n \"lodash.mapvalues\",\n \"lodash.merge\",\n \"lodash.mergewith\",\n \"lodash.omit\",\n \"lodash.omitby\",\n \"lodash.pick\",\n \"lodash.pickby\",\n \"lodash.result\",\n \"lodash.set\",\n \"lodash.setwith\",\n \"lodash.topairs\",\n \"lodash.topairsin\",\n \"lodash.transform\",\n \"lodash.unset\",\n \"lodash.update\",\n \"lodash.updatewith\",\n \"lodash.values\",\n \"lodash.valuesin\",\n \"lodash.chain\",\n \"lodash.tap\",\n \"lodash.thru\",\n \"lodash.camelcase\",\n \"lodash.capitalize\",\n \"lodash.deburr\",\n \"lodash.endswith\",\n \"lodash.escape\",\n \"lodash.escaperegexp\",\n \"lodash.kebabcase\",\n \"lodash.lowercase\",\n \"lodash.lowerfirst\",\n \"lodash.pad\",\n \"lodash.padend\",\n \"lodash.padstart\",\n \"lodash.parseint\",\n \"lodash.repeat\",\n \"lodash.replace\",\n \"lodash.snakecase\",\n \"lodash.split\",\n \"lodash.startcase\",\n \"lodash.startswith\",\n \"lodash.template\",\n \"lodash.tolower\",\n \"lodash.toupper\",\n \"lodash.trim\",\n \"lodash.trimend\",\n \"lodash.trimstart\",\n \"lodash.truncate\",\n \"lodash.unescape\",\n \"lodash.uppercase\",\n \"lodash.upperfirst\",\n \"lodash.words\",\n \"lodash.attempt\",\n \"lodash.bindall\",\n \"lodash.cond\",\n \"lodash.conforms\",\n \"lodash.constant\",\n \"lodash.defaultto\",\n \"lodash.flow\",\n \"lodash.flowright\",\n \"lodash.identity\",\n \"lodash.iteratee\",\n \"lodash.matches\",\n \"lodash.matchesproperty\",\n \"lodash.method\",\n \"lodash.methodof\",\n \"lodash.mixin\",\n \"lodash.noconflict\",\n \"lodash.noop\",\n \"lodash.ntharg\",\n \"lodash.over\",\n \"lodash.overevery\",\n \"lodash.oversome\",\n \"lodash.property\",\n \"lodash.propertyof\",\n \"lodash.range\",\n \"lodash.rangeright\",\n \"lodash.runincontext\",\n \"lodash.stubarray\",\n \"lodash.stubfalse\",\n \"lodash.stubobject\",\n \"lodash.stubstring\",\n \"lodash.stubtrue\",\n \"lodash.times\",\n \"lodash.topath\",\n \"lodash.uniqueid\",\n ],\n },\n {\n configName: \"mdx\",\n dependencies: [\"eslint-plugin-mdx\"],\n oneOfDependency: [\"nextra\", \"docz\", \"@docusaurus/core\", \"gatsby-plugin-mdx\"],\n resolve: [\"@mdx-js/mdx\", \"remark-mdx\", \"@mdx-js/loader\", \"@mdx-js/rollup\", \"@mdx-js/react\"],\n },\n {\n configName: \"no-unsanitized\",\n dependencies: [\"eslint-plugin-no-unsanitized\"],\n },\n {\n configName: \"react\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react\"],\n },\n {\n configName: \"validate-jsx-nesting\",\n dependencies: [\"eslint-plugin-validate-jsx-nesting\"],\n oneOfDependency: [\"react\", \"react-dom\", \"preact\", \"preact/compat\"],\n },\n {\n configName: \"ssr-friendly\",\n dependencies: [\"eslint-plugin-ssr-friendly\"],\n oneOfDependency: [\"react\", \"react-dom\", \"preact\", \"preact/compat\"],\n },\n {\n configName: \"react-redux\",\n dependencies: [\"eslint-plugin-react-redux\"],\n oneOfDependency: [\"@reduxjs/toolkit\", \"redux\"],\n },\n {\n configName: \"jsx-a11y\",\n dependencies: [\"eslint-plugin-jsx-a11y\"],\n oneOfDependency: [\"react\", \"react-dom\", \"preact\", \"preact/compat\"],\n },\n {\n configName: \"react-hooks\",\n dependencies: [\"eslint-plugin-react-hooks\"],\n oneOfDependency: [\"react\", \"react-dom\", \"preact\", \"preact/compat\"],\n },\n {\n configName: \"react-usememo\",\n dependencies: [\"@arthurgeron/eslint-plugin-react-usememo\"],\n oneOfDependency: [\"react\", \"react-dom\", \"preact\", \"preact/compat\"],\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 oneOfDependency: [\"tailwindcss\", \"@tailwindcss/typography\", \"@tailwindcss/forms\", \"@tailwindcss/aspect-ratio\", \"@tailwindcss/line-clamp\"],\n },\n {\n configName: \"cypress\",\n dependencies: [\"cypress\", \"eslint-plugin-cypress\"],\n },\n {\n configName: \"jest\",\n dependencies: [\"jest\", \"eslint-plugin-jest\"],\n },\n {\n configName: \"jest-dom\",\n dependencies: [\"jest\", \"@testing-library/jest-dom\", \"eslint-plugin-jest-dom\"],\n },\n {\n configName: \"jest-async\",\n dependencies: [\"jest\", \"eslint-plugin-jest-async\"],\n },\n {\n configName: \"jest-formatting\",\n dependencies: [\"jest\", \"eslint-plugin-jest-formatting\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"tailwindcss\"],\n },\n {\n configName: \"testing-library-dom\",\n dependencies: [\"@testing-library/dom\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"testing-library-react\",\n dependencies: [\"react\", \"@testing-library/react\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"typescript\",\n dependencies: [\"typescript\"],\n files: [\"tsconfig.json\", \"tsconfig.eslint.json\"],\n },\n {\n configName: \"deprecation\",\n dependencies: [\"typescript\"],\n files: [\"tsconfig.json\", \"tsconfig.eslint.json\"],\n },\n {\n configName: \"no-only-tests\",\n dependencies: [],\n oneOfDependency: [\"jest\", \"mocha\", \"jasmine\", \"tape\", \"ava\", \"qunit\", \"cypress\"],\n },\n {\n configName: \"etc\",\n dependencies: [\"typescript\", \"eslint-plugin-etc\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\", \"eslint-plugin-vitest-globals\"],\n },\n {\n configName: \"zod\",\n dependencies: [\"zod\", \"eslint-plugin-zod\"],\n },\n {\n configName: \"ava\",\n dependencies: [\"ava\", \"eslint-plugin-ava\"],\n },\n {\n configName: \"editorconfig\",\n dependencies: [\"eslint-plugin-editorconfig\"],\n files: [\".editorconfig\"],\n },\n {\n configName: \"storybook\",\n dependencies: [\"storybook\", \"eslint-plugin-storybook\"],\n },\n {\n configName: \"playwright\",\n dependencies: [\"playwright\", \"eslint-plugin-playwright\"],\n },\n {\n configName: \"tanstack-query\",\n dependencies: [\"@tanstack/react-query\", \"@tanstack/eslint-plugin-query\"],\n },\n];\n\nconst loadedPlugins: string[] = [...internalPluginConfig];\nconst possiblePlugins: Record<string, Record<string, boolean>> = {};\n\nif (loadedPlugins.length === internalPluginConfig.length) {\n // eslint-disable-next-line sonarjs/cognitive-complexity\n pluginConfig.forEach((plugin) => {\n const { configName, dependencies } = plugin;\n\n // eslint-disable-next-line security/detect-object-injection\n if ((anolilabEslintConfig as unknown as Record<string, Record<string, false | undefined>>)[\"plugin\"]?.[configName] !== false) {\n const foundDependencies = [];\n\n dependencies.forEach((dependency) => {\n if (hasDependency(dependency) || hasDevDependency(dependency)) {\n foundDependencies.push(dependency);\n }\n });\n\n // eslint-disable-next-line security/detect-object-injection\n possiblePlugins[configName] = {};\n\n if (foundDependencies.length === 0) {\n if (plugin.oneOfDependency !== undefined) {\n let foundOneOfDependency = false;\n\n plugin.oneOfDependency.forEach((dependency) => {\n if (!foundOneOfDependency && (hasDependency(dependency) || hasDevDependency(dependency))) {\n foundOneOfDependency = true;\n\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[dependency] = true;\n }\n });\n }\n\n if (plugin.resolve !== undefined) {\n plugin.resolve.forEach((rdependency) => {\n if (resolvePackage(rdependency) !== undefined) {\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[rdependency] = true;\n }\n });\n }\n\n if (plugin.files !== undefined) {\n plugin.files.forEach((file) => {\n if (hasFile(file)) {\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[file] = true;\n }\n });\n }\n }\n\n if (foundDependencies.length === dependencies.length) {\n // eslint-disable-next-line security/detect-object-injection,@typescript-eslint/no-dynamic-delete\n delete possiblePlugins[configName];\n\n loadedPlugins.push(configName);\n } else {\n dependencies.forEach((dependency) => {\n // eslint-disable-next-line security/detect-object-injection\n (possiblePlugins[configName] as Record<string, boolean>)[dependency] = hasDependency(dependency) || hasDevDependency(dependency);\n });\n }\n }\n });\n}\n\nexport const rules = baseConfig;\nexport const pluginRules = loadedPlugins;\n\nexport const possiblePluginRules = possiblePlugins;\n","/**\nDefine the rules config that are overwritten only for specific version of Node.js based on `engines.node` in package.json or the `nodeVersion` option.\n\nThe keys are rule names and the values are an Object with a valid semver (`4.0.0` is valid `4` is not) as keys and the rule configuration as values.\n\nEach entry define the rule config and the maximum Node.js version for which to set it.\nThe entry with the lowest version that is compliant with the `engines.node`/`nodeVersion` range will be used.\n\n@type {Object}\n\n@example\n```\n{\n 'plugin/rule': {\n '6.0.0': ['error', {prop: 'node-6-conf'}],\n '8.0.0': ['error', {prop: 'node-8-conf'}]\n }\n}\n```\n\nWith `engines.node` set to `>=4` the rule `plugin/rule` will not be used.\nWith `engines.node` set to `>=6` the rule `plugin/rule` will be used with the config `{prop: 'node-6-conf'}`.\nWith `engines.node` set to `>=8` the rule `plugin/rule` will be used with the config `{prop: 'node-8-conf'}`.\n*/\nconst engineRules = {\n \"n/prefer-global/text-decoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/text-encoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/url\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/url-search-params\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-promises/dns\": {\n \"11.14.0\": \"off\",\n },\n \"n/prefer-promises/fs\": {\n \"11.14.0\": \"off\",\n },\n \"no-useless-catch\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-destructuring\": {\n \"6.0.0\": \"off\",\n },\n \"prefer-named-capture-group\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-object-spread\": {\n \"8.3.0\": \"off\",\n },\n \"prefer-rest-params\": {\n \"6.0.0\": \"off\",\n },\n \"promise/prefer-await-to-then\": {\n \"7.6.0\": \"off\",\n },\n \"unicorn/no-new-buffer\": {\n \"5.10.0\": \"off\",\n },\n \"unicorn/prefer-flat-map\": {\n \"11.0.0\": \"off\",\n },\n \"unicorn/prefer-spread\": {\n \"5.0.0\": \"off\",\n },\n};\n\nexport default engineRules;\n"]}
@@ -43,25 +43,25 @@ module.exports = defineConfig({
43
43
  overrides: [
44
44
  {
45
45
  files: [
46
- "*.ts",
47
- "*.tsx",
48
- "*.mts",
49
- "*.cts",
50
- "*.js",
51
- "*.jsx",
46
+ "**/*.ts",
47
+ "**/*.tsx",
48
+ "**/*.mts",
49
+ "**/*.cts",
50
+ "**/*.js",
51
+ "**/*.jsx",
52
52
  ],
53
53
  // Set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting
54
54
  parserOptions: {},
55
55
  rules: {},
56
56
  },
57
57
  {
58
- files: ["*.ts", "*.tsx", "*.mts", "*.cts"],
58
+ files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
59
59
  // Set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting
60
60
  parserOptions: {},
61
61
  rules: {},
62
62
  },
63
63
  {
64
- files: ["*.js", "*.jsx"],
64
+ files: ["**/*.js", "**/*.jsx"],
65
65
  rules: {},
66
66
  },
67
67
  ],
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/postinstall/write-eslint-ignore.ts","../src/postinstall/write-eslint-rc.ts","../src/postinstall.ts"],"names":["existsSync","writeFile","join","promisify","projectPath","writeFileAsync","writeEslintIgnore","write_eslint_ignore_default","init_write_eslint_ignore","__esmMin","eslintIgnorePath","readFileSync","packageIsTypeModule","configFile","writeEslintRc","write_eslint_rc_default","init_write_eslint_rc","filename","eslintPath","pluginExtends","parserOptions","tsconfigPath","ecmaVersion","tsConfig","content","env","exit","require_postinstall","__commonJSMin","error"],"mappings":"+CAAA,OAAS,cAAAA,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAE1B,OAAS,eAAAC,MAAmB,+BAJ5B,IAMMC,EAEAC,EAaCC,EArBPC,EAAAC,EAAA,kBAMMJ,EAAiBF,EAAUF,CAAS,EAEpCK,EAAoB,SAA2B,CACjD,IAAMI,EAAmBR,EAAKE,EAAa,eAAe,EAG1D,GAAIJ,EAAWU,CAAgB,EAAG,CAC9B,QAAQ,KAAK,4CAAkC,EAE/C,MACJ,CAEA,MAAML,EAAeK,EAAkB,GAAI,MAAM,CACrD,EAEOH,EAAQD,ICrBf,OAAS,cAAAN,EAAY,gBAAAW,EAAc,aAAAV,MAAiB,KACpD,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAE1B,OAAS,uBAAAS,EAAqB,eAAAR,MAAmB,+BAJjD,IAOMC,EAIAQ,EAGAC,EAuGCC,EArHPC,EAAAP,EAAA,kBAOMJ,EAAiBF,EAAUF,CAAS,EAE1C,QAAQ,IAAI,sCAAuCG,EAAa;AAAA,CAAI,EAE9DS,EAAa,YAGbC,EAAgB,SAA2B,CAE7C,QAAWG,IAAY,CAACJ,EAAY,GAAGA,CAAU,MAAO,GAAGA,CAAU,OAAQ,GAAGA,CAAU,QAAS,GAAGA,CAAU,QAAS,GAAGA,CAAU,MAAM,EAExI,GAAIb,EAAWE,EAAKE,EAAaa,CA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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmCI,MAAMjB,EAAea,EAAYM,EAAS,MAAM,CACpD,EAEOT,EAAQD,ICrHf,OAAS,OAAAW,EAAK,QAAAC,MAAY,UAE1B,OAAS,eAAAtB,MAAmB,+BAF5B,IAAAuB,EAAAC,EAAA,KAIApB,IACAQ,IAEIS,EAAI,IACJC,EAAK,CAAC,EAGV,QAAQ,IAAI,sCAAuCtB,EAAa;AAAA,CAAI,GAGnE,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACW,EAAc,EAAGR,EAAkB,CAAC,CAAC,EAExD,QAAQ,IAAI,4CAAqC,EAEjDmB,EAAK,CAAC,CACV,OAASG,EAAO,CACZ,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAEnBH,EAAK,CAAC,CACV,CACJ,GAAG","sourcesContent":["import { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport { projectPath } from \"@anolilab/package-json-utils\";\n\nconst writeFileAsync = promisify(writeFile);\n\nconst writeEslintIgnore = async (): Promise<void> => {\n const eslintIgnorePath = join(projectPath, \".eslintignore\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(eslintIgnorePath)) {\n console.warn(\"⚠️ .eslintignore already exists\");\n\n return;\n }\n\n await writeFileAsync(eslintIgnorePath, \"\", \"utf8\");\n};\n\nexport default writeEslintIgnore;\n","import { existsSync, readFileSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\nimport type { TsConfigJson } from \"type-fest\";\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/eslint-config\", projectPath, \"\\n\");\n\nconst configFile = \".eslintrc\";\n\n// eslint-disable-next-line sonarjs/cognitive-complexity\nconst writeEslintRc = async (): Promise<void> => {\n // eslint-disable-next-line no-restricted-syntax,no-loops/no-loops\n for (const filename of [configFile, `${configFile}.js`, `${configFile}.cjs`, `${configFile}.json`, `${configFile}.yaml`, `${configFile}.yml`]) {\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(join(projectPath, filename))) {\n console.warn(`⚠️ ${filename} already exists;\nMake sure that it includes the following for @anolilab/eslint-config'\nto work as it should: { extends: [\"@anolilab/eslint-config\"] }.`);\n\n return;\n }\n }\n\n const eslintPath = join(projectPath, `.eslintrc.${packageIsTypeModule ? \"c\" : \"\"}js`);\n\n let pluginExtends = \"\";\n let parserOptions = `\n parserOptions: {\n ecmaVersion: \"latest\",\n sourceType: ${packageIsTypeModule ? '\"module\"' : '\"commonjs\"'},\n },`;\n\n const tsconfigPath = join(projectPath, \"tsconfig.json\");\n\n let ecmaVersion = \"latest\";\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(tsconfigPath)) {\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n const tsConfig = JSON.parse(readFileSync(tsconfigPath, \"utf8\")) as TsConfigJson;\n\n if (tsConfig.compilerOptions?.target) {\n ecmaVersion = tsConfig.compilerOptions.target;\n\n ecmaVersion =\n ecmaVersion.toLowerCase() === \"es2022\" || ecmaVersion.toLowerCase() === \"esnext\" ? \"latest\" : ecmaVersion.toLowerCase().replace(\"es\", \"\");\n\n if (ecmaVersion !== \"latest\" && ecmaVersion !== \"2022\" && ecmaVersion !== \"2021\" && ecmaVersion !== \"6\") {\n pluginExtends = `, \"plugin:es-x/restrict-to-es${ecmaVersion}\"`;\n }\n }\n\n parserOptions = `\n parserOptions: {\n project: true,\n ecmaVersion: ${ecmaVersion === \"latest\" ? `\"${ecmaVersion}\"` : ecmaVersion},\n sourceType: ${packageIsTypeModule ? '\"module\"' : '\"commonjs\"'},\n },`;\n }\n\n const content = `/** @ts-check */\nconst { defineConfig } = require('@anolilab/eslint-config/define-config');\n${[\"es2015\", \"es2017\", \"es2020\", \"es2021\", \"latest\"].includes(ecmaVersion) ? 'const { globals } = require(\"@anolilab/eslint-config/globals\");\\n\\n' : \"\"}\nmodule.exports = defineConfig({\n root: true,\n extends: [\"@anolilab/eslint-config\"${pluginExtends}],\n ignorePatterns: [\"!**/*\"],\n env: {\n // Your environments (which contains several predefined global variables)\n // Most environments are loaded automatically if our rules are added\n },${parserOptions}\n globals: {${\n [\"es2015\", \"es2017\", \"es2020\", \"es2021\", \"latest\"].includes(ecmaVersion)\n ? `\\n ...globals.${ecmaVersion === \"latest\" ? \"es2021\" : ecmaVersion},`\n : \"\"\n}\n // Your global variables (setting to false means it's not allowed to be reassigned)\n // myGlobal: false\n },\n rules: {\n // Customize your rules\n },\n overrides: [\n {\n files: [\n \"*.ts\",\n \"*.tsx\",\n \"*.mts\",\n \"*.cts\",\n \"*.js\",\n \"*.jsx\",\n ],\n // Set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting\n parserOptions: {},\n rules: {},\n },\n {\n files: [\"*.ts\", \"*.tsx\", \"*.mts\", \"*.cts\"],\n // Set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting\n parserOptions: {},\n rules: {},\n },\n {\n files: [\"*.js\", \"*.jsx\"],\n rules: {},\n },\n ],\n});\n`;\n\n await writeFileAsync(eslintPath, content, \"utf8\");\n};\n\nexport default writeEslintRc;\n","import { env, exit } from \"node:process\";\n\nimport { projectPath } from \"@anolilab/package-json-utils\";\n\nimport writeEslintIgnore from \"./postinstall/write-eslint-ignore\";\nimport writeEslintRc from \"./postinstall/write-eslint-rc\";\n\nif (env[\"CI\"]) {\n exit(0);\n}\n\nconsole.log(\"Configuring @anolilab/eslint-config\", projectPath, \"\\n\");\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n // eslint-disable-next-line compat/compat\n await Promise.all([writeEslintRc(), writeEslintIgnore()]);\n\n console.log(\"😎 Everything went well, have fun!\");\n\n exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n exit(1);\n }\n})();\n"]}
1
+ {"version":3,"sources":["../src/postinstall/write-eslint-ignore.ts","../src/postinstall/write-eslint-rc.ts","../src/postinstall.ts"],"names":["existsSync","writeFile","join","promisify","projectPath","writeFileAsync","writeEslintIgnore","write_eslint_ignore_default","init_write_eslint_ignore","__esmMin","eslintIgnorePath","readFileSync","packageIsTypeModule","configFile","writeEslintRc","write_eslint_rc_default","init_write_eslint_rc","filename","eslintPath","pluginExtends","parserOptions","tsconfigPath","ecmaVersion","tsConfig","content","env","exit","require_postinstall","__commonJSMin","error"],"mappings":"+CAAA,OAAS,cAAAA,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAE1B,OAAS,eAAAC,MAAmB,+BAJ5B,IAMMC,EAEAC,EAaCC,EArBPC,EAAAC,EAAA,kBAMMJ,EAAiBF,EAAUF,CAAS,EAEpCK,EAAoB,SAA2B,CACjD,IAAMI,EAAmBR,EAAKE,EAAa,eAAe,EAG1D,GAAIJ,EAAWU,CAAgB,EAAG,CAC9B,QAAQ,KAAK,4CAAkC,EAE/C,MACJ,CAEA,MAAML,EAAeK,EAAkB,GAAI,MAAM,CACrD,EAEOH,EAAQD,ICrBf,OAAS,cAAAN,EAAY,gBAAAW,EAAc,aAAAV,MAAiB,KACpD,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAE1B,OAAS,uBAAAS,EAAqB,eAAAR,MAAmB,+BAJjD,IAOMC,EAIAQ,EAGAC,EAuGCC,EArHPC,EAAAP,EAAA,kBAOMJ,EAAiBF,EAAUF,CAAS,EAE1C,QAAQ,IAAI,sCAAuCG,EAAa;AAAA,CAAI,EAE9DS,EAAa,YAGbC,EAAgB,SAA2B,CAE7C,QAAWG,IAAY,CAACJ,EAAY,GAAGA,CAAU,MAAO,GAAGA,CAAU,OAAQ,GAAGA,CAAU,QAAS,GAAGA,CAAU,QAAS,GAAGA,CAAU,M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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmCI,MAAMjB,EAAea,EAAYM,EAAS,MAAM,CACpD,EAEOT,EAAQD,ICrHf,OAAS,OAAAW,EAAK,QAAAC,MAAY,UAE1B,OAAS,eAAAtB,MAAmB,+BAF5B,IAAAuB,EAAAC,EAAA,KAIApB,IACAQ,IAEIS,EAAI,IACJC,EAAK,CAAC,EAGV,QAAQ,IAAI,sCAAuCtB,EAAa;AAAA,CAAI,GAGnE,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACW,EAAc,EAAGR,EAAkB,CAAC,CAAC,EAExD,QAAQ,IAAI,4CAAqC,EAEjDmB,EAAK,CAAC,CACV,OAASG,EAAO,CACZ,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAEnBH,EAAK,CAAC,CACV,CACJ,GAAG","sourcesContent":["import { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport { projectPath } from \"@anolilab/package-json-utils\";\n\nconst writeFileAsync = promisify(writeFile);\n\nconst writeEslintIgnore = async (): Promise<void> => {\n const eslintIgnorePath = join(projectPath, \".eslintignore\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(eslintIgnorePath)) {\n console.warn(\"⚠️ .eslintignore already exists\");\n\n return;\n }\n\n await writeFileAsync(eslintIgnorePath, \"\", \"utf8\");\n};\n\nexport default writeEslintIgnore;\n","import { existsSync, readFileSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\nimport type { TsConfigJson } from \"type-fest\";\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/eslint-config\", projectPath, \"\\n\");\n\nconst configFile = \".eslintrc\";\n\n// eslint-disable-next-line sonarjs/cognitive-complexity\nconst writeEslintRc = async (): Promise<void> => {\n // eslint-disable-next-line no-restricted-syntax,no-loops/no-loops\n for (const filename of [configFile, `${configFile}.js`, `${configFile}.cjs`, `${configFile}.json`, `${configFile}.yaml`, `${configFile}.yml`]) {\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(join(projectPath, filename))) {\n console.warn(`⚠️ ${filename} already exists;\nMake sure that it includes the following for @anolilab/eslint-config'\nto work as it should: { extends: [\"@anolilab/eslint-config\"] }.`);\n\n return;\n }\n }\n\n const eslintPath = join(projectPath, `.eslintrc.${packageIsTypeModule ? \"c\" : \"\"}js`);\n\n let pluginExtends = \"\";\n let parserOptions = `\n parserOptions: {\n ecmaVersion: \"latest\",\n sourceType: ${packageIsTypeModule ? '\"module\"' : '\"commonjs\"'},\n },`;\n\n const tsconfigPath = join(projectPath, \"tsconfig.json\");\n\n let ecmaVersion = \"latest\";\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(tsconfigPath)) {\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n const tsConfig = JSON.parse(readFileSync(tsconfigPath, \"utf8\")) as TsConfigJson;\n\n if (tsConfig.compilerOptions?.target) {\n ecmaVersion = tsConfig.compilerOptions.target;\n\n ecmaVersion =\n ecmaVersion.toLowerCase() === \"es2022\" || ecmaVersion.toLowerCase() === \"esnext\" ? \"latest\" : ecmaVersion.toLowerCase().replace(\"es\", \"\");\n\n if (ecmaVersion !== \"latest\" && ecmaVersion !== \"2022\" && ecmaVersion !== \"2021\" && ecmaVersion !== \"6\") {\n pluginExtends = `, \"plugin:es-x/restrict-to-es${ecmaVersion}\"`;\n }\n }\n\n parserOptions = `\n parserOptions: {\n project: true,\n ecmaVersion: ${ecmaVersion === \"latest\" ? `\"${ecmaVersion}\"` : ecmaVersion},\n sourceType: ${packageIsTypeModule ? '\"module\"' : '\"commonjs\"'},\n },`;\n }\n\n const content = `/** @ts-check */\nconst { defineConfig } = require('@anolilab/eslint-config/define-config');\n${[\"es2015\", \"es2017\", \"es2020\", \"es2021\", \"latest\"].includes(ecmaVersion) ? 'const { globals } = require(\"@anolilab/eslint-config/globals\");\\n\\n' : \"\"}\nmodule.exports = defineConfig({\n root: true,\n extends: [\"@anolilab/eslint-config\"${pluginExtends}],\n ignorePatterns: [\"!**/*\"],\n env: {\n // Your environments (which contains several predefined global variables)\n // Most environments are loaded automatically if our rules are added\n },${parserOptions}\n globals: {${\n [\"es2015\", \"es2017\", \"es2020\", \"es2021\", \"latest\"].includes(ecmaVersion)\n ? `\\n ...globals.${ecmaVersion === \"latest\" ? \"es2021\" : ecmaVersion},`\n : \"\"\n}\n // Your global variables (setting to false means it's not allowed to be reassigned)\n // myGlobal: false\n },\n rules: {\n // Customize your rules\n },\n overrides: [\n {\n files: [\n \"**/*.ts\",\n \"**/*.tsx\",\n \"**/*.mts\",\n \"**/*.cts\",\n \"**/*.js\",\n \"**/*.jsx\",\n ],\n // Set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting\n parserOptions: {},\n rules: {},\n },\n {\n files: [\"**/*.ts\", \"**/*.tsx\", \"**/*.mts\", \"**/*.cts\"],\n // Set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting\n parserOptions: {},\n rules: {},\n },\n {\n files: [\"**/*.js\", \"**/*.jsx\"],\n rules: {},\n },\n ],\n});\n`;\n\n await writeFileAsync(eslintPath, content, \"utf8\");\n};\n\nexport default writeEslintRc;\n","import { env, exit } from \"node:process\";\n\nimport { projectPath } from \"@anolilab/package-json-utils\";\n\nimport writeEslintIgnore from \"./postinstall/write-eslint-ignore\";\nimport writeEslintRc from \"./postinstall/write-eslint-rc\";\n\nif (env[\"CI\"]) {\n exit(0);\n}\n\nconsole.log(\"Configuring @anolilab/eslint-config\", projectPath, \"\\n\");\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n // eslint-disable-next-line compat/compat\n await Promise.all([writeEslintRc(), writeEslintIgnore()]);\n\n console.log(\"😎 Everything went well, have fun!\");\n\n exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n exit(1);\n }\n})();\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/eslint-config",
3
- "version": "14.0.8",
3
+ "version": "14.0.10",
4
4
  "description": "ESLint shareable config for the Anolilab JavaScript style guide.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -131,6 +131,7 @@
131
131
  "@anolilab/package-json-utils": "3.0.6",
132
132
  "@babel/eslint-parser": "^7.22.15",
133
133
  "@babel/plugin-syntax-import-assertions": "^7.22.5",
134
+ "@jsenv/eslint-import-resolver": "^8.0.2",
134
135
  "@eslint/js": "^8.50.0",
135
136
  "@html-eslint/eslint-plugin": "^0.19.1",
136
137
  "@html-eslint/parser": "^0.19.1",