@anolilab/eslint-config 6.0.1 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +7 -6
- package/dist/chunk-6ZQSXLLR.mjs +7 -0
- package/dist/chunk-6ZQSXLLR.mjs.map +1 -0
- package/dist/chunk-ROX6JHFJ.js +9 -0
- package/dist/chunk-ROX6JHFJ.js.map +1 -0
- package/dist/config/plugins/babel.js +6 -3
- package/dist/config/plugins/babel.js.map +1 -1
- package/dist/config/plugins/babel.mjs +9 -6
- package/dist/config/plugins/babel.mjs.map +1 -1
- package/dist/config/plugins/jsdoc.js +2 -2
- package/dist/config/plugins/jsdoc.js.map +1 -1
- package/dist/config/plugins/jsdoc.mjs +2 -2
- package/dist/config/plugins/jsdoc.mjs.map +1 -1
- package/dist/config/plugins/jsonc.js +1 -1
- package/dist/config/plugins/jsonc.js.map +1 -1
- package/dist/config/plugins/jsonc.mjs +1 -1
- package/dist/config/plugins/jsonc.mjs.map +1 -1
- package/dist/config/plugins/node.js.map +1 -1
- package/dist/config/plugins/node.mjs.map +1 -1
- package/dist/config/plugins/react.js +4 -3
- package/dist/config/plugins/react.js.map +1 -1
- package/dist/config/plugins/react.mjs +4 -3
- package/dist/config/plugins/react.mjs.map +1 -1
- package/dist/config/plugins/typescript.js +5 -5
- package/dist/config/plugins/typescript.js.map +1 -1
- package/dist/config/plugins/typescript.mjs +5 -5
- package/dist/config/plugins/typescript.mjs.map +1 -1
- package/dist/config/plugins/unicorn.js +7 -5
- package/dist/config/plugins/unicorn.js.map +1 -1
- package/dist/config/plugins/unicorn.mjs +6 -4
- package/dist/config/plugins/unicorn.mjs.map +1 -1
- package/dist/config/style.js +2 -2
- package/dist/config/style.mjs +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -8
- package/dist/index.mjs.map +1 -1
- package/dist/postinstall.js.map +1 -1
- package/dist/postinstall.mjs.map +1 -1
- package/package.json +7 -5
- package/dist/chunk-F6JHPR4L.mjs +0 -7
- package/dist/chunk-F6JHPR4L.mjs.map +0 -1
- package/dist/chunk-NO36P4BR.js +0 -9
- package/dist/chunk-NO36P4BR.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { b
|
|
1
|
+
import { b, a as a$1 } from './chunk-G7JIJH44.mjs';
|
|
2
2
|
import '@rushstack/eslint-patch/modern-module-resolution';
|
|
3
3
|
import { pkg, hasAnyDep, hasDependency, hasDevDependency, packageIsTypeModule } from '@anolilab/package-json-utils';
|
|
4
4
|
import { join } from 'path';
|
|
5
|
-
import
|
|
5
|
+
import j from 'semver';
|
|
6
6
|
|
|
7
|
-
var v=["best-practices","errors","style","es6","variables"],
|
|
7
|
+
var v=["best-practices","errors","style","es6","variables"],_=["compat","eslint-comments","import","optimize-regex","promise","simple-import-sort","no-extend-native","node","no-secrets","sonarjs","security","jsonc","markdown","toml","yml","html","antfu","unicorn","es"],E=[{configName:"array-func",dependencies:["eslint-plugin-array-func"]},{configName:"jsdoc",dependencies:["eslint-plugin-jsdoc"]},{configName:"tsdoc",dependencies:["eslint-plugin-tsdoc","typescript"]},{configName:"lodash",dependencies:["lodash","eslint-plugin-lodash"]},{configName:"lodash-fp",dependencies:["lodash","eslint-plugin-lodash-fp"]},{configName:"you-dont-need-lodash-underscore",dependencies:["lodash","eslint-plugin-you-dont-need-lodash-underscore"]},{configName:"mdx",dependencies:["eslint-plugin-mdx"]},{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","moment-timezone","eslint-plugin-you-dont-need-momentjs"]},{configName:"tailwindcss",dependencies:["eslint-plugin-tailwindcss"]},{configName:"cypress",dependencies:["eslint-plugin-cypress"]},{configName:"jest",dependencies:["jest","eslint-plugin-jest"]},{configName:"jest-dom",dependencies:["jest","@testing-library/jest-dom","eslint-plugin-jest-dom"]},{configName:"jest-async",dependencies:["jest","eslint-plugin-jest-async"]},{configName:"jest-formatting",dependencies:["jest","eslint-plugin-jest-formatting"]},{configName:"tailwindcss",dependencies:["tailwindcss"]},{configName:"testing-library",dependencies:["@testing-library/dom","eslint-plugin-testing-library"]},{configName:"typescript",dependencies:["typescript"]},{configName:"typescript-sort-keys",dependencies:["typescript","eslint-plugin-typescript-sort-keys"]},{configName:"vitest",dependencies:["vitest","eslint-plugin-vitest"]},{configName:"zod",dependencies:["zod","eslint-plugin-zod"]},{configName:"ava",dependencies:["ava","eslint-plugin-ava"]}],d=[..._],a={},g={};pkg&&(g=pkg?.anolilab?.["eslint-config"]);E.forEach(e=>{let{dependencies:o,configName:s}=e;g?.plugin?.[s]!==!1&&(hasAnyDep(o,{peerDeps:!1,strict:!0})?d.push(s):(a[s]={},o.forEach(i=>{a[s][i]=hasDependency(i)??hasDevDependency(i);})));});var m=v,r=d,f=a;var L={"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"}},u=L;global.hasAnolilabEsLintConfigLoaded||(process.env.DEBUG&&(b(`
|
|
8
8
|
@anolilab/eslint-config loaded the following plugins:
|
|
9
|
-
`),b
|
|
10
|
-
Your package.json container dependencies for the "${e}" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`),Object.entries(
|
|
11
|
-
To disable this message, add the following to your package.json:`),b
|
|
12
|
-
`)),b
|
|
9
|
+
`),b(" @rushstack/eslint-plugin-security"),["compat","eslint-comments","i","optimize-regex","promise","simple-import-sort","unicorn","no-secrets","sonarjs","json","jsonc","markdown","toml","yml","es",...r].forEach(e=>a$1(e))),Object.entries(f).forEach(([e,o])=>{Object.values(o).some(Boolean)&&(b(`
|
|
10
|
+
Your package.json container dependencies for the "${e}" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`),Object.entries(o).forEach(([i,k])=>{k||b(` ${i}`);}));}),Object.keys(f).length>0&&(b(`
|
|
11
|
+
To disable this message, add the following to your package.json:`),b(` "anolilab": { "eslint-config": { plugin: { "plugin-name": false } } }
|
|
12
|
+
`)),b('To disable all logging, add the following to your eslint command call "NO_LOGS=true eslint ..."'),global.hasAnolilabEsLintConfigLoaded=!0);var t={},l;pkg?.engines?.node&&(l=pkg.engines.node);Object.entries(u).forEach(([e,o])=>{Object.keys(o).sort(j.rcompare).forEach(s=>{l&&j.intersects(l,`<${s}`)&&(t[e]=o[s]);});});hasAnyDep(["prettier"],{peerDeps:!1})&&(global.hasAnolilabEsLintConfigPrettier||(global.hasAnolilabEsLintConfigPrettier=!0,b(`
|
|
13
|
+
Found prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier`)),t={...t,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 P={root:!0,parser:"",extends:[...m.map(e=>join(__dirname,`./config/${e}.${packageIsTypeModule?"m":""}js`)),...r.map(e=>join(__dirname,`./config/plugins/${e}.${packageIsTypeModule?"m":""}js`))],rules:{...t},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"]},F=P;
|
|
13
14
|
|
|
14
|
-
export {
|
|
15
|
+
export { F as default };
|
|
15
16
|
//# sourceMappingURL=out.js.map
|
|
16
17
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/config.ts","../src/engine-node-overwrite.ts"],"names":["packageIsTypeModule","pkg","join","semver","hasAnyDep","hasDependency","hasDevDependency","baseConfig","internalPluginConfig","pluginConfig","loadedPlugins","possiblePlugins","anolilabEslintConfig","plugin","dependencies","configName","dependency","rules","pluginRules","possiblePluginRules","engineRules","engine_node_overwrite_default","consoleLog","consolePlugin","installed","configRules","nodeVersion","rule","ruleConfig","minVersion","config","src_default"],"mappings":"gDAMA,MAAO,mDAEP,OAAS,uBAAAA,EAAqB,OAAAC,MAAW,+BAEzC,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAY,SCXnB,OACC,aAAAC,EAAW,iBAAAC,EAAe,oBAAAC,EAAkB,OAAAL,MACtC,+BAIP,IAAMM,EAAa,CAAC,iBAAkB,SAAU,QAAS,MAAO,WAAW,EAErEC,EAAuB,CACzB,SACA,kBACA,SACA,iBACA,UACA,qBACA,mBACA,OAEA,aACA,UACA,WAEA,QACA,WACA,OACA,MACA,OAGA,QACA,UACA,IACJ,EAEMC,EAA6B,CAC/B,CACI,WAAY,aACZ,aAAc,CAAC,0BAA0B,CAC7C,EACA,CACI,WAAY,QACZ,aAAc,CAAC,qBAAqB,CACxC,EACA,CACI,WAAY,QACZ,aAAc,CAAC,sBAAuB,YAAY,CACtD,EACA,CACI,WAAY,SACZ,aAAc,CAAC,SAAU,sBAAsB,CACnD,EACA,CACI,WAAY,YACZ,aAAc,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,C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AS,IAC1CG,EAAW;AAAA,iEAAoE,EAC/EA,EAAW;AAAA,CAA6E,GAG5FA,EAAW,iGAAiG,EAE5G,OAAO,8BAAgC,IAG3C,IAAMG,EAAkC,CAAC,EAErCC,EAEAzB,GAAK,SAAU,OACfyB,EAAczB,EAAI,QAAQ,MAG9B,OAAO,QAAQoB,CAAW,EAAE,QAAQ,CAAC,CAACM,EAAMC,CAAU,IAAM,CACxD,OAAO,KAAKA,CAAU,EACjB,KAAKzB,EAAO,QAAQ,EACpB,QAAS0B,GAAe,CACjBH,GAAevB,EAAO,WAAWuB,EAAa,IAAIG,GAAY,IAC9DJ,EAAYE,CAAI,EAAIC,EAAWC,CAAqC,EAE5E,CAAC,CACT,CAAC,EAED,IAAMC,EAAwB,CAQ1B,KAAM,GAEN,OAAQ,GAER,QAAS,CACL,GAAGb,EAEE,IAAKJ,GAAWX,EAAK,UAAW,YAAYW,KAAUb,EAAsB,IAAM,MAAM,CAAC,EAE9F,GAAGkB,EAAY,IAAKL,GAAWX,EAAK,UAAW,oBAAoBW,KAAUb,EAAsB,IAAM,MAAM,CAAC,CACpH,EACA,MAAO,CACH,GAAGyB,CACP,EACA,UAAW,CACP,CACI,MAAO,CAAC,yBAAyB,EACjC,MAAO,CACH,wBAAyB,KAC7B,CACJ,EACA,CACI,MAAO,CAEH,wBACA,wBAGA,6BACA,6BAGA,uBACJ,EACA,MAAO,CACH,mBAAoB,MACpB,8BAA+B,KACnC,CACJ,CACJ,EACA,eAAgB,CACZ,MAEA,QACA,gBACA,oBACA,iBACA,QAEA,WACA,YACA,eACA,UAEA,SACA,QACA,OAEA,aAKA,QACJ,CACJ,EAEOM,EAAQD","sourcesContent":["/**\n * @rushstack/eslint-patch is used to include plugins as dev\n * dependencies instead of imposing them as peer dependencies\n *\n * https://www.npmjs.com/package/@rushstack/eslint-patch\n */\nimport \"@rushstack/eslint-patch/modern-module-resolution\";\n\nimport { packageIsTypeModule, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\nimport { join } from \"node:path\";\nimport semver from \"semver\";\n\nimport { pluginRules, possiblePluginRules, rules } from \"./config\";\nimport engineRules from \"./engine-node-overwrite\";\nimport { consoleLog, consolePlugin } from \"./utils/loggers\";\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigLoaded) {\n if (process.env[\"DEBUG\"]) {\n consoleLog(\"\\n@anolilab/eslint-config loaded the following plugins:\\n\");\n\n consoleLog(\" @rushstack/eslint-plugin-security\");\n [\n \"compat\",\n \"eslint-comments\",\n \"i\",\n \"optimize-regex\",\n \"promise\",\n \"simple-import-sort\",\n \"unicorn\",\n \"no-secrets\",\n \"sonarjs\",\n \"json\",\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"es\",\n ...pluginRules,\n ].forEach((plugin) => consolePlugin(plugin));\n }\n\n Object.entries(possiblePluginRules).forEach(([plugin, dependencies]) => {\n const hasOneDependency = Object.values(dependencies).some(Boolean);\n\n if (hasOneDependency) {\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 (Object.keys(possiblePluginRules).length > 0) {\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(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\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\n\n .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 {\n hasAnyDep, hasDependency, hasDevDependency, pkg,\n} from \"@anolilab/package-json-utils\";\n\nimport type { PackageRules } from \"./types\";\n\nconst baseConfig = [\"best-practices\", \"errors\", \"style\", \"es6\", \"variables\"];\n\nconst internalPluginConfig = [\n \"compat\",\n \"eslint-comments\",\n \"import\",\n \"optimize-regex\",\n \"promise\",\n \"simple-import-sort\",\n \"no-extend-native\",\n \"node\",\n // Security Rules\n \"no-secrets\",\n \"sonarjs\",\n \"security\",\n // file rules\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"html\",\n\n // custom rules\n \"antfu\",\n \"unicorn\",\n \"es\",\n];\n\nconst pluginConfig: PackageRules = [\n {\n configName: \"array-func\",\n dependencies: [\"eslint-plugin-array-func\"],\n },\n {\n configName: \"jsdoc\",\n dependencies: [\"eslint-plugin-jsdoc\"],\n },\n {\n configName: \"tsdoc\",\n dependencies: [\"eslint-plugin-tsdoc\", \"typescript\"],\n },\n {\n configName: \"lodash\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash\"],\n },\n {\n configName: \"lodash-fp\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash-fp\"],\n },\n {\n configName: \"you-dont-need-lodash-underscore\",\n dependencies: [\"lodash\", \"eslint-plugin-you-dont-need-lodash-underscore\"],\n },\n {\n configName: \"mdx\",\n dependencies: [\"eslint-plugin-mdx\"],\n },\n {\n configName: \"no-unsanitized\",\n dependencies: [\"eslint-plugin-no-unsanitized\"],\n },\n {\n configName: \"react\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react\"],\n },\n {\n configName: \"react-redux\",\n dependencies: [\"eslint-plugin-react-redux\"],\n },\n {\n configName: \"jsx-a11y\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-jsx-a11y\"],\n },\n {\n configName: \"react-hooks\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react-hooks\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment\", \"moment-timezone\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"eslint-plugin-tailwindcss\"],\n },\n {\n configName: \"cypress\",\n dependencies: [\"eslint-plugin-cypress\"],\n },\n {\n configName: \"jest\",\n dependencies: [\"jest\", \"eslint-plugin-jest\"],\n },\n {\n configName: \"jest-dom\",\n dependencies: [\"jest\", \"@testing-library/jest-dom\", \"eslint-plugin-jest-dom\"],\n },\n {\n configName: \"jest-async\",\n dependencies: [\"jest\", \"eslint-plugin-jest-async\"],\n },\n {\n configName: \"jest-formatting\",\n dependencies: [\"jest\", \"eslint-plugin-jest-formatting\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"tailwindcss\"],\n },\n {\n configName: \"testing-library\",\n dependencies: [\"@testing-library/dom\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"typescript\",\n dependencies: [\"typescript\"],\n },\n {\n configName: \"typescript-sort-keys\",\n dependencies: [\"typescript\", \"eslint-plugin-typescript-sort-keys\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\"],\n },\n {\n configName: \"zod\",\n dependencies: [\"zod\", \"eslint-plugin-zod\"],\n },\n {\n configName: \"ava\",\n dependencies: [\"ava\", \"eslint-plugin-ava\"],\n },\n];\n\nconst loadedPlugins: string[] = [...internalPluginConfig];\nconst possiblePlugins: { [rule: string]: { [packageName: string]: boolean } } = {};\n\nlet anolilabEslintConfig: { [key: string]: { [key: string]: false | undefined} } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\npluginConfig.forEach((plugin) => {\n const { dependencies, configName } = plugin;\n\n if (anolilabEslintConfig?.[\"plugin\"]?.[configName] !== false) {\n if (\n hasAnyDep(dependencies, {\n peerDeps: false,\n strict: true,\n })\n ) {\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","dependency","rules","pluginRules","possiblePluginRules","engineRules","engine_node_overwrite_default","consoleLog","consolePlugin","installed","configRules","nodeVersion","rule","ruleConfig","minVersion","config","src_default"],"mappings":"gDAMA,MAAO,mDAEP,OAAS,aAAAA,EAAW,uBAAAC,EAAqB,OAAAC,MAAW,+BAEpD,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAY,SCXnB,OACC,aAAAJ,EAAW,iBAAAK,EAAe,oBAAAC,EAAkB,OAAAJ,MACtC,+BAIP,IAAMK,EAAa,CAAC,iBAAkB,SAAU,QAAS,MAAO,WAAW,EAErEC,EAAuB,CACzB,SACA,kBACA,SACA,iBACA,UACA,qBACA,mBACA,OAEA,aACA,UACA,WAEA,QACA,WACA,OACA,MACA,OAGA,QACA,UACA,IACJ,EAEMC,EAA6B,CAC/B,CACI,WAAY,aACZ,aAAc,CAAC,0BAA0B,CAC7C,EACA,CACI,WAAY,QACZ,aAAc,CAAC,qBAAqB,CACxC,EACA,CACI,WAAY,QACZ,aAAc,CAAC,sBAAuB,YAAY,CACtD,EACA,CACI,WAAY,SACZ,aAAc,CAAC,SAAU,sBAAsB,CACnD,EACA,CACI,WAAY,YACZ,aAAc,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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,sBAAuB,MACvB,2BAA4B,MAC5B,kBAAmB,MACnB,0BAA2B,MAC3B,qBAAsB,MACtB,gCAAiC,MACjC,mCAAoC,MACpC,uBAAwB,MACxB,uBAAwB,MACxB,0BAA2B,MAC3B,+BAAgC,MAChC,qBAAsB,MACtB,gBAAiB,MACjB,cAAe,MACf,sBAAuB,MACvB,KAAM,MACN,eAAgB,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,GAAGb,EAAM,IAAKJ,GAAWV,EAAK,UAAW,YAAYU,KAAUZ,EAAsB,IAAM,MAAM,CAAC,EAElG,GAAGiB,EAAY,IAAKL,GAAWV,EAAK,UAAW,oBAAoBU,KAAUZ,EAAsB,IAAM,MAAM,CAAC,CACpH,EACA,MAAO,CACH,GAAGwB,CACP,EACA,UAAW,CACP,CACI,MAAO,CAAC,yBAAyB,EACjC,MAAO,CACH,wBAAyB,KAC7B,CACJ,EACA,CACI,MAAO,CAEH,wBACA,wBAGA,6BACA,6BAGA,uBACJ,EACA,MAAO,CACH,mBAAoB,MACpB,8BAA+B,KACnC,CACJ,CACJ,EACA,eAAgB,CACZ,MAEA,QACA,gBACA,oBACA,iBACA,QAEA,WACA,YACA,eACA,UAEA,SACA,QACA,OAEA,aAKA,QACJ,CACJ,EAEOM,EAAQD","sourcesContent":["/**\n * @rushstack/eslint-patch is used to include plugins as dev\n * dependencies instead of imposing them as peer dependencies\n *\n * https://www.npmjs.com/package/@rushstack/eslint-patch\n */\nimport \"@rushstack/eslint-patch/modern-module-resolution\";\n\nimport { hasAnyDep, packageIsTypeModule, pkg } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\nimport { join } from \"node:path\";\nimport semver from \"semver\";\n\nimport { pluginRules, possiblePluginRules, rules } from \"./config\";\nimport engineRules from \"./engine-node-overwrite\";\nimport { consoleLog, consolePlugin } from \"./utils/loggers\";\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigLoaded) {\n if (process.env[\"DEBUG\"]) {\n consoleLog(\"\\n@anolilab/eslint-config loaded the following plugins:\\n\");\n\n consoleLog(\" @rushstack/eslint-plugin-security\");\n [\n \"compat\",\n \"eslint-comments\",\n \"i\",\n \"optimize-regex\",\n \"promise\",\n \"simple-import-sort\",\n \"unicorn\",\n \"no-secrets\",\n \"sonarjs\",\n \"json\",\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"es\",\n ...pluginRules,\n ].forEach((plugin) => consolePlugin(plugin));\n }\n\n Object.entries(possiblePluginRules).forEach(([plugin, dependencies]) => {\n const hasOneDependency = Object.values(dependencies).some(Boolean);\n\n if (hasOneDependency) {\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 (Object.keys(possiblePluginRules).length > 0) {\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\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 consoleLog(\"\\nFound prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier\");\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 {\n hasAnyDep, hasDependency, hasDevDependency, pkg,\n} from \"@anolilab/package-json-utils\";\n\nimport type { PackageRules } from \"./types\";\n\nconst baseConfig = [\"best-practices\", \"errors\", \"style\", \"es6\", \"variables\"];\n\nconst internalPluginConfig = [\n \"compat\",\n \"eslint-comments\",\n \"import\",\n \"optimize-regex\",\n \"promise\",\n \"simple-import-sort\",\n \"no-extend-native\",\n \"node\",\n // Security Rules\n \"no-secrets\",\n \"sonarjs\",\n \"security\",\n // file rules\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"html\",\n\n // custom rules\n \"antfu\",\n \"unicorn\",\n \"es\",\n];\n\nconst pluginConfig: PackageRules = [\n {\n configName: \"array-func\",\n dependencies: [\"eslint-plugin-array-func\"],\n },\n {\n configName: \"jsdoc\",\n dependencies: [\"eslint-plugin-jsdoc\"],\n },\n {\n configName: \"tsdoc\",\n dependencies: [\"eslint-plugin-tsdoc\", \"typescript\"],\n },\n {\n configName: \"lodash\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash\"],\n },\n {\n configName: \"lodash-fp\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash-fp\"],\n },\n {\n configName: \"you-dont-need-lodash-underscore\",\n dependencies: [\"lodash\", \"eslint-plugin-you-dont-need-lodash-underscore\"],\n },\n {\n configName: \"mdx\",\n dependencies: [\"eslint-plugin-mdx\"],\n },\n {\n configName: \"no-unsanitized\",\n dependencies: [\"eslint-plugin-no-unsanitized\"],\n },\n {\n configName: \"react\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react\"],\n },\n {\n configName: \"react-redux\",\n dependencies: [\"eslint-plugin-react-redux\"],\n },\n {\n configName: \"jsx-a11y\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-jsx-a11y\"],\n },\n {\n configName: \"react-hooks\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react-hooks\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment\", \"moment-timezone\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"eslint-plugin-tailwindcss\"],\n },\n {\n configName: \"cypress\",\n dependencies: [\"eslint-plugin-cypress\"],\n },\n {\n configName: \"jest\",\n dependencies: [\"jest\", \"eslint-plugin-jest\"],\n },\n {\n configName: \"jest-dom\",\n dependencies: [\"jest\", \"@testing-library/jest-dom\", \"eslint-plugin-jest-dom\"],\n },\n {\n configName: \"jest-async\",\n dependencies: [\"jest\", \"eslint-plugin-jest-async\"],\n },\n {\n configName: \"jest-formatting\",\n dependencies: [\"jest\", \"eslint-plugin-jest-formatting\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"tailwindcss\"],\n },\n {\n configName: \"testing-library\",\n dependencies: [\"@testing-library/dom\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"typescript\",\n dependencies: [\"typescript\"],\n },\n {\n configName: \"typescript-sort-keys\",\n dependencies: [\"typescript\", \"eslint-plugin-typescript-sort-keys\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\"],\n },\n {\n configName: \"zod\",\n dependencies: [\"zod\", \"eslint-plugin-zod\"],\n },\n {\n configName: \"ava\",\n dependencies: [\"ava\", \"eslint-plugin-ava\"],\n },\n];\n\nconst loadedPlugins: string[] = [...internalPluginConfig];\nconst possiblePlugins: { [rule: string]: { [packageName: string]: boolean } } = {};\n\nlet anolilabEslintConfig: { [key: string]: { [key: string]: false | undefined } } = {};\n\nif (pkg) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n anolilabEslintConfig = pkg?.[\"anolilab\"]?.[\"eslint-config\"];\n}\n\npluginConfig.forEach((plugin) => {\n const { dependencies, configName } = plugin;\n\n if (anolilabEslintConfig?.[\"plugin\"]?.[configName] !== false) {\n if (\n hasAnyDep(dependencies, {\n peerDeps: false,\n strict: true,\n })\n ) {\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/postinstall.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","projectPath","existsSync","readFileSync","writeFile","join","promisify","writeFileAsync","writeEslintRc","eslintPath","pluginExtends","parserOptions","tsconfigPath","tsConfig","ecmaVersion","content","writeEslintIgnore","eslintIgnorePath","error"],"mappings":"AAAA,OAAS,uBAAAA,EAAqB,eAAAC,MAAmB,+BACjD,OAAS,cAAAC,EAAY,gBAAAC,EAAc,aAAAC,MAAiB,KACpD,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,
|
|
1
|
+
{"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","projectPath","existsSync","readFileSync","writeFile","join","promisify","writeFileAsync","writeEslintRc","eslintPath","pluginExtends","parserOptions","tsconfigPath","tsConfig","ecmaVersion","content","writeEslintIgnore","eslintIgnorePath","error"],"mappings":"AAAA,OAAS,uBAAAA,E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oCJ,OAAIT,EAAWO,CAAU,GACrB,QAAQ,KAAK;AAAA;AAAA,gEAE2C,EAEjD,QAAQ,QAAQ,GAGpBF,EAAeE,EAAYM,EAAS,OAAO,CACtD,EAKMC,EAAoB,IAAM,CAC5B,IAAMC,EAAmBZ,EAAKJ,EAAa,eAAe,EAE1D,OAAIC,EAAWe,CAAgB,GAC3B,QAAQ,KAAK,4CAAkC,EAExC,QAAQ,QAAQ,GAGpBV,EAAeU,EAAkB,GAAI,OAAO,CACvD,GAGC,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACT,EAAc,EAAGQ,EAAkB,CAAC,CAAC,EAExD,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASE,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["import { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\nimport { existsSync, readFileSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport type { TsConfigJson } from \"type-fest\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/eslint-config\", projectPath, \"\\n\");\n\n/**\n * Writes .eslintrc.js if it doesn't exist. Warns if it exists.\n */\n// eslint-disable-next-line sonarjs/cognitive-complexity\nconst writeEslintRc = () => {\n const eslintPath = join(projectPath, \".eslintrc.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 if (existsSync(tsconfigPath)) {\n const tsConfig = JSON.parse(readFileSync(tsconfigPath, \"utf8\")) as TsConfigJson;\n\n let ecmaVersion = \"latest\";\n\n if (tsConfig.compilerOptions?.target) {\n ecmaVersion = tsConfig.compilerOptions.target;\n\n ecmaVersion = ecmaVersion.toLowerCase() === \"es2022\" || ecmaVersion.toLowerCase() === \"esnext\" ? \"latest\" : ecmaVersion.toLowerCase().replace(\"es\", \"\");\n\n if (ecmaVersion !== \"latest\" && ecmaVersion !== \"2022\" && ecmaVersion !== \"2021\" && ecmaVersion !== \"2021\" && ecmaVersion !== \"6\") {\n pluginExtends = `, \"plugin:es/restrict-to-es${ecmaVersion}\"`;\n }\n }\n\n parserOptions = `\n parserOptions: {\n project: \"./tsconfig.json\",\n ecmaVersion: ${ecmaVersion === \"latest\" ? `\"${ecmaVersion}\"` : ecmaVersion},\n sourceType: ${packageIsTypeModule ? '\"module\"' : '\"commonjs\"'},\n },`;\n }\n\n const content = `/** @ts-check */\n/** @type {import('eslint').Linter.Config} */\n${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\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 // 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 if (existsSync(eslintPath)) {\n console.warn(`⚠️ .eslintrc.cjs 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 Promise.resolve();\n }\n\n return writeFileAsync(eslintPath, content, \"utf-8\");\n};\n\n/**\n * Writes .eslintignore if it doesn't exist. Warns if it exists.\n */\nconst writeEslintIgnore = () => {\n const eslintIgnorePath = join(projectPath, \".eslintignore\");\n\n if (existsSync(eslintIgnorePath)) {\n console.warn(\"⚠️ .eslintignore already exists\");\n\n return Promise.resolve();\n }\n\n return writeFileAsync(eslintIgnorePath, \"\", \"utf-8\");\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 // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(1);\n }\n})();\n"]}
|
package/dist/postinstall.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","projectPath","existsSync","readFileSync","writeFile","join","promisify","writeFileAsync","writeEslintRc","eslintPath","pluginExtends","parserOptions","tsconfigPath","tsConfig","ecmaVersion","content","writeEslintIgnore","eslintIgnorePath","error"],"mappings":"AAAA,OAAS,uBAAAA,EAAqB,eAAAC,MAAmB,+BACjD,OAAS,cAAAC,EAAY,gBAAAC,EAAc,aAAAC,MAAiB,KACpD,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,
|
|
1
|
+
{"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","projectPath","existsSync","readFileSync","writeFile","join","promisify","writeFileAsync","writeEslintRc","eslintPath","pluginExtends","parserOptions","tsconfigPath","tsConfig","ecmaVersion","content","writeEslintIgnore","eslintIgnorePath","error"],"mappings":"AAAA,OAAS,uBAAAA,EAAqB,eAAAC,M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AAWO,CAAU,GACrB,QAAQ,KAAK;AAAA;AAAA,gEAE2C,EAEjD,QAAQ,QAAQ,GAGpBF,EAAeE,EAAYM,EAAS,OAAO,CACtD,EAKMC,EAAoB,IAAM,CAC5B,IAAMC,EAAmBZ,EAAKJ,EAAa,eAAe,EAE1D,OAAIC,EAAWe,CAAgB,GAC3B,QAAQ,KAAK,4CAAkC,EAExC,QAAQ,QAAQ,GAGpBV,EAAeU,EAAkB,GAAI,OAAO,CACvD,GAGC,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACT,EAAc,EAAGQ,EAAkB,CAAC,CAAC,EAExD,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASE,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["import { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\nimport { existsSync, readFileSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport type { TsConfigJson } from \"type-fest\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/eslint-config\", projectPath, \"\\n\");\n\n/**\n * Writes .eslintrc.js if it doesn't exist. Warns if it exists.\n */\n// eslint-disable-next-line sonarjs/cognitive-complexity\nconst writeEslintRc = () => {\n const eslintPath = join(projectPath, \".eslintrc.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 if (existsSync(tsconfigPath)) {\n const tsConfig = JSON.parse(readFileSync(tsconfigPath, \"utf8\")) as TsConfigJson;\n\n let ecmaVersion = \"latest\";\n\n if (tsConfig.compilerOptions?.target) {\n ecmaVersion = tsConfig.compilerOptions.target;\n\n ecmaVersion = ecmaVersion.toLowerCase() === \"es2022\" || ecmaVersion.toLowerCase() === \"esnext\" ? \"latest\" : ecmaVersion.toLowerCase().replace(\"es\", \"\");\n\n if (ecmaVersion !== \"latest\" && ecmaVersion !== \"2022\" && ecmaVersion !== \"2021\" && ecmaVersion !== \"2021\" && ecmaVersion !== \"6\") {\n pluginExtends = `, \"plugin:es/restrict-to-es${ecmaVersion}\"`;\n }\n }\n\n parserOptions = `\n parserOptions: {\n project: \"./tsconfig.json\",\n ecmaVersion: ${ecmaVersion === \"latest\" ? `\"${ecmaVersion}\"` : ecmaVersion},\n sourceType: ${packageIsTypeModule ? '\"module\"' : '\"commonjs\"'},\n },`;\n }\n\n const content = `/** @ts-check */\n/** @type {import('eslint').Linter.Config} */\n${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\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 // 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 if (existsSync(eslintPath)) {\n console.warn(`⚠️ .eslintrc.cjs 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 Promise.resolve();\n }\n\n return writeFileAsync(eslintPath, content, \"utf-8\");\n};\n\n/**\n * Writes .eslintignore if it doesn't exist. Warns if it exists.\n */\nconst writeEslintIgnore = () => {\n const eslintIgnorePath = join(projectPath, \".eslintignore\");\n\n if (existsSync(eslintIgnorePath)) {\n console.warn(\"⚠️ .eslintignore already exists\");\n\n return Promise.resolve();\n }\n\n return writeFileAsync(eslintIgnorePath, \"\", \"utf-8\");\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 // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(1);\n }\n})();\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anolilab/eslint-config",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.3",
|
|
4
4
|
"description": "ESLint shareable config for the Anolilab JavaScript style guide.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -103,11 +103,12 @@
|
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@anolilab/semantic-release-preset": "3.1.1",
|
|
106
|
-
"@testing-library/dom": "^9.3.
|
|
106
|
+
"@testing-library/dom": "^9.3.1",
|
|
107
|
+
"@total-typescript/ts-reset": "^0.4.2",
|
|
107
108
|
"@types/confusing-browser-globals": "^1.0.0",
|
|
108
109
|
"@types/eslint": "^8.40.2",
|
|
109
110
|
"@types/semver": "^7.5.0",
|
|
110
|
-
"eslint": "^8.
|
|
111
|
+
"eslint": "^8.43.0",
|
|
111
112
|
"eslint-find-rules": "^4.1.0",
|
|
112
113
|
"eslint-plugin-babel": "^5.3.1",
|
|
113
114
|
"eslint-plugin-cypress": "^2.13.3",
|
|
@@ -124,13 +125,14 @@
|
|
|
124
125
|
"eslint-plugin-react-redux": "^4.0.0",
|
|
125
126
|
"eslint-plugin-tailwindcss": "^3.12.1",
|
|
126
127
|
"eslint-plugin-testing-library": "^5.11.0",
|
|
127
|
-
"eslint-plugin-vitest": "^0.
|
|
128
|
+
"eslint-plugin-vitest": "^0.2.6",
|
|
128
129
|
"eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0",
|
|
129
130
|
"eslint-plugin-you-dont-need-momentjs": "^1.6.0",
|
|
130
131
|
"eslint-plugin-zod": "^1.4.0",
|
|
131
132
|
"jest": "^29.5.0",
|
|
132
133
|
"react": "^18.2.0",
|
|
133
|
-
"semantic-release": "^21.0.
|
|
134
|
+
"semantic-release": "^21.0.5",
|
|
135
|
+
"type-fest": "^3.12.0",
|
|
134
136
|
"typescript": "^5.1.3"
|
|
135
137
|
},
|
|
136
138
|
"peerDependencies": {
|
package/dist/chunk-F6JHPR4L.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { pkg } from '@anolilab/package-json-utils';
|
|
2
|
-
|
|
3
|
-
var e={};pkg&&(e=pkg?.anolilab?.["eslint-config"]);var n=4;if(e?.indent){if(Number.isNaN(e.indent))throw new TypeError("Indent must be a number");n=Number(e.indent);}var o={rules:{"array-bracket-newline":"off","array-element-newline":"off","array-bracket-spacing":["error","never"],"block-spacing":["error","always"],"brace-style":["error","1tbs",{allowSingleLine:!0}],camelcase:["error",{properties:"never",ignoreDestructuring:!1}],"capitalized-comments":["off","never",{line:{ignorePattern:".*",ignoreInlineComments:!0,ignoreConsecutiveComments:!0},block:{ignorePattern:".*",ignoreInlineComments:!0,ignoreConsecutiveComments:!0}}],"comma-dangle":["error",{arrays:"always-multiline",objects:"always-multiline",imports:"always-multiline",exports:"always-multiline",functions:"always-multiline"}],"comma-spacing":["error",{before:!1,after:!0}],"comma-style":["error","last",{exceptions:{ArrayExpression:!1,ArrayPattern:!1,ArrowFunctionExpression:!1,CallExpression:!1,FunctionDeclaration:!1,FunctionExpression:!1,ImportDeclaration:!1,ObjectExpression:!1,ObjectPattern:!1,VariableDeclaration:!1,NewExpression:!1}}],"computed-property-spacing":["error","never"],"consistent-this":"off","default-param-last":["error"],"eol-last":["error","always"],"function-call-argument-newline":["error","consistent"],"func-call-spacing":["error","never"],"func-name-matching":["off","always",{includeCommonJSModuleExports:!1,considerPropertyDescriptor:!0}],"func-names":"warn","func-style":["error","expression"],"function-paren-newline":["error","consistent"],"id-blacklist":"error","id-denylist":"off","id-length":"off","id-match":"off","implicit-arrow-linebreak":["error","beside"],indent:["error",n,{SwitchCase:1,VariableDeclarator:1,outerIIFEBody:1,FunctionDeclaration:{parameters:1,body:1},FunctionExpression:{parameters:1,body:1},CallExpression:{arguments:1},ArrayExpression:1,ObjectExpression:1,ImportDeclaration:1,flatTernaryExpressions:!1,ignoredNodes:["JSXElement","JSXElement > *","JSXAttribute","JSXIdentifier","JSXNamespacedName","JSXMemberExpression","JSXSpreadAttribute","JSXExpressionContainer","JSXOpeningElement","JSXClosingElement","JSXFragment","JSXOpeningFragment","JSXClosingFragment","JSXText","JSXEmptyExpression","JSXSpreadChild"],ignoreComments:!1}],"jsx-quotes":["off","prefer-double"],"key-spacing":["error",{beforeColon:!1,afterColon:!0}],"keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}],"line-comment-position":["off",{position:"above",ignorePattern:"",applyDefaultPatterns:!0}],"linebreak-style":["error","unix"],"lines-between-class-members":["error","always",{exceptAfterSingleLine:!1}],"lines-around-comment":"off","lines-around-directive":["error",{before:"always",after:"always"}],"max-depth":["off",4],"max-len":["error",160,2,{ignoreUrls:!0,ignoreComments:!1,ignoreRegExpLiterals:!0,ignoreStrings:!0,ignoreTemplateLiterals:!0}],"max-lines":["off",{max:300,skipBlankLines:!0,skipComments:!0}],"max-lines-per-function":["off",{max:50,skipBlankLines:!0,skipComments:!0,IIFEs:!0}],"max-nested-callbacks":"off","max-params":["off",3],"max-statements":["off",10],"max-statements-per-line":["off",{max:1}],"multiline-comment-style":["off","starred-block"],"multiline-ternary":["off","never"],"new-cap":["error",{newIsCap:!0,newIsCapExceptions:[],capIsNew:!1,capIsNewExceptions:["Immutable.Map","Immutable.Set","Immutable.List"]}],"new-parens":"error","newline-after-var":"off","newline-before-return":"off","newline-per-chained-call":["error",{ignoreChainWithDepth:4}],"no-array-constructor":"error","no-bitwise":"error","no-continue":"error","no-inline-comments":"off","no-lonely-if":"error","no-mixed-operators":["error",{groups:[["%","**"],["%","+"],["%","-"],["%","*"],["%","/"],["/","*"],["&","|","<<",">>",">>>"],["==","!=","===","!=="],["&&","||"],["in","instanceof"]],allowSamePrecedence:!1}],"no-mixed-spaces-and-tabs":"error","no-multi-assign":["error"],"no-multiple-empty-lines":["error",{max:1,maxBOF:0,maxEOF:0}],"no-negated-condition":"off","no-nested-ternary":"error","no-new-object":"error","no-plusplus":"error","no-restricted-syntax":["error",{selector:"ForInStatement",message:"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."},{selector:"ForOfStatement",message:"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."},{selector:"LabeledStatement",message:"Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."},{selector:"WithStatement",message:"`with` is disallowed in strict mode because it makes code impossible to predict and optimize."}],"no-spaced-func":"off","no-tabs":"error","no-ternary":"off","no-trailing-spaces":["error",{skipBlankLines:!1,ignoreComments:!1}],"no-underscore-dangle":["error",{allow:["__DEV__"],allowAfterThis:!1,allowAfterSuper:!1,enforceInMethodNames:!0}],"no-unneeded-ternary":["error",{defaultAssignment:!1}],"no-whitespace-before-property":"error","nonblock-statement-body-position":["error","beside",{overrides:{}}],"object-curly-spacing":["error","always"],"object-curly-newline":["error",{ObjectExpression:{minProperties:4,multiline:!0,consistent:!0},ObjectPattern:{minProperties:4,multiline:!0,consistent:!0},ImportDeclaration:{minProperties:4,multiline:!0,consistent:!0},ExportDeclaration:{minProperties:4,multiline:!0,consistent:!0}}],"object-property-newline":["error",{allowAllPropertiesOnSameLine:!0}],"one-var":["error","never"],"one-var-declaration-per-line":["error","always"],"operator-assignment":["error","always"],"operator-linebreak":["error","before",{overrides:{"=":"none"}}],"padded-blocks":["error",{blocks:"never",classes:"never",switches:"never"},{allowSingleLineBlocks:!0}],"padding-line-between-statements":"off","prefer-exponentiation-operator":"error","prefer-object-spread":"error","quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],quotes:["error","double",{avoidEscape:!0}],"require-jsdoc":"off",semi:["error","always"],"semi-spacing":["error",{before:!1,after:!0}],"semi-style":["error","last"],"sort-keys":["off","asc",{caseSensitive:!1,natural:!0}],"sort-vars":"off","space-before-blocks":"error","space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"space-in-parens":["error","never"],"space-infix-ops":"error","space-unary-ops":["error",{words:!0,nonwords:!1,overrides:{}}],"spaced-comment":["error","always",{line:{exceptions:["-","+","*"],markers:["=","!","/"]},block:{exceptions:["-","+"],markers:["=","!",":","::"],balanced:!0}}],"switch-colon-spacing":["error",{after:!0,before:!1}],"template-tag-spacing":["error","never"],"unicode-bom":["error","never"],"wrap-regex":"off"}},a=o;
|
|
4
|
-
|
|
5
|
-
export { a };
|
|
6
|
-
//# sourceMappingURL=out.js.map
|
|
7
|
-
//# sourceMappingURL=chunk-F6JHPR4L.mjs.map
|
|
@@ -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,CA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AAe,GAAO,QAAS,EAAK,CAAC,EAGnE,YAAa,MAGb,sBAAuB,QAIvB,8BAA+B,CAC3B,QACA,CACI,UAAW,SACX,MAAO,QACP,WAAY,QAChB,CACJ,EAGA,kBAAmB,CAAC,QAAS,OAAO,EAGpC,kBAAmB,QAInB,kBAAmB,CACf,QACA,CACI,MAAO,GACP,SAAU,GACV,UAAW,CAAC,CAChB,CACJ,EAIA,iBAAkB,CACd,QACA,SACA,CACI,KAAM,CACF,WAAY,CAAC,IAAK,IAAK,GAAG,EAC1B,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 // eslint-disable-next-line sonarjs/no-duplicate-string\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\": \"warn\",\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"]}
|
package/dist/chunk-NO36P4BR.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var packageJsonUtils = require('@anolilab/package-json-utils');
|
|
4
|
-
|
|
5
|
-
var e={};packageJsonUtils.pkg&&(e=packageJsonUtils.pkg?.anolilab?.["eslint-config"]);var n=4;if(e?.indent){if(Number.isNaN(e.indent))throw new TypeError("Indent must be a number");n=Number(e.indent);}var o={rules:{"array-bracket-newline":"off","array-element-newline":"off","array-bracket-spacing":["error","never"],"block-spacing":["error","always"],"brace-style":["error","1tbs",{allowSingleLine:!0}],camelcase:["error",{properties:"never",ignoreDestructuring:!1}],"capitalized-comments":["off","never",{line:{ignorePattern:".*",ignoreInlineComments:!0,ignoreConsecutiveComments:!0},block:{ignorePattern:".*",ignoreInlineComments:!0,ignoreConsecutiveComments:!0}}],"comma-dangle":["error",{arrays:"always-multiline",objects:"always-multiline",imports:"always-multiline",exports:"always-multiline",functions:"always-multiline"}],"comma-spacing":["error",{before:!1,after:!0}],"comma-style":["error","last",{exceptions:{ArrayExpression:!1,ArrayPattern:!1,ArrowFunctionExpression:!1,CallExpression:!1,FunctionDeclaration:!1,FunctionExpression:!1,ImportDeclaration:!1,ObjectExpression:!1,ObjectPattern:!1,VariableDeclaration:!1,NewExpression:!1}}],"computed-property-spacing":["error","never"],"consistent-this":"off","default-param-last":["error"],"eol-last":["error","always"],"function-call-argument-newline":["error","consistent"],"func-call-spacing":["error","never"],"func-name-matching":["off","always",{includeCommonJSModuleExports:!1,considerPropertyDescriptor:!0}],"func-names":"warn","func-style":["error","expression"],"function-paren-newline":["error","consistent"],"id-blacklist":"error","id-denylist":"off","id-length":"off","id-match":"off","implicit-arrow-linebreak":["error","beside"],indent:["error",n,{SwitchCase:1,VariableDeclarator:1,outerIIFEBody:1,FunctionDeclaration:{parameters:1,body:1},FunctionExpression:{parameters:1,body:1},CallExpression:{arguments:1},ArrayExpression:1,ObjectExpression:1,ImportDeclaration:1,flatTernaryExpressions:!1,ignoredNodes:["JSXElement","JSXElement > *","JSXAttribute","JSXIdentifier","JSXNamespacedName","JSXMemberExpression","JSXSpreadAttribute","JSXExpressionContainer","JSXOpeningElement","JSXClosingElement","JSXFragment","JSXOpeningFragment","JSXClosingFragment","JSXText","JSXEmptyExpression","JSXSpreadChild"],ignoreComments:!1}],"jsx-quotes":["off","prefer-double"],"key-spacing":["error",{beforeColon:!1,afterColon:!0}],"keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}],"line-comment-position":["off",{position:"above",ignorePattern:"",applyDefaultPatterns:!0}],"linebreak-style":["error","unix"],"lines-between-class-members":["error","always",{exceptAfterSingleLine:!1}],"lines-around-comment":"off","lines-around-directive":["error",{before:"always",after:"always"}],"max-depth":["off",4],"max-len":["error",160,2,{ignoreUrls:!0,ignoreComments:!1,ignoreRegExpLiterals:!0,ignoreStrings:!0,ignoreTemplateLiterals:!0}],"max-lines":["off",{max:300,skipBlankLines:!0,skipComments:!0}],"max-lines-per-function":["off",{max:50,skipBlankLines:!0,skipComments:!0,IIFEs:!0}],"max-nested-callbacks":"off","max-params":["off",3],"max-statements":["off",10],"max-statements-per-line":["off",{max:1}],"multiline-comment-style":["off","starred-block"],"multiline-ternary":["off","never"],"new-cap":["error",{newIsCap:!0,newIsCapExceptions:[],capIsNew:!1,capIsNewExceptions:["Immutable.Map","Immutable.Set","Immutable.List"]}],"new-parens":"error","newline-after-var":"off","newline-before-return":"off","newline-per-chained-call":["error",{ignoreChainWithDepth:4}],"no-array-constructor":"error","no-bitwise":"error","no-continue":"error","no-inline-comments":"off","no-lonely-if":"error","no-mixed-operators":["error",{groups:[["%","**"],["%","+"],["%","-"],["%","*"],["%","/"],["/","*"],["&","|","<<",">>",">>>"],["==","!=","===","!=="],["&&","||"],["in","instanceof"]],allowSamePrecedence:!1}],"no-mixed-spaces-and-tabs":"error","no-multi-assign":["error"],"no-multiple-empty-lines":["error",{max:1,maxBOF:0,maxEOF:0}],"no-negated-condition":"off","no-nested-ternary":"error","no-new-object":"error","no-plusplus":"error","no-restricted-syntax":["error",{selector:"ForInStatement",message:"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."},{selector:"ForOfStatement",message:"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."},{selector:"LabeledStatement",message:"Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."},{selector:"WithStatement",message:"`with` is disallowed in strict mode because it makes code impossible to predict and optimize."}],"no-spaced-func":"off","no-tabs":"error","no-ternary":"off","no-trailing-spaces":["error",{skipBlankLines:!1,ignoreComments:!1}],"no-underscore-dangle":["error",{allow:["__DEV__"],allowAfterThis:!1,allowAfterSuper:!1,enforceInMethodNames:!0}],"no-unneeded-ternary":["error",{defaultAssignment:!1}],"no-whitespace-before-property":"error","nonblock-statement-body-position":["error","beside",{overrides:{}}],"object-curly-spacing":["error","always"],"object-curly-newline":["error",{ObjectExpression:{minProperties:4,multiline:!0,consistent:!0},ObjectPattern:{minProperties:4,multiline:!0,consistent:!0},ImportDeclaration:{minProperties:4,multiline:!0,consistent:!0},ExportDeclaration:{minProperties:4,multiline:!0,consistent:!0}}],"object-property-newline":["error",{allowAllPropertiesOnSameLine:!0}],"one-var":["error","never"],"one-var-declaration-per-line":["error","always"],"operator-assignment":["error","always"],"operator-linebreak":["error","before",{overrides:{"=":"none"}}],"padded-blocks":["error",{blocks:"never",classes:"never",switches:"never"},{allowSingleLineBlocks:!0}],"padding-line-between-statements":"off","prefer-exponentiation-operator":"error","prefer-object-spread":"error","quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],quotes:["error","double",{avoidEscape:!0}],"require-jsdoc":"off",semi:["error","always"],"semi-spacing":["error",{before:!1,after:!0}],"semi-style":["error","last"],"sort-keys":["off","asc",{caseSensitive:!1,natural:!0}],"sort-vars":"off","space-before-blocks":"error","space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"space-in-parens":["error","never"],"space-infix-ops":"error","space-unary-ops":["error",{words:!0,nonwords:!1,overrides:{}}],"spaced-comment":["error","always",{line:{exceptions:["-","+","*"],markers:["=","!","/"]},block:{exceptions:["-","+"],markers:["=","!",":","::"],balanced:!0}}],"switch-colon-spacing":["error",{after:!0,before:!1}],"template-tag-spacing":["error","never"],"unicode-bom":["error","never"],"wrap-regex":"off"}},a=o;
|
|
6
|
-
|
|
7
|
-
exports.a = a;
|
|
8
|
-
//# sourceMappingURL=out.js.map
|
|
9
|
-
//# sourceMappingURL=chunk-NO36P4BR.js.map
|
|
@@ -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,EAGlD,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,EAAM,CAAC,EAIxE,uBAAwB,CACpB,MACA,QACA,CACI,KAAM,CACF,cAAe,KACf,qBAAsB,GACtB,0BAA2B,EAC/B,EACA,MAAO,CACH,cAAe,KACf,qBAAsB,GACtB,0BAA2B,EAC/B,CACJ,CACJ,EAGA,eAAgB,CACZ,QACA,CAEI,OAAQ,mBACR,QAAS,mBACT,QAAS,mBACT,QAAS,mBACT,UAAW,kBACf,CACJ,EAGA,gBAAiB,CAAC,QAAS,CAAE,OAAQ,GAAO,MAAO,EAAK,CAAC,EAGzD,cAAe,CACX,QACA,OACA,CACI,WAAY,CACR,gBAAiB,GACjB,aAAc,GACd,wBAAyB,GACzB,eAAgB,GAChB,oBAAqB,GACrB,mBAAoB,GACpB,kBAAmB,GACnB,iBAAkB,GAClB,cAAe,GACf,oBAAqB,GACrB,cAAe,EACnB,CACJ,CACJ,EAGA,4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C,iCAAkC,QAIlC,uBAAwB,QAIxB,cAAe,CAAC,QAAS,YAAa,CAAE,SAAU,GAAO,YAAa,GAAM,QAAS,EAAM,CAAC,EAG5F,OAAQ,CAAC,QAAS,SAAU,CAAE,YAAa,EAAK,CAAC,EAIjD,gBAAiB,MAGjB,KAAM,CAAC,QAAS,QAAQ,EAGxB,eAAgB,CAAC,QAAS,CAAE,OAAQ,GAAO,MAAO,EAAK,CAAC,EAIxD,aAAc,CAAC,QAAS,MAAM,EAG9B,YAAa,CAAC,MAAO,MAAO,CAAE,cAAe,GAAO,QAAS,EAAK,CAAC,EAGnE,YAAa,MAGb,sBAAuB,QAIvB,8BAA+B,CAC3B,QACA,CACI,UAAW,SACX,MAAO,QACP,WAAY,QAChB,CACJ,EAGA,kBAAmB,CAAC,QAAS,OAAO,EAGpC,kBAAmB,QAInB,kBAAmB,CACf,QACA,CACI,MAAO,GACP,SAAU,GACV,UAAW,CAAC,CAChB,CACJ,EAIA,iBAAkB,CACd,QACA,SACA,CACI,KAAM,CACF,WAAY,CAAC,IAAK,IAAK,GAAG,EAC1B,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 // eslint-disable-next-line sonarjs/no-duplicate-string\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\": \"warn\",\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"]}
|