@anolilab/eslint-config 7.3.2 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +35 -23
  3. package/dist/chunk-3NVDJZNH.js +7 -0
  4. package/dist/chunk-3NVDJZNH.js.map +1 -0
  5. package/dist/{chunk-SV64EPVP.js → chunk-6COSQA7M.js} +2 -2
  6. package/dist/chunk-6COSQA7M.js.map +1 -0
  7. package/dist/chunk-BH4PQLFK.js +10 -0
  8. package/dist/chunk-BH4PQLFK.js.map +1 -0
  9. package/dist/chunk-KKHL2OSJ.js +7 -0
  10. package/dist/chunk-KKHL2OSJ.js.map +1 -0
  11. package/dist/chunk-MQFZFF2T.js +7 -0
  12. package/dist/chunk-MQFZFF2T.js.map +1 -0
  13. package/dist/chunk-PW4WCSOE.js +9 -0
  14. package/dist/chunk-PW4WCSOE.js.map +1 -0
  15. package/dist/{chunk-UYUXBUWX.js → chunk-SEYYGHPU.js} +1 -1
  16. package/dist/chunk-SEYYGHPU.js.map +1 -0
  17. package/dist/chunk-TWVXPNWB.js +9 -0
  18. package/dist/chunk-TWVXPNWB.js.map +1 -0
  19. package/dist/{chunk-U5H7JNHH.js → chunk-VW5ZVT2B.js} +2 -2
  20. package/dist/{chunk-U5H7JNHH.js.map → chunk-VW5ZVT2B.js.map} +1 -1
  21. package/dist/{chunk-UJAIXHCQ.js → chunk-ZFO6DTP4.js} +2 -2
  22. package/dist/{chunk-UJAIXHCQ.js.map → chunk-ZFO6DTP4.js.map} +1 -1
  23. package/dist/config/best-practices.js +3 -2
  24. package/dist/config/errors.js +3 -2
  25. package/dist/config/es6.js +3 -2
  26. package/dist/config/plugins/antfu.js +3 -2
  27. package/dist/config/plugins/antfu.js.map +1 -1
  28. package/dist/config/plugins/array-func.js +3 -2
  29. package/dist/config/plugins/array-func.js.map +1 -1
  30. package/dist/config/plugins/ava.js +3 -1
  31. package/dist/config/plugins/ava.js.map +1 -1
  32. package/dist/config/plugins/babel.js +7 -5
  33. package/dist/config/plugins/babel.js.map +1 -1
  34. package/dist/config/plugins/compat.js +2 -0
  35. package/dist/config/plugins/compat.js.map +1 -1
  36. package/dist/config/plugins/cypress.js +2 -0
  37. package/dist/config/plugins/cypress.js.map +1 -1
  38. package/dist/config/plugins/es.js +3 -2
  39. package/dist/config/plugins/es.js.map +1 -1
  40. package/dist/config/plugins/eslint-comments.js +3 -1
  41. package/dist/config/plugins/eslint-comments.js.map +1 -1
  42. package/dist/config/plugins/etc.js +3 -2
  43. package/dist/config/plugins/etc.js.map +1 -1
  44. package/dist/config/plugins/html.js +4 -3
  45. package/dist/config/plugins/html.js.map +1 -1
  46. package/dist/config/plugins/import.js +3 -2
  47. package/dist/config/plugins/jest-async.js +2 -0
  48. package/dist/config/plugins/jest-async.js.map +1 -1
  49. package/dist/config/plugins/jest-dom.js +2 -0
  50. package/dist/config/plugins/jest-dom.js.map +1 -1
  51. package/dist/config/plugins/jest-formatting.js +2 -0
  52. package/dist/config/plugins/jest-formatting.js.map +1 -1
  53. package/dist/config/plugins/jest.js +3 -1
  54. package/dist/config/plugins/jest.js.map +1 -1
  55. package/dist/config/plugins/jsdoc.js +4 -3
  56. package/dist/config/plugins/jsdoc.js.map +1 -1
  57. package/dist/config/plugins/jsonc.js +4 -3
  58. package/dist/config/plugins/jsonc.js.map +1 -1
  59. package/dist/config/plugins/jsx-a11y.js +2 -1
  60. package/dist/config/plugins/jsx-a11y.js.map +1 -1
  61. package/dist/config/plugins/lodash-fp.js +2 -0
  62. package/dist/config/plugins/lodash-fp.js.map +1 -1
  63. package/dist/config/plugins/lodash.js +3 -1
  64. package/dist/config/plugins/lodash.js.map +1 -1
  65. package/dist/config/plugins/markdown.js +3 -1
  66. package/dist/config/plugins/markdown.js.map +1 -1
  67. package/dist/config/plugins/mdx.js +3 -1
  68. package/dist/config/plugins/mdx.js.map +1 -1
  69. package/dist/config/plugins/no-extend-native.js +2 -0
  70. package/dist/config/plugins/no-extend-native.js.map +1 -1
  71. package/dist/config/plugins/no-loops.js +2 -0
  72. package/dist/config/plugins/no-loops.js.map +1 -1
  73. package/dist/config/plugins/no-secrets.js +3 -1
  74. package/dist/config/plugins/no-secrets.js.map +1 -1
  75. package/dist/config/plugins/no-unsanitized.js +2 -0
  76. package/dist/config/plugins/no-unsanitized.js.map +1 -1
  77. package/dist/config/plugins/node.js +2 -1
  78. package/dist/config/plugins/node.js.map +1 -1
  79. package/dist/config/plugins/playwright.js +2 -1
  80. package/dist/config/plugins/playwright.js.map +1 -1
  81. package/dist/config/plugins/promise.js +2 -0
  82. package/dist/config/plugins/promise.js.map +1 -1
  83. package/dist/config/plugins/react-hooks.js +3 -1
  84. package/dist/config/plugins/react-hooks.js.map +1 -1
  85. package/dist/config/plugins/react-redux.js +3 -1
  86. package/dist/config/plugins/react-redux.js.map +1 -1
  87. package/dist/config/plugins/react.js +10 -7
  88. package/dist/config/plugins/react.js.map +1 -1
  89. package/dist/config/plugins/regexp.js +3 -2
  90. package/dist/config/plugins/regexp.js.map +1 -1
  91. package/dist/config/plugins/security.js +4 -2
  92. package/dist/config/plugins/security.js.map +1 -1
  93. package/dist/config/plugins/simple-import-sort.js +3 -1
  94. package/dist/config/plugins/simple-import-sort.js.map +1 -1
  95. package/dist/config/plugins/sonarjs.js +3 -2
  96. package/dist/config/plugins/sonarjs.js.map +1 -1
  97. package/dist/config/plugins/sort-keys-fix.js +2 -0
  98. package/dist/config/plugins/sort-keys-fix.js.map +1 -1
  99. package/dist/config/plugins/storybook.js +3 -1
  100. package/dist/config/plugins/storybook.js.map +1 -1
  101. package/dist/config/plugins/tailwindcss.js +3 -2
  102. package/dist/config/plugins/tailwindcss.js.map +1 -1
  103. package/dist/config/plugins/tanstack-query.js +3 -2
  104. package/dist/config/plugins/tanstack-query.js.map +1 -1
  105. package/dist/config/plugins/testing-library.js +4 -3
  106. package/dist/config/plugins/testing-library.js.map +1 -1
  107. package/dist/config/plugins/toml.js +3 -1
  108. package/dist/config/plugins/toml.js.map +1 -1
  109. package/dist/config/plugins/tsdoc.js +3 -2
  110. package/dist/config/plugins/tsdoc.js.map +1 -1
  111. package/dist/config/plugins/typescript-sort-keys.js +2 -0
  112. package/dist/config/plugins/typescript-sort-keys.js.map +1 -1
  113. package/dist/config/plugins/typescript.js +9 -7
  114. package/dist/config/plugins/typescript.js.map +1 -1
  115. package/dist/config/plugins/unicorn.js +4 -3
  116. package/dist/config/plugins/unicorn.js.map +1 -1
  117. package/dist/config/plugins/vitest.js +3 -1
  118. package/dist/config/plugins/vitest.js.map +1 -1
  119. package/dist/config/plugins/yml.js +4 -3
  120. package/dist/config/plugins/yml.js.map +1 -1
  121. package/dist/config/plugins/you-dont-need-lodash-underscore.js +2 -0
  122. package/dist/config/plugins/you-dont-need-lodash-underscore.js.map +1 -1
  123. package/dist/config/plugins/you-dont-need-momentjs.js +2 -0
  124. package/dist/config/plugins/you-dont-need-momentjs.js.map +1 -1
  125. package/dist/config/plugins/zod.js +2 -0
  126. package/dist/config/plugins/zod.js.map +1 -1
  127. package/dist/config/style.js +4 -2
  128. package/dist/config/variables.js +3 -2
  129. package/dist/index.js +11 -10
  130. package/dist/index.js.map +1 -1
  131. package/dist/postinstall.js +6 -3
  132. package/dist/postinstall.js.map +1 -1
  133. package/dist/typescript-type-checking.js +4 -3
  134. package/dist/typescript-type-checking.js.map +1 -1
  135. package/package.json +13 -11
  136. package/dist/chunk-5S3UQ6WJ.js +0 -7
  137. package/dist/chunk-5S3UQ6WJ.js.map +0 -1
  138. package/dist/chunk-GGJONTGP.js +0 -7
  139. package/dist/chunk-GGJONTGP.js.map +0 -1
  140. package/dist/chunk-NE6XHV4I.js +0 -9
  141. package/dist/chunk-NE6XHV4I.js.map +0 -1
  142. package/dist/chunk-SV64EPVP.js.map +0 -1
  143. package/dist/chunk-UYUXBUWX.js.map +0 -1
  144. package/dist/chunk-XJPLKY3T.js +0 -9
  145. package/dist/chunk-XJPLKY3T.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,24 +1,25 @@
1
1
  'use strict';
2
2
 
3
- var chunkUYUXBUWX_js = require('./chunk-UYUXBUWX.js');
3
+ var chunkSEYYGHPU_js = require('./chunk-SEYYGHPU.js');
4
4
  var chunkPTQ3FFI5_js = require('./chunk-PTQ3FFI5.js');
5
+ require('./chunk-3NVDJZNH.js');
5
6
  require('@rushstack/eslint-patch/modern-module-resolution');
6
7
  var packageJsonUtils = require('@anolilab/package-json-utils');
7
8
  var path = require('path');
8
- var w = require('semver');
9
+ var j = require('semver');
9
10
 
10
11
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
12
 
12
- var w__default = /*#__PURE__*/_interopDefault(w);
13
+ var j__default = /*#__PURE__*/_interopDefault(j);
13
14
 
14
- var x=["best-practices","errors","style","es6","variables"],_=["compat","eslint-comments","import","promise","simple-import-sort","no-extend-native","node","no-secrets","sonarjs","security","regexp","jsonc","markdown","toml","yml","html","antfu","unicorn","es"],v=[{configName:"array-func",dependencies:["eslint-plugin-array-func"]},{configName:"jsdoc",dependencies:["eslint-plugin-jsdoc"]},{configName:"tsdoc",dependencies:["eslint-plugin-tsdoc","typescript"]},{configName:"lodash",dependencies:["lodash","eslint-plugin-lodash"]},{configName:"lodash-fp",dependencies:["lodash","eslint-plugin-lodash-fp"]},{configName:"you-dont-need-lodash-underscore",dependencies:["lodash","eslint-plugin-you-dont-need-lodash-underscore"]},{configName:"mdx",dependencies:["eslint-plugin-mdx"]},{configName:"no-unsanitized",dependencies:["eslint-plugin-no-unsanitized"]},{configName:"react",dependencies:["react","react-dom","eslint-plugin-react"]},{configName:"react-redux",dependencies:["eslint-plugin-react-redux"]},{configName:"jsx-a11y",dependencies:["react","react-dom","eslint-plugin-jsx-a11y"]},{configName:"react-hooks",dependencies:["react","react-dom","eslint-plugin-react-hooks"]},{configName:"you-dont-need-momentjs",dependencies:["moment","eslint-plugin-you-dont-need-momentjs"]},{configName:"you-dont-need-momentjs",dependencies:["moment-timezone","eslint-plugin-you-dont-need-momentjs"]},{configName:"tailwindcss",dependencies:["eslint-plugin-tailwindcss"]},{configName:"cypress",dependencies:["cypress","eslint-plugin-cypress"]},{configName:"jest",dependencies:["jest","eslint-plugin-jest"]},{configName:"jest-dom",dependencies:["jest","@testing-library/jest-dom","eslint-plugin-jest-dom"]},{configName:"jest-async",dependencies:["jest","eslint-plugin-jest-async"]},{configName:"jest-formatting",dependencies:["jest","eslint-plugin-jest-formatting"]},{configName:"tailwindcss",dependencies:["tailwindcss"]},{configName:"testing-library",dependencies:["@testing-library/dom","eslint-plugin-testing-library"]},{configName:"testing-library",dependencies:["react","@testing-library/react","eslint-plugin-testing-library"]},{configName:"typescript",dependencies:["typescript"]},{configName:"etc",dependencies:["typescript","eslint-plugin-etc"]},{configName:"typescript-sort-keys",dependencies:["typescript","eslint-plugin-typescript-sort-keys"]},{configName:"vitest",dependencies:["vitest","eslint-plugin-vitest"]},{configName:"zod",dependencies:["zod","eslint-plugin-zod"]},{configName:"ava",dependencies:["ava","eslint-plugin-ava"]},{configName:"storybook",dependencies:["storybook","eslint-plugin-storybook"]},{configName:"playwright",dependencies:["playwright","eslint-plugin-playwright"]},{configName:"tanstack-query",dependencies:["@tanstack/react-query","@tanstack/eslint-plugin-query"]}],m=[..._],f={};v.forEach(e=>{let{dependencies:n,configName:o}=e;if(chunkPTQ3FFI5_js.a?.plugin?.[o]!==!1){let r=[];n.forEach(s=>{(packageJsonUtils.hasDependency(s)||packageJsonUtils.hasDevDependency(s))&&r.push(s);}),r.length===n.length?m.push(o):(f[o]={},n.forEach(s=>{f[o][s]=packageJsonUtils.hasDependency(s)||packageJsonUtils.hasDevDependency(s);}));}});var u=x,l=m,y=f;var E={"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"}},b=E;if(!global.hasAnolilabEsLintConfigLoaded){process.env.DEBUG&&(chunkUYUXBUWX_js.b(`
15
+ var x=["best-practices","errors","style","es6","variables"],_=["compat","eslint-comments","import","promise","simple-import-sort","no-extend-native","node","no-secrets","sonarjs","security","regexp","jsonc","markdown","toml","yml","html","antfu","unicorn","es"],w=[{configName:"array-func",dependencies:["eslint-plugin-array-func"]},{configName:"jsdoc",dependencies:["eslint-plugin-jsdoc"]},{configName:"tsdoc",dependencies:["eslint-plugin-tsdoc","typescript"]},{configName:"lodash",dependencies:["lodash","eslint-plugin-lodash"]},{configName:"lodash-fp",dependencies:["lodash","eslint-plugin-lodash-fp"]},{configName:"you-dont-need-lodash-underscore",dependencies:["lodash","eslint-plugin-you-dont-need-lodash-underscore"]},{configName:"mdx",dependencies:["eslint-plugin-mdx"]},{configName:"no-unsanitized",dependencies:["eslint-plugin-no-unsanitized"]},{configName:"react",dependencies:["react","react-dom","eslint-plugin-react"]},{configName:"react-redux",dependencies:["eslint-plugin-react-redux"]},{configName:"jsx-a11y",dependencies:["react","react-dom","eslint-plugin-jsx-a11y"]},{configName:"react-hooks",dependencies:["react","react-dom","eslint-plugin-react-hooks"]},{configName:"you-dont-need-momentjs",dependencies:["moment","eslint-plugin-you-dont-need-momentjs"]},{configName:"you-dont-need-momentjs",dependencies:["moment-timezone","eslint-plugin-you-dont-need-momentjs"]},{configName:"tailwindcss",dependencies:["eslint-plugin-tailwindcss"]},{configName:"cypress",dependencies:["cypress","eslint-plugin-cypress"]},{configName:"jest",dependencies:["jest","eslint-plugin-jest"]},{configName:"jest-dom",dependencies:["jest","@testing-library/jest-dom","eslint-plugin-jest-dom"]},{configName:"jest-async",dependencies:["jest","eslint-plugin-jest-async"]},{configName:"jest-formatting",dependencies:["jest","eslint-plugin-jest-formatting"]},{configName:"tailwindcss",dependencies:["tailwindcss"]},{configName:"testing-library",dependencies:["@testing-library/dom","eslint-plugin-testing-library"]},{configName:"testing-library",dependencies:["react","@testing-library/react","eslint-plugin-testing-library"]},{configName:"typescript",dependencies:["typescript"]},{configName:"etc",dependencies:["typescript","eslint-plugin-etc"]},{configName:"typescript-sort-keys",dependencies:["typescript","eslint-plugin-typescript-sort-keys"]},{configName:"vitest",dependencies:["vitest","eslint-plugin-vitest"]},{configName:"zod",dependencies:["zod","eslint-plugin-zod"]},{configName:"ava",dependencies:["ava","eslint-plugin-ava"]},{configName:"storybook",dependencies:["storybook","eslint-plugin-storybook"]},{configName:"playwright",dependencies:["playwright","eslint-plugin-playwright"]},{configName:"tanstack-query",dependencies:["@tanstack/react-query","@tanstack/eslint-plugin-query"]}],g=[..._],a={};w.forEach(n=>{let{configName:e,dependencies:s}=n;if(chunkPTQ3FFI5_js.a?.plugin?.[e]!==!1){let r=[];s.forEach(i=>{(packageJsonUtils.hasDependency(i)||packageJsonUtils.hasDevDependency(i))&&r.push(i);}),r.length===s.length?g.push(e):(a[e]={},s.forEach(i=>{a[e][i]=packageJsonUtils.hasDependency(i)||packageJsonUtils.hasDevDependency(i);}));}});var m=x,l=g,u=a;var v={"n/prefer-global/text-decoder":{"11.0.0":"off"},"n/prefer-global/text-encoder":{"11.0.0":"off"},"n/prefer-global/url":{"10.0.0":"off"},"n/prefer-global/url-search-params":{"10.0.0":"off"},"n/prefer-promises/dns":{"11.14.0":"off"},"n/prefer-promises/fs":{"11.14.0":"off"},"no-useless-catch":{"10.0.0":"off"},"prefer-destructuring":{"6.0.0":"off"},"prefer-named-capture-group":{"10.0.0":"off"},"prefer-object-spread":{"8.3.0":"off"},"prefer-rest-params":{"6.0.0":"off"},"promise/prefer-await-to-then":{"7.6.0":"off"},"unicorn/no-new-buffer":{"5.10.0":"off"},"unicorn/prefer-flat-map":{"11.0.0":"off"},"unicorn/prefer-spread":{"5.0.0":"off"}},y=v;if(!global.hasAnolilabEsLintConfigLoaded){process.env.DEBUG&&(chunkSEYYGHPU_js.b(`
15
16
  @anolilab/eslint-config loaded the following plugins:
16
- `),chunkUYUXBUWX_js.b(" @rushstack/eslint-plugin-security"),["compat","eslint-comments","i","promise","simple-import-sort","unicorn","no-secrets","sonarjs","json","jsonc","markdown","toml","yml","es",...l].forEach(n=>chunkUYUXBUWX_js.a(n)));let e=!1;Object.entries(y).forEach(([n,o])=>{Object.values(o).some(Boolean)&&(e=!0,chunkUYUXBUWX_js.b(`
17
- Your package.json container dependencies for the "${n}" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`),Object.entries(o).forEach(([s,N])=>{N||chunkUYUXBUWX_js.b(` ${s}`);}));}),e&&(chunkUYUXBUWX_js.b(`
18
- To disable this message, add the following to your package.json:`),chunkUYUXBUWX_js.b(` "anolilab": { "eslint-config": { plugin: { "plugin-name": false } } }
19
- `)),chunkUYUXBUWX_js.b('To disable all logging, add the following to your eslint command call "NO_LOGS=true eslint ..."'),global.hasAnolilabEsLintConfigLoaded=!0;}var a={},c;packageJsonUtils.pkg?.engines?.node&&(c=packageJsonUtils.pkg.engines.node);Object.entries(b).forEach(([e,n])=>{Object.keys(n).sort(w__default.default.rcompare).forEach(o=>{c&&w__default.default.intersects(c,`<${o}`)&&(a[e]=n[o]);});});(packageJsonUtils.hasDependency("prettier")||packageJsonUtils.hasDevDependency("prettier"))&&(global.hasAnolilabEsLintConfigPrettier||(global.hasAnolilabEsLintConfigPrettier=!0,chunkPTQ3FFI5_js.a?.info_on_disabling_prettier_conflict_rule!==!1&&chunkUYUXBUWX_js.b(`
20
- Found prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier`)),a={...a,curly:0,"lines-around-comment":0,"max-len":0,"no-confusing-arrow":0,"no-mixed-operators":0,"no-tabs":0,"no-unexpected-multiline":0,quotes:0,"array-bracket-newline":"off","array-bracket-spacing":"off","array-element-newline":"off","arrow-parens":"off","arrow-spacing":"off","block-spacing":"off","brace-style":"off","comma-dangle":"off","comma-spacing":"off","comma-style":"off","computed-property-spacing":"off","dot-location":"off","eol-last":"off","func-call-spacing":"off","function-call-argument-newline":"off","function-paren-newline":"off","generator-star-spacing":"off","implicit-arrow-linebreak":"off",indent:"off","jsx-quotes":"off","key-spacing":"off","keyword-spacing":"off","linebreak-style":"off","multiline-ternary":"off","newline-per-chained-call":"off","new-parens":"off","no-extra-parens":"off","no-extra-semi":"off","no-floating-decimal":"off","no-mixed-spaces-and-tabs":"off","no-multi-spaces":"off","no-multiple-empty-lines":"off","no-trailing-spaces":"off","no-whitespace-before-property":"off","nonblock-statement-body-position":"off","object-curly-newline":"off","object-curly-spacing":"off","object-property-newline":"off","one-var-declaration-per-line":"off","operator-linebreak":"off","padded-blocks":"off","quote-props":"off","rest-spread-spacing":"off",semi:"off","semi-spacing":"off","semi-style":"off","space-before-blocks":"off","space-before-function-paren":"off","space-in-parens":"off","space-infix-ops":"off","space-unary-ops":"off","switch-colon-spacing":"off","template-curly-spacing":"off","template-tag-spacing":"off","unicode-bom":"off","wrap-iife":"off","wrap-regex":"off","yield-star-spacing":"off"});var P={root:!0,parser:"",extends:[...u.map(e=>path.join(__dirname,`./config/${e}.${packageJsonUtils.packageIsTypeModule?"m":""}js`)),...l.map(e=>path.join(__dirname,`./config/plugins/${e}.${packageJsonUtils.packageIsTypeModule?"m":""}js`))],rules:{...a},overrides:[{files:["**/migrations/*.{js,ts}"],rules:{"filenames/match-regex":"off"}},{files:["**/*.spec.{js,ts,tsx}","**/*.test.{js,ts,tsx}","**/__mocks__/*.{js,ts,tsx}","**/__tests__/*.{js,ts,tsx}","**/test/*.{js,ts,tsx}"],rules:{"no-magic-numbers":"off","sonarjs/no-duplicate-string":"off"}}],ignorePatterns:["!.*",".git/","node_modules/","bower_components/","jspm_packages/",".npm/","lib-cov/","coverage/",".nyc_output/",".cache/","build/","dist/","tmp/","**/*.min.*","*.d.ts","pnpm-lock.yaml"]},M=P;
17
+ `),chunkSEYYGHPU_js.b(" @rushstack/eslint-plugin-security"),["compat","eslint-comments","i","promise","simple-import-sort","unicorn","no-secrets","sonarjs","json","jsonc","markdown","toml","yml","es",...l].forEach(e=>chunkSEYYGHPU_js.a(e)));let n=!1;Object.entries(u).forEach(([e,s])=>{Object.values(s).some(Boolean)&&(n=!0,chunkSEYYGHPU_js.b(`
18
+ 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(s).forEach(([i,k])=>{k||chunkSEYYGHPU_js.b(` ${i}`);}));}),n&&(chunkSEYYGHPU_js.b(`
19
+ To disable this message, add the following to your package.json:`),chunkSEYYGHPU_js.b(` "anolilab": { "eslint-config": { plugin: { "plugin-name": false } } }
20
+ `)),chunkSEYYGHPU_js.b('To disable all logging, add the following to your eslint command call "NO_LOGS=true eslint ..."'),global.hasAnolilabEsLintConfigLoaded=!0;}var N={},c;packageJsonUtils.pkg?.engines?.node&&(c=packageJsonUtils.pkg.engines.node);Object.entries(y).forEach(([n,e])=>{Object.keys(e).sort(j__default.default.rcompare).forEach(s=>{c&&j__default.default.intersects(c,`<${s}`)&&(N[n]=e[s]);});});!global.hasAnolilabEsLintConfigPrettier&&(packageJsonUtils.hasDependency("prettier")||packageJsonUtils.hasDevDependency("prettier"))&&(global.hasAnolilabEsLintConfigPrettier=!0,chunkPTQ3FFI5_js.a?.info_on_disabling_prettier_conflict_rule!==!1&&chunkSEYYGHPU_js.b(`
21
+ Found prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier`));var R={extends:[...m.map(n=>path.join(__dirname,`./config/${n}.js`)),...l.map(n=>path.join(__dirname,`./config/plugins/${n}.js`))],ignorePatterns:["!.*",".git/","node_modules/","bower_components/","jspm_packages/",".npm/","lib-cov/","coverage/",".nyc_output/",".cache/","build/","dist/","tmp/","**/*.min.*","*.d.ts","pnpm-lock.yaml"],overrides:[{files:["**/migrations/*.{js,ts}"],rules:{"filenames/match-regex":"off"}},{files:["**/*.spec.{js,ts,tsx}","**/*.test.{js,ts,tsx}","**/__mocks__/*.{js,ts,tsx}","**/__tests__/*.{js,ts,tsx}","**/test/*.{js,ts,tsx}"],rules:{"no-magic-numbers":"off","sonarjs/no-duplicate-string":"off"}}],parser:"",root:!0,rules:{...N}},S=R;
21
22
 
22
- module.exports = M;
23
+ module.exports = S;
23
24
  //# sourceMappingURL=out.js.map
24
25
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/config.ts","../src/engine-node-overwrite.ts"],"names":["hasDependency","hasDevDependency","packageIsTypeModule","pkg","join","semver","baseConfig","internalPluginConfig","pluginConfig","loadedPlugins","possiblePlugins","plugin","dependencies","configName","eslint_config_default","foundDependencies","dependency","rules","pluginRules","possiblePluginRules","engineRules","engine_node_overwrite_default","consoleLog","consolePlugin","hasLogged","installed","configRules","nodeVersion","rule","ruleConfig","minVersion","config","src_default"],"mappings":"uFAYA,MAAO,mDAEP,OACI,iBAAAA,EAAe,oBAAAC,EAAkB,uBAAAC,EAAqB,OAAAC,MACnD,+BAEP,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAY,SCnBnB,OAAS,iBAAAL,EAAe,oBAAAC,MAAwB,+BAKhD,IAAMK,EAAa,CAAC,iBAAkB,SAAU,QAAS,MAAO,WAAW,EAErEC,EAAuB,CACzB,SACA,kBACA,SACA,UACA,qBACA,mBACA,OAEA,aACA,UACA,WACA,SAEA,QACA,WACA,OACA,MACA,OAGA,QACA,UACA,IACJ,EAEMC,EAA6B,CAC/B,CACI,WAAY,aACZ,aAAc,CAAC,0BAA0B,CAC7C,EACA,CACI,WAAY,QACZ,aAAc,CAAC,qBAAqB,CACxC,EACA,CACI,WAAY,Q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,UAAW,YAAYO,CAAM,IAAIT,EAAsB,IAAM,EAAE,IAAI,CAAC,EAElG,GAAGgB,EAAY,IAAKP,GAAWP,EAAK,UAAW,oBAAoBO,CAAM,IAAIT,EAAsB,IAAM,EAAE,IAAI,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,SAEA,gBACJ,CACJ,EAEOM,EAAQD","sourcesContent":["/**\n * rushstack eslint-patch is used to include plugins as dev\n * dependencies instead of imposing them as peer dependencies\n *\n * {@link https://www.npmjs.com/package/@rushstack/eslint-patch}\n * {@link https://stackoverflow.com/a/74478635/1392749}\n * {@link https://github.com/eslint/eslint/issues/3458}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-1/}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-2/}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-3/}\n * {@link https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new}\n */\nimport \"@rushstack/eslint-patch/modern-module-resolution\";\n\nimport {\n hasDependency, hasDevDependency, packageIsTypeModule, pkg,\n} 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 anolilabEslintConfig from \"./utils/eslint-config\";\nimport { consoleLog, consolePlugin } from \"./utils/loggers\";\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigLoaded) {\n if (process.env[\"DEBUG\"]) {\n consoleLog(\"\\n@anolilab/eslint-config loaded the following plugins:\\n\");\n\n consoleLog(\" @rushstack/eslint-plugin-security\");\n [\n \"compat\",\n \"eslint-comments\",\n \"i\",\n \"promise\",\n \"simple-import-sort\",\n \"unicorn\",\n \"no-secrets\",\n \"sonarjs\",\n \"json\",\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"es\",\n ...pluginRules,\n ].forEach((plugin) => consolePlugin(plugin));\n }\n\n let hasLogged = false;\n\n Object.entries(possiblePluginRules).forEach(([plugin, dependencies]) => {\n const hasOneDependency = Object.values(dependencies).some(Boolean);\n\n if (hasOneDependency) {\n hasLogged = true;\n consoleLog(\n `\\nYour package.json container dependencies for the \"${plugin}\" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`,\n );\n\n Object.entries(dependencies).forEach(([dependency, installed]) => {\n if (!installed) {\n consoleLog(` ${dependency}`);\n }\n });\n }\n });\n\n if (hasLogged) {\n consoleLog(\"\\nTo disable this message, add the following to your package.json:\");\n consoleLog(' \"anolilab\": { \"eslint-config\": { plugin: { \"plugin-name\": false } } }\\n');\n }\n\n consoleLog('To disable all logging, add the following to your eslint command call \"NO_LOGS=true eslint ...\"');\n\n global.hasAnolilabEsLintConfigLoaded = true;\n}\n\nlet configRules: Linter.RulesRecord = {};\nlet nodeVersion: string | undefined;\n\nif (pkg?.engines?.[\"node\"]) {\n nodeVersion = pkg.engines[\"node\"];\n}\n\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 (hasDependency(\"prettier\") || hasDevDependency(\"prettier\")) {\n // Workaround VS Code trying to run this file twice!\n if (!global.hasAnolilabEsLintConfigPrettier) {\n global.hasAnolilabEsLintConfigPrettier = true;\n\n if (anolilabEslintConfig?.[\"info_on_disabling_prettier_conflict_rule\"] !== false) {\n consoleLog(\"\\nFound prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier\");\n }\n }\n\n configRules = {\n ...configRules,\n\n // The following rules can be used in some cases. See the README for more\n // information. (These are marked with `0` instead of `\"off\"` so that a\n // script can distinguish them.)\n curly: 0,\n \"lines-around-comment\": 0,\n \"max-len\": 0,\n \"no-confusing-arrow\": 0,\n \"no-mixed-operators\": 0,\n \"no-tabs\": 0,\n \"no-unexpected-multiline\": 0,\n quotes: 0,\n\n // The rest are rules that you never need to enable when using Prettier.\n \"array-bracket-newline\": \"off\",\n \"array-bracket-spacing\": \"off\",\n \"array-element-newline\": \"off\",\n \"arrow-parens\": \"off\",\n \"arrow-spacing\": \"off\",\n \"block-spacing\": \"off\",\n \"brace-style\": \"off\",\n \"comma-dangle\": \"off\",\n \"comma-spacing\": \"off\",\n \"comma-style\": \"off\",\n \"computed-property-spacing\": \"off\",\n \"dot-location\": \"off\",\n \"eol-last\": \"off\",\n \"func-call-spacing\": \"off\",\n \"function-call-argument-newline\": \"off\",\n \"function-paren-newline\": \"off\",\n \"generator-star-spacing\": \"off\",\n \"implicit-arrow-linebreak\": \"off\",\n indent: \"off\",\n \"jsx-quotes\": \"off\",\n \"key-spacing\": \"off\",\n \"keyword-spacing\": \"off\",\n \"linebreak-style\": \"off\",\n \"multiline-ternary\": \"off\",\n \"newline-per-chained-call\": \"off\",\n \"new-parens\": \"off\",\n \"no-extra-parens\": \"off\",\n \"no-extra-semi\": \"off\",\n \"no-floating-decimal\": \"off\",\n \"no-mixed-spaces-and-tabs\": \"off\",\n \"no-multi-spaces\": \"off\",\n \"no-multiple-empty-lines\": \"off\",\n \"no-trailing-spaces\": \"off\",\n \"no-whitespace-before-property\": \"off\",\n \"nonblock-statement-body-position\": \"off\",\n \"object-curly-newline\": \"off\",\n \"object-curly-spacing\": \"off\",\n \"object-property-newline\": \"off\",\n \"one-var-declaration-per-line\": \"off\",\n \"operator-linebreak\": \"off\",\n \"padded-blocks\": \"off\",\n \"quote-props\": \"off\",\n \"rest-spread-spacing\": \"off\",\n semi: \"off\",\n \"semi-spacing\": \"off\",\n \"semi-style\": \"off\",\n \"space-before-blocks\": \"off\",\n \"space-before-function-paren\": \"off\",\n \"space-in-parens\": \"off\",\n \"space-infix-ops\": \"off\",\n \"space-unary-ops\": \"off\",\n \"switch-colon-spacing\": \"off\",\n \"template-curly-spacing\": \"off\",\n \"template-tag-spacing\": \"off\",\n \"unicode-bom\": \"off\",\n \"wrap-iife\": \"off\",\n \"wrap-regex\": \"off\",\n \"yield-star-spacing\": \"off\",\n };\n}\n\nconst config: Linter.Config = {\n // After an .eslintrc.js file is loaded, ESLint will normally continue visiting all parent folders\n // to look for other .eslintrc.js files, and also consult a personal file ~/.eslintrc.js. If any files\n // are found, their options will be merged. This is difficult for humans to understand, and it will cause\n // nondeterministic behavior if files are loaded from outside the Git working folder.\n //\n // Setting root=true causes ESLint to stop looking for other config files after the first .eslintrc.js\n // is loaded.\n root: true,\n // Disable the parser by default\n parser: \"\",\n\n extends: [\n ...rules.map((plugin) => join(__dirname, `./config/${plugin}.${packageIsTypeModule ? \"m\" : \"\"}js`)),\n\n ...pluginRules.map((plugin) => join(__dirname, `./config/plugins/${plugin}.${packageIsTypeModule ? \"m\" : \"\"}js`)),\n ],\n rules: {\n ...configRules,\n },\n overrides: [\n {\n files: [\"**/migrations/*.{js,ts}\"],\n rules: {\n \"filenames/match-regex\": \"off\",\n },\n },\n {\n files: [\n // Test files\n \"**/*.spec.{js,ts,tsx}\",\n \"**/*.test.{js,ts,tsx}\",\n\n // Facebook convention\n \"**/__mocks__/*.{js,ts,tsx}\",\n \"**/__tests__/*.{js,ts,tsx}\",\n\n // Microsoft convention\n \"**/test/*.{js,ts,tsx}\",\n ],\n rules: {\n \"no-magic-numbers\": \"off\",\n \"sonarjs/no-duplicate-string\": \"off\",\n },\n },\n ],\n ignorePatterns: [\n \"!.*\",\n\n \".git/\",\n \"node_modules/\",\n \"bower_components/\",\n \"jspm_packages/\",\n \".npm/\",\n\n \"lib-cov/\",\n \"coverage/\",\n \".nyc_output/\",\n \".cache/\",\n\n \"build/\",\n \"dist/\",\n \"tmp/\",\n\n \"**/*.min.*\",\n\n // Manually authored .d.ts files are generally used to describe external APIs that are not expected\n // to follow our coding conventions. Linting those files tends to produce a lot of spurious suppressions,\n // so we simply ignore them.\n \"*.d.ts\",\n\n \"pnpm-lock.yaml\",\n ],\n};\n\nexport default config;\n","import { hasDependency, hasDevDependency } from \"@anolilab/package-json-utils\";\n\nimport type { PackageRules } from \"./types\";\nimport anolilabEslintConfig from \"./utils/eslint-config\";\n\nconst baseConfig = [\"best-practices\", \"errors\", \"style\", \"es6\", \"variables\"];\n\nconst internalPluginConfig = [\n \"compat\",\n \"eslint-comments\",\n \"import\",\n \"promise\",\n \"simple-import-sort\",\n \"no-extend-native\",\n \"node\",\n // Security Rules\n \"no-secrets\",\n \"sonarjs\",\n \"security\",\n \"regexp\",\n // file rules\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"html\",\n\n // custom rules\n \"antfu\",\n \"unicorn\",\n \"es\",\n];\n\nconst pluginConfig: PackageRules = [\n {\n configName: \"array-func\",\n dependencies: [\"eslint-plugin-array-func\"],\n },\n {\n configName: \"jsdoc\",\n dependencies: [\"eslint-plugin-jsdoc\"],\n },\n {\n configName: \"tsdoc\",\n dependencies: [\"eslint-plugin-tsdoc\", \"typescript\"],\n },\n {\n configName: \"lodash\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash\"],\n },\n {\n configName: \"lodash-fp\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash-fp\"],\n },\n {\n configName: \"you-dont-need-lodash-underscore\",\n dependencies: [\"lodash\", \"eslint-plugin-you-dont-need-lodash-underscore\"],\n },\n {\n configName: \"mdx\",\n dependencies: [\"eslint-plugin-mdx\"],\n },\n {\n configName: \"no-unsanitized\",\n dependencies: [\"eslint-plugin-no-unsanitized\"],\n },\n {\n configName: \"react\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react\"],\n },\n {\n configName: \"react-redux\",\n dependencies: [\"eslint-plugin-react-redux\"],\n },\n {\n configName: \"jsx-a11y\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-jsx-a11y\"],\n },\n {\n configName: \"react-hooks\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react-hooks\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment-timezone\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"eslint-plugin-tailwindcss\"],\n },\n {\n configName: \"cypress\",\n dependencies: [\"cypress\", \"eslint-plugin-cypress\"],\n },\n {\n configName: \"jest\",\n dependencies: [\"jest\", \"eslint-plugin-jest\"],\n },\n {\n configName: \"jest-dom\",\n dependencies: [\"jest\", \"@testing-library/jest-dom\", \"eslint-plugin-jest-dom\"],\n },\n {\n configName: \"jest-async\",\n dependencies: [\"jest\", \"eslint-plugin-jest-async\"],\n },\n {\n configName: \"jest-formatting\",\n dependencies: [\"jest\", \"eslint-plugin-jest-formatting\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"tailwindcss\"],\n },\n {\n configName: \"testing-library\",\n dependencies: [\"@testing-library/dom\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"testing-library\",\n dependencies: [\"react\", \"@testing-library/react\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"typescript\",\n dependencies: [\"typescript\"],\n },\n {\n configName: \"etc\",\n dependencies: [\"typescript\", \"eslint-plugin-etc\"],\n },\n {\n configName: \"typescript-sort-keys\",\n dependencies: [\"typescript\", \"eslint-plugin-typescript-sort-keys\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\"],\n },\n {\n configName: \"zod\",\n dependencies: [\"zod\", \"eslint-plugin-zod\"],\n },\n {\n configName: \"ava\",\n dependencies: [\"ava\", \"eslint-plugin-ava\"],\n },\n {\n configName: \"storybook\",\n dependencies: [\"storybook\", \"eslint-plugin-storybook\"],\n },\n {\n configName: \"playwright\",\n dependencies: [\"playwright\", \"eslint-plugin-playwright\"],\n },\n {\n configName: \"tanstack-query\",\n dependencies: [\"@tanstack/react-query\", \"@tanstack/eslint-plugin-query\"],\n },\n];\n\nconst loadedPlugins: string[] = [...internalPluginConfig];\nconst possiblePlugins: { [rule: string]: { [packageName: string]: boolean } } = {};\n\npluginConfig.forEach((plugin) => {\n const { dependencies, configName } = plugin;\n\n if ((anolilabEslintConfig as unknown as { [key: string]: { [key: string]: false | undefined } })?.[\"plugin\"]?.[configName] !== false) {\n const foundDependencies = [];\n\n dependencies.forEach((dependency) => {\n if (hasDependency(dependency) || hasDevDependency(dependency)) {\n foundDependencies.push(dependency);\n }\n });\n\n if (foundDependencies.length === dependencies.length) {\n loadedPlugins.push(configName);\n } else {\n possiblePlugins[configName] = {};\n\n dependencies.forEach((dependency) => {\n (possiblePlugins[configName] as { [key: string]: boolean })[dependency] = hasDependency(dependency) || hasDevDependency(dependency);\n });\n }\n }\n});\n\nexport const rules = baseConfig;\nexport const pluginRules = loadedPlugins;\n\nexport const possiblePluginRules = possiblePlugins;\n","/**\nDefine the rules config that are overwritten only for specific version of Node.js based on `engines.node` in package.json or the `nodeVersion` option.\n\nThe keys are rule names and the values are an Object with a valid semver (`4.0.0` is valid `4` is not) as keys and the rule configuration as values.\n\nEach entry define the rule config and the maximum Node.js version for which to set it.\nThe entry with the lowest version that is compliant with the `engines.node`/`nodeVersion` range will be used.\n\n@type {Object}\n\n@example\n```\n{\n 'plugin/rule': {\n '6.0.0': ['error', {prop: 'node-6-conf'}],\n '8.0.0': ['error', {prop: 'node-8-conf'}]\n }\n}\n```\n\nWith `engines.node` set to `>=4` the rule `plugin/rule` will not be used.\nWith `engines.node` set to `>=6` the rule `plugin/rule` will be used with the config `{prop: 'node-6-conf'}`.\nWith `engines.node` set to `>=8` the rule `plugin/rule` will be used with the config `{prop: 'node-8-conf'}`.\n*/\nconst engineRules = {\n \"unicorn/prefer-spread\": {\n \"5.0.0\": \"off\",\n },\n \"unicorn/no-new-buffer\": {\n \"5.10.0\": \"off\",\n },\n \"prefer-rest-params\": {\n \"6.0.0\": \"off\",\n },\n \"prefer-destructuring\": {\n \"6.0.0\": \"off\",\n },\n \"promise/prefer-await-to-then\": {\n \"7.6.0\": \"off\",\n },\n \"prefer-object-spread\": {\n \"8.3.0\": \"off\",\n },\n \"n/prefer-global/url-search-params\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/url\": {\n \"10.0.0\": \"off\",\n },\n \"no-useless-catch\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-named-capture-group\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/text-encoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/text-decoder\": {\n \"11.0.0\": \"off\",\n },\n \"unicorn/prefer-flat-map\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-promises/dns\": {\n \"11.14.0\": \"off\",\n },\n \"n/prefer-promises/fs\": {\n \"11.14.0\": \"off\",\n },\n};\n\nexport default engineRules;\n"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/config.ts","../src/engine-node-overwrite.ts"],"names":["hasDependency","hasDevDependency","pkg","join","semver","baseConfig","internalPluginConfig","pluginConfig","loadedPlugins","possiblePlugins","plugin","configName","dependencies","eslint_config_default","foundDependencies","dependency","rules","pluginRules","possiblePluginRules","engineRules","engine_node_overwrite_default","consoleLog","consolePlugin","hasLogged","installed","configRules","nodeVersion","rule","ruleConfig","minVersion","config","src_default"],"mappings":"mHAYA,MAAO,mDAEP,OAAS,iBAAAA,EAAe,oBAAAC,EAAkB,OAAAC,MAAW,+BAErD,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAY,SCjBnB,OAA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;AAAA,CAA6E,GAG5FA,EAAW,iGAAiG,EAE5G,OAAO,8BAAgC,EAC3C,CAEA,IAAMI,EAAkC,CAAC,EACrCC,EAEAxB,GAAK,SAAU,OACfwB,EAAcxB,EAAI,QAAQ,MAG9B,OAAO,QAAQkB,CAAW,EAAE,QAAQ,CAAC,CAACO,EAAMC,CAAU,IAAM,CACxD,OAAO,KAAKA,CAAU,EACjB,KAAKxB,EAAO,QAAQ,EACpB,QAASyB,GAAe,CACjBH,GAAetB,EAAO,WAAWsB,EAAa,IAAIG,CAAU,EAAE,IAE9DJ,EAAYE,CAAI,EAAIC,EAAWC,CAAqC,EAE5E,CAAC,CACT,CAAC,EAGG,CAAC,OAAO,kCAAoC7B,EAAc,UAAU,GAAKC,EAAiB,UAAU,KACpG,OAAO,gCAAkC,GAErCY,GAAuB,2CAAgD,IACvEQ,EAAW;AAAA,8GAAiH,GAIpI,IAAMS,EAAwB,CAO1B,QAAS,CACL,GAAGd,EAAM,IAAKN,GAAWP,EAAK,UAAW,YAAYO,CAAM,KAAK,CAAC,EAEjE,GAAGO,EAAY,IAAKP,GAAWP,EAAK,UAAW,oBAAoBO,CAAM,KAAK,CAAC,CACnF,EACA,eAAgB,CACZ,MAEA,QACA,gBACA,oBACA,iBACA,QAEA,WACA,YACA,eACA,UAEA,SACA,QACA,OAEA,aAKA,SAEA,gBACJ,EAEA,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,EAEA,OAAQ,GAER,KAAM,GACN,MAAO,CACH,GAAGe,CACP,CACJ,EAEOM,EAAQD","sourcesContent":["/**\n * rushstack eslint-patch is used to include plugins as dev\n * dependencies instead of imposing them as peer dependencies\n *\n * {@link https://www.npmjs.com/package/@rushstack/eslint-patch}\n * {@link https://stackoverflow.com/a/74478635/1392749}\n * {@link https://github.com/eslint/eslint/issues/3458}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-1/}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-2/}\n * {@link https://eslint.org/blog/2022/08/new-config-system-part-3/}\n * {@link https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new}\n */\nimport \"@rushstack/eslint-patch/modern-module-resolution\";\n\nimport { hasDependency, hasDevDependency, 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 anolilabEslintConfig from \"./utils/eslint-config\";\nimport { consoleLog, consolePlugin } from \"./utils/loggers\";\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigLoaded) {\n if (process.env[\"DEBUG\"]) {\n consoleLog(\"\\n@anolilab/eslint-config loaded the following plugins:\\n\");\n\n consoleLog(\" @rushstack/eslint-plugin-security\");\n [\n \"compat\",\n \"eslint-comments\",\n \"i\",\n \"promise\",\n \"simple-import-sort\",\n \"unicorn\",\n \"no-secrets\",\n \"sonarjs\",\n \"json\",\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"es\",\n ...pluginRules,\n ].forEach((plugin) => consolePlugin(plugin));\n }\n\n let hasLogged = false;\n\n Object.entries(possiblePluginRules).forEach(([plugin, dependencies]) => {\n const hasOneDependency = Object.values(dependencies).some(Boolean);\n\n if (hasOneDependency) {\n hasLogged = true;\n consoleLog(\n `\\nYour package.json container dependencies for the \"${plugin}\" eslint-plugin, please add the following dependencies with your chosen package manager to enable this plugin:`,\n );\n\n Object.entries(dependencies).forEach(([dependency, installed]) => {\n if (!installed) {\n consoleLog(` ${dependency}`);\n }\n });\n }\n });\n\n if (hasLogged) {\n consoleLog(\"\\nTo disable this message, add the following to your package.json:\");\n consoleLog(' \"anolilab\": { \"eslint-config\": { plugin: { \"plugin-name\": false } } }\\n');\n }\n\n consoleLog('To disable all logging, add the following to your eslint command call \"NO_LOGS=true eslint ...\"');\n\n global.hasAnolilabEsLintConfigLoaded = true;\n}\n\nconst configRules: Linter.RulesRecord = {};\nlet nodeVersion: string | undefined;\n\nif (pkg?.engines?.[\"node\"]) {\n nodeVersion = pkg.engines[\"node\"];\n}\n\nObject.entries(engineRules).forEach(([rule, ruleConfig]) => {\n Object.keys(ruleConfig)\n .sort(semver.rcompare)\n .forEach((minVersion) => {\n if (nodeVersion && semver.intersects(nodeVersion, `<${minVersion}`)) {\n // eslint-disable-next-line security/detect-object-injection\n configRules[rule] = ruleConfig[minVersion as keyof typeof ruleConfig] as Linter.RuleEntry;\n }\n });\n});\n\n// Workaround VS Code trying to run this file twice!\nif (!global.hasAnolilabEsLintConfigPrettier && (hasDependency(\"prettier\") || hasDevDependency(\"prettier\"))) {\n global.hasAnolilabEsLintConfigPrettier = true;\n\n if (anolilabEslintConfig?.[\"info_on_disabling_prettier_conflict_rule\"] !== false) {\n consoleLog(\"\\nFound prettier as dependency, disabling some rules to fix wrong behavior of the rule with eslint and prettier\");\n }\n}\n\nconst config: Linter.Config = {\n // After an .eslintrc.js file is loaded, ESLint will normally continue visiting all parent folders\n // to look for other .eslintrc.js files, and also consult a personal file ~/.eslintrc.js. If any files\n // are found, their options will be merged. This is difficult for humans to understand, and it will cause\n // nondeterministic behavior if files are loaded from outside the Git working folder.\n //\n // Setting root=true causes ESLint to stop looking for other config files after the first .eslintrc.js\n extends: [\n ...rules.map((plugin) => join(__dirname, `./config/${plugin}.js`)),\n\n ...pluginRules.map((plugin) => join(__dirname, `./config/plugins/${plugin}.js`)),\n ],\n ignorePatterns: [\n \"!.*\",\n\n \".git/\",\n \"node_modules/\",\n \"bower_components/\",\n \"jspm_packages/\",\n \".npm/\",\n\n \"lib-cov/\",\n \"coverage/\",\n \".nyc_output/\",\n \".cache/\",\n\n \"build/\",\n \"dist/\",\n \"tmp/\",\n\n \"**/*.min.*\",\n\n // Manually authored .d.ts files are generally used to describe external APIs that are not expected\n // to follow our coding conventions. Linting those files tends to produce a lot of spurious suppressions,\n // so we simply ignore them.\n \"*.d.ts\",\n\n \"pnpm-lock.yaml\",\n ],\n\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 // Disable the parser by default\n parser: \"\",\n // is loaded.\n root: true,\n rules: {\n ...configRules,\n },\n};\n\nexport default config;\n","import { hasDependency, hasDevDependency } from \"@anolilab/package-json-utils\";\n\nimport type { PackageRules } from \"./types\";\nimport anolilabEslintConfig from \"./utils/eslint-config\";\n\nconst baseConfig = [\"best-practices\", \"errors\", \"style\", \"es6\", \"variables\"];\n\nconst internalPluginConfig = [\n \"compat\",\n \"eslint-comments\",\n \"import\",\n \"promise\",\n \"simple-import-sort\",\n \"no-extend-native\",\n \"node\",\n // Security Rules\n \"no-secrets\",\n \"sonarjs\",\n \"security\",\n \"regexp\",\n // file rules\n \"jsonc\",\n \"markdown\",\n \"toml\",\n \"yml\",\n \"html\",\n\n // custom rules\n \"antfu\",\n \"unicorn\",\n \"es\",\n];\n\nconst pluginConfig: PackageRules = [\n {\n configName: \"array-func\",\n dependencies: [\"eslint-plugin-array-func\"],\n },\n {\n configName: \"jsdoc\",\n dependencies: [\"eslint-plugin-jsdoc\"],\n },\n {\n configName: \"tsdoc\",\n dependencies: [\"eslint-plugin-tsdoc\", \"typescript\"],\n },\n {\n configName: \"lodash\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash\"],\n },\n {\n configName: \"lodash-fp\",\n dependencies: [\"lodash\", \"eslint-plugin-lodash-fp\"],\n },\n {\n configName: \"you-dont-need-lodash-underscore\",\n dependencies: [\"lodash\", \"eslint-plugin-you-dont-need-lodash-underscore\"],\n },\n {\n configName: \"mdx\",\n dependencies: [\"eslint-plugin-mdx\"],\n },\n {\n configName: \"no-unsanitized\",\n dependencies: [\"eslint-plugin-no-unsanitized\"],\n },\n {\n configName: \"react\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react\"],\n },\n {\n configName: \"react-redux\",\n dependencies: [\"eslint-plugin-react-redux\"],\n },\n {\n configName: \"jsx-a11y\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-jsx-a11y\"],\n },\n {\n configName: \"react-hooks\",\n dependencies: [\"react\", \"react-dom\", \"eslint-plugin-react-hooks\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"you-dont-need-momentjs\",\n dependencies: [\"moment-timezone\", \"eslint-plugin-you-dont-need-momentjs\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"eslint-plugin-tailwindcss\"],\n },\n {\n configName: \"cypress\",\n dependencies: [\"cypress\", \"eslint-plugin-cypress\"],\n },\n {\n configName: \"jest\",\n dependencies: [\"jest\", \"eslint-plugin-jest\"],\n },\n {\n configName: \"jest-dom\",\n dependencies: [\"jest\", \"@testing-library/jest-dom\", \"eslint-plugin-jest-dom\"],\n },\n {\n configName: \"jest-async\",\n dependencies: [\"jest\", \"eslint-plugin-jest-async\"],\n },\n {\n configName: \"jest-formatting\",\n dependencies: [\"jest\", \"eslint-plugin-jest-formatting\"],\n },\n {\n configName: \"tailwindcss\",\n dependencies: [\"tailwindcss\"],\n },\n {\n configName: \"testing-library\",\n dependencies: [\"@testing-library/dom\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"testing-library\",\n dependencies: [\"react\", \"@testing-library/react\", \"eslint-plugin-testing-library\"],\n },\n {\n configName: \"typescript\",\n dependencies: [\"typescript\"],\n },\n {\n configName: \"etc\",\n dependencies: [\"typescript\", \"eslint-plugin-etc\"],\n },\n {\n configName: \"typescript-sort-keys\",\n dependencies: [\"typescript\", \"eslint-plugin-typescript-sort-keys\"],\n },\n {\n configName: \"vitest\",\n dependencies: [\"vitest\", \"eslint-plugin-vitest\"],\n },\n {\n configName: \"zod\",\n dependencies: [\"zod\", \"eslint-plugin-zod\"],\n },\n {\n configName: \"ava\",\n dependencies: [\"ava\", \"eslint-plugin-ava\"],\n },\n {\n configName: \"storybook\",\n dependencies: [\"storybook\", \"eslint-plugin-storybook\"],\n },\n {\n configName: \"playwright\",\n dependencies: [\"playwright\", \"eslint-plugin-playwright\"],\n },\n {\n configName: \"tanstack-query\",\n dependencies: [\"@tanstack/react-query\", \"@tanstack/eslint-plugin-query\"],\n },\n];\n\nconst loadedPlugins: string[] = [...internalPluginConfig];\nconst possiblePlugins: { [rule: string]: { [packageName: string]: boolean } } = {};\n\npluginConfig.forEach((plugin) => {\n const { configName, dependencies } = plugin;\n\n // eslint-disable-next-line security/detect-object-injection\n if ((anolilabEslintConfig as unknown as { [key: string]: { [key: string]: false | undefined } })?.[\"plugin\"]?.[configName] !== false) {\n const foundDependencies = [];\n\n dependencies.forEach((dependency) => {\n if (hasDependency(dependency) || hasDevDependency(dependency)) {\n foundDependencies.push(dependency);\n }\n });\n\n if (foundDependencies.length === dependencies.length) {\n loadedPlugins.push(configName);\n } else {\n // eslint-disable-next-line security/detect-object-injection\n possiblePlugins[configName] = {};\n\n dependencies.forEach((dependency) => {\n // eslint-disable-next-line security/detect-object-injection\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 \"n/prefer-global/text-decoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/text-encoder\": {\n \"11.0.0\": \"off\",\n },\n \"n/prefer-global/url\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-global/url-search-params\": {\n \"10.0.0\": \"off\",\n },\n \"n/prefer-promises/dns\": {\n \"11.14.0\": \"off\",\n },\n \"n/prefer-promises/fs\": {\n \"11.14.0\": \"off\",\n },\n \"no-useless-catch\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-destructuring\": {\n \"6.0.0\": \"off\",\n },\n \"prefer-named-capture-group\": {\n \"10.0.0\": \"off\",\n },\n \"prefer-object-spread\": {\n \"8.3.0\": \"off\",\n },\n \"prefer-rest-params\": {\n \"6.0.0\": \"off\",\n },\n \"promise/prefer-await-to-then\": {\n \"7.6.0\": \"off\",\n },\n \"unicorn/no-new-buffer\": {\n \"5.10.0\": \"off\",\n },\n \"unicorn/prefer-flat-map\": {\n \"11.0.0\": \"off\",\n },\n \"unicorn/prefer-spread\": {\n \"5.0.0\": \"off\",\n },\n};\n\nexport default engineRules;\n"]}
@@ -1,12 +1,13 @@
1
1
  'use strict';
2
2
 
3
+ var chunk3NVDJZNH_js = require('./chunk-3NVDJZNH.js');
3
4
  var packageJsonUtils = require('@anolilab/package-json-utils');
4
5
  var fs = require('fs');
5
6
  var path = require('path');
6
7
  var util = require('util');
7
8
 
8
- process.env.CI&&process.exit(0);var f=util.promisify(fs.writeFile);console.log("Configuring @anolilab/eslint-config",packageJsonUtils.projectPath,`
9
- `);var s=".eslintrc",d=()=>{for(let o of [s,`${s}.js`,`${s}.cjs`,`${s}.json`,`${s}.yaml`,`${s}.yml`])if(fs.existsSync(path.join(packageJsonUtils.projectPath,o)))return console.warn(`\u26A0\uFE0F ${o} already exists;
9
+ var j=chunk3NVDJZNH_js.a(()=>{process.env.CI&&process.exit(0);var f=util.promisify(fs.writeFile);console.log("Configuring @anolilab/eslint-config",packageJsonUtils.projectPath,`
10
+ `);var s=".eslintrc",w=()=>{for(let o of [s,`${s}.js`,`${s}.cjs`,`${s}.json`,`${s}.yaml`,`${s}.yml`])if(fs.existsSync(path.join(packageJsonUtils.projectPath,o)))return console.warn(`\u26A0\uFE0F ${o} already exists;
10
11
  Make sure that it includes the following for @anolilab/eslint-config'
11
12
  to work as it should: { extends: ["@anolilab/eslint-config"] }.`),Promise.resolve();let t=path.join(packageJsonUtils.projectPath,`.eslintrc.${packageJsonUtils.packageIsTypeModule?"c":""}js`),a="",c=`
12
13
  parserOptions: {
@@ -60,6 +61,8 @@ module.exports = {
60
61
  },
61
62
  ],
62
63
  };
63
- `;return f(t,m,"utf8")},w=()=>{let t=path.join(packageJsonUtils.projectPath,".eslintignore");return fs.existsSync(t)?(console.warn("\u26A0\uFE0F .eslintignore already exists"),Promise.resolve()):f(t,"","utf8")};(async()=>{try{await Promise.all([d(),w()]),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(t){console.log("\u{1F62C} something went wrong:"),console.error(t),process.exit(1);}})();
64
+ `;return f(t,m,"utf8")},y=()=>{let t=path.join(packageJsonUtils.projectPath,".eslintignore");return fs.existsSync(t)?(console.warn("\u26A0\uFE0F .eslintignore already exists"),Promise.resolve()):f(t,"","utf8")};(async()=>{try{await Promise.all([w(),y()]),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(t){console.log("\u{1F62C} something went wrong:"),console.error(t),process.exit(1);}})();});var postinstall = j();
65
+
66
+ module.exports = postinstall;
64
67
  //# sourceMappingURL=out.js.map
65
68
  //# sourceMappingURL=postinstall.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","projectPath","existsSync","readFileSync","writeFile","join","promisify","writeFileAsync","configFile","writeEslintRc","filename","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,OAGtB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUF,CAAS,EAE1C,QAAQ,IAAI,sCAAuCH,EAAa;AAAA,CAAI,EAEpE,IAAMO,EAAa,YAMbC,EAAgB,IAAM,CAExB,QAAWC,IAAY,CAACF,EAAY,GAAGA,CAAU,MAAO,GAAGA,CAAU,OAAQ,GAAGA,CAAU,QAAS,GAAGA,CAAU,QAAS,GAAGA,CAAU,MAAM,EACxI,GAAIN,EAAWG,EAAKJ,EAAaS,CAAQ,CAAC,EACtC,eAAQ,KAAK,iBAAOA,CAAQ;AAAA;AAAA,gEAEwB,EAE7C,QAAQ,QAAQ,EAI/B,IAAMC,EAAaN,EAAKJ,EAAa,aAAaD,EAAsB,IAAM,EAAE,IAAI,EAEhFY,EAAgB,GAChBC,EAAgB;AAAA;AAAA;AAAA,sBAGFb,EAAsB,WAAa,YAAY;AAAA,QAG3Dc,EAAeT,EAAKJ,EAAa,eAAe,EAEtD,GAAIC,EAAWY,CAAY,EAAG,CAC1B,IAAMC,EA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AG","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\nconst configFile = \".eslintrc\";\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 // eslint-disable-next-line no-restricted-syntax\n for (const filename of [configFile, `${configFile}.js`, `${configFile}.cjs`, `${configFile}.json`, `${configFile}.yaml`, `${configFile}.yml`]) {\n if (existsSync(join(projectPath, filename))) {\n console.warn(`⚠️ ${filename} already exists;\nMake sure that it includes the following for @anolilab/eslint-config'\nto work as it should: { extends: [\"@anolilab/eslint-config\"] }.`);\n\n return Promise.resolve();\n }\n }\n\n const eslintPath = join(projectPath, `.eslintrc.${packageIsTypeModule ? \"c\" : \"\"}js`);\n\n let pluginExtends = \"\";\n let parserOptions = `\n parserOptions: {\n ecmaVersion: \"latest\",\n sourceType: ${packageIsTypeModule ? '\"module\"' : '\"commonjs\"'},\n },`;\n\n const tsconfigPath = join(projectPath, \"tsconfig.json\");\n\n 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 !== \"6\") {\n pluginExtends = `, \"plugin:es-x/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} */\nmodule.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 return writeFileAsync(eslintPath, content, \"utf8\");\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, \"\", \"utf8\");\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"]}
1
+ {"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","projectPath","existsSync","readFileSync","writeFile","join","promisify","require_postinstall","__commonJSMin","writeFileAsync","configFile","writeEslintRc","filename","eslintPath","pluginExtends","parserOptions","tsconfigPath","tsConfig","ecmaVersion","content","writeEslintIgnore","eslintIgnorePath","error"],"mappings":"wCAAA,OAAS,uBAAAA,EAAqB,eAAAC,MAAmB,+BACjD,OAAS,cAAAC,EAAY,gBAAAC,EAAc,aAAAC,MAAiB,KACpD,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAH1B,IAAAC,EAAAC,EAAA,KAMI,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBH,EAAUF,CAAS,EAE1C,QAAQ,IAAI,sCAAuCH,EAAa;AAAA,CAAI,EAEpE,IAAMS,EAAa,YAMbC,EAAgB,IAAM,CAExB,QAAWC,IAAY,CAACF,EAAY,GAAGA,CAAU,MAAO,GAAGA,CAAU,OAAQ,GAAGA,CAAU,QAAS,GAAGA,CAAU,QAAS,GAAGA,CAAU,MAAM,EAExI,GAAIR,EAAWG,EAAKJ,EAAaW,CAAQ,CAAC,EACtC,eAAQ,KAAK,iBAAOA,CAAQ;AAAA;AAAA,gEAEwB,EAE7C,QAAQ,QAAQ,EAI/B,IAAMC,EAAaR,EAAKJ,EAAa,aAAaD,EAAsB,IAAM,EAAE,IAAI,EAEhFc,EAAgB,GAChBC,EAAgB;AAAA;AAAA;AAAA,sBAGFf,EAAsB,WAAa,YAAY;AAAA,QAG3DgB,EAAeX,EAAKJ,EAAa,eAAe,EAGtD,GAAIC,EAAWc,CAAY,EAAG,CAE1B,IAAMC,EAAW,KAAK,MAAMd,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IsTypeModule, 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\nconst configFile = \".eslintrc\";\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 // eslint-disable-next-line no-restricted-syntax\n for (const filename of [configFile, `${configFile}.js`, `${configFile}.cjs`, `${configFile}.json`, `${configFile}.yaml`, `${configFile}.yml`]) {\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(join(projectPath, filename))) {\n console.warn(`⚠️ ${filename} already exists;\nMake sure that it includes the following for @anolilab/eslint-config'\nto work as it should: { extends: [\"@anolilab/eslint-config\"] }.`);\n\n return Promise.resolve();\n }\n }\n\n const eslintPath = join(projectPath, `.eslintrc.${packageIsTypeModule ? \"c\" : \"\"}js`);\n\n let pluginExtends = \"\";\n let parserOptions = `\n parserOptions: {\n ecmaVersion: \"latest\",\n sourceType: ${packageIsTypeModule ? '\"module\"' : '\"commonjs\"'},\n },`;\n\n const tsconfigPath = join(projectPath, \"tsconfig.json\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(tsconfigPath)) {\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n const tsConfig = JSON.parse(readFileSync(tsconfigPath, \"utf8\")) as TsConfigJson;\n\n let ecmaVersion = \"latest\";\n\n if (tsConfig.compilerOptions?.target) {\n ecmaVersion = tsConfig.compilerOptions.target;\n\n ecmaVersion =\n ecmaVersion.toLowerCase() === \"es2022\" || ecmaVersion.toLowerCase() === \"esnext\" ? \"latest\" : ecmaVersion.toLowerCase().replace(\"es\", \"\");\n\n if (ecmaVersion !== \"latest\" && ecmaVersion !== \"2022\" && ecmaVersion !== \"2021\" && ecmaVersion !== \"6\") {\n pluginExtends = `, \"plugin:es-x/restrict-to-es${ecmaVersion}\"`;\n }\n }\n\n parserOptions = `\n parserOptions: {\n project: \"./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} */\nmodule.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 return writeFileAsync(eslintPath, content, \"utf8\");\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 // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(eslintIgnorePath)) {\n console.warn(\"⚠️ .eslintignore already exists\");\n\n return Promise.resolve();\n }\n\n return writeFileAsync(eslintIgnorePath, \"\", \"utf8\");\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"]}
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunk5S3UQ6WJ_js = require('./chunk-5S3UQ6WJ.js');
4
- var chunkU5H7JNHH_js = require('./chunk-U5H7JNHH.js');
3
+ var chunkMQFZFF2T_js = require('./chunk-MQFZFF2T.js');
4
+ var chunkVW5ZVT2B_js = require('./chunk-VW5ZVT2B.js');
5
+ require('./chunk-3NVDJZNH.js');
5
6
 
6
- var e=chunk5S3UQ6WJ_js.a.rules,i=chunkU5H7JNHH_js.a("typescript",{rules:{"@typescript-eslint/await-thenable":"error","@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!0}],"dot-notation":"off","@typescript-eslint/dot-notation":["error",{allowKeywords:!0}],"@typescript-eslint/no-base-to-string":["error",{ignoredTypeNames:["RegExp"]}],"@typescript-eslint/no-confusing-void-expression":["error",{ignoreArrowShorthand:!0,ignoreVoidOperator:!1}],"@typescript-eslint/no-floating-promises":["error",{ignoreIIFE:!0,ignoreVoid:!0}],"@typescript-eslint/no-for-in-array":"error","no-throw-literal":"off","@typescript-eslint/no-throw-literal":e["no-throw-literal"],"no-implied-eval":"off","no-new-func":"off","@typescript-eslint/no-implied-eval":e["no-implied-eval"],"@typescript-eslint/no-meaningless-void-operator":["error",{checkNever:!0}],"@typescript-eslint/no-misused-promises":["error",{checksConditionals:!0,checksVoidReturn:{arguments:!0,attributes:!1,properties:!0,returns:!0,variables:!0}}],"@typescript-eslint/no-unnecessary-type-assertion":"off","@typescript-eslint/prefer-includes":"error","@typescript-eslint/prefer-nullish-coalescing":["error",{ignoreConditionalTests:!0,ignoreMixedLogicalExpressions:!0}],"@typescript-eslint/prefer-regexp-exec":"error","@typescript-eslint/prefer-return-this-type":"error","@typescript-eslint/prefer-string-starts-ends-with":"error","require-await":"off","@typescript-eslint/require-await":e["require-await"],"@typescript-eslint/promise-function-async":"error","@typescript-eslint/unbound-method":["error",{ignoreStatic:!1}],"@typescript-eslint/require-array-sort-compare":["error",{ignoreStringArrays:!1}],"@typescript-eslint/return-await":["error","always"],"@typescript-eslint/switch-exhaustiveness-check":"error","@typescript-eslint/no-unnecessary-qualifier":"error","@typescript-eslint/restrict-plus-operands":"error","@typescript-eslint/no-unnecessary-condition":"error","@typescript-eslint/no-unnecessary-type-arguments":"error","@typescript-eslint/prefer-readonly":["error",{onlyInlineLambdas:!1}],"@typescript-eslint/prefer-reduce-type-parameter":"error"}}),o=i;
7
+ var e=chunkMQFZFF2T_js.a.rules,i=chunkVW5ZVT2B_js.a("typescript",{rules:{"@typescript-eslint/await-thenable":"error","@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!0}],"@typescript-eslint/dot-notation":["error",{allowKeywords:!0}],"@typescript-eslint/no-base-to-string":["error",{ignoredTypeNames:["RegExp"]}],"@typescript-eslint/no-confusing-void-expression":["error",{ignoreArrowShorthand:!0,ignoreVoidOperator:!1}],"@typescript-eslint/no-floating-promises":["error",{ignoreIIFE:!0,ignoreVoid:!0}],"@typescript-eslint/no-for-in-array":"error","@typescript-eslint/no-implied-eval":e["no-implied-eval"],"@typescript-eslint/no-meaningless-void-operator":["error",{checkNever:!0}],"@typescript-eslint/no-misused-promises":["error",{checksConditionals:!0,checksVoidReturn:{arguments:!0,attributes:!1,properties:!0,returns:!0,variables:!0}}],"@typescript-eslint/no-throw-literal":e["no-throw-literal"],"@typescript-eslint/no-unnecessary-condition":"error","@typescript-eslint/no-unnecessary-qualifier":"error","@typescript-eslint/no-unnecessary-type-arguments":"error","@typescript-eslint/no-unnecessary-type-assertion":"off","@typescript-eslint/prefer-includes":"error","@typescript-eslint/prefer-nullish-coalescing":["error",{ignoreConditionalTests:!0,ignoreMixedLogicalExpressions:!0}],"@typescript-eslint/prefer-readonly":["error",{onlyInlineLambdas:!1}],"@typescript-eslint/prefer-reduce-type-parameter":"error","@typescript-eslint/prefer-regexp-exec":"error","@typescript-eslint/prefer-return-this-type":"error","@typescript-eslint/prefer-string-starts-ends-with":"error","@typescript-eslint/promise-function-async":"error","@typescript-eslint/require-array-sort-compare":["error",{ignoreStringArrays:!1}],"@typescript-eslint/require-await":e["require-await"],"@typescript-eslint/restrict-plus-operands":"error","@typescript-eslint/return-await":["error","always"],"@typescript-eslint/switch-exhaustiveness-check":"error","@typescript-eslint/unbound-method":["error",{ignoreStatic:!1}],"dot-notation":"off","no-implied-eval":"off","no-new-func":"off","no-throw-literal":"off","require-await":"off"}}),o=i;
7
8
 
8
9
  module.exports = o;
9
10
  //# sourceMappingURL=out.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/typescript-type-checking.ts"],"names":["bestPracticesRules","best_practices_default","config","createConfig","typescript_type_checking_default"],"mappings":"gFAKA,IAAMA,EAAqBC,EAAoB,MAEzCC,EAASC,EAAa,aAAc,CACtC,MAAO,CAEH,oCAAqC,QAErC,6CAA8C,CAC1C,QACA,CACI,uCAAwC,EAC5C,CACJ,EAIA,eAAgB,MAChB,kCAAmC,CAAC,QAAS,CAAE,cAAe,EAAK,CAAC,EAGpE,uCAAwC,CACpC,QACA,CACI,iBAAkB,CAAC,QAAQ,CAC/B,CACJ,EAGA,kDAAmD,CAC/C,QACA,CACI,qBAAsB,GACtB,mBAAoB,EACxB,CACJ,EAGA,0CAA2C,CACvC,QACA,CACI,WAAY,GACZ,WAAY,EAChB,CACJ,EAGA,qCAAsC,QAItC,mBAAoB,MACpB,sCAAuCH,EAAmB,kBAAkB,EAI5E,kBAAmB,MACnB,cAAe,MACf,qCAAsCA,EAAmB,iBAAiB,EAI1E,kDAAmD,CAAC,QAAS,CAAE,WAAY,EAAK,CAAC,EAIjF,yCAA0C,CACtC,QACA,CACI,mBAAoB,GACpB,iBAAkB,CACd,UAAW,GACX,WAAY,GACZ,WAAY,GACZ,QAAS,GACT,UAAW,EACf,CACJ,CACJ,EAIA,mDAAoD,MAIpD,qCAAsC,QAGtC,+CAAgD,CAC5C,QACA,CACI,uBAAwB,GACxB,8BAA+B,EACnC,CACJ,EAIA,wCAAyC,QAIzC,6CAA8C,QAI9C,oDAAqD,QAIrD,gBAAiB,MACjB,mCAAoCA,EAAmB,eAAe,EAGtE,4CAA6C,QAG7C,oCAAqC,CAAC,QAAS,CAAE,aAAc,EAAM,CAAC,EAGtE,gDAAiD,CAC7C,QACA,CACI,mBAAoB,EACxB,CACJ,EAGA,kCAAmC,CAAC,QAAS,QAAQ,EAGrD,iDAAkD,QAIlD,8CAA+C,QAG/C,4CAA6C,QAI7C,8CAA+C,QAI/C,mDAAoD,QAGpD,qCAAsC,CAAC,QAAS,CAAE,kBAAmB,EAAM,CAAC,EAI5E,kDAAmD,OACvD,CACJ,CAAC,EAEMI,EAAQF","sourcesContent":["import type { Linter } from \"eslint\";\n\nimport bestPracticesConfig from \"./config/best-practices\";\nimport { createConfig } from \"./utils/create-config\";\n\nconst bestPracticesRules = bestPracticesConfig.rules as Linter.RulesRecord;\n\nconst config = createConfig(\"typescript\", {\n rules: {\n // Disallows awaiting a value that is not a Thenable\n \"@typescript-eslint/await-thenable\": \"error\",\n\n \"@typescript-eslint/consistent-type-exports\": [\n \"error\",\n {\n fixMixedExportsWithInlineTypeSpecifier: true,\n },\n ],\n\n // Replace 'dot-notation' rule with '@typescript-eslint' version\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md\n \"dot-notation\": \"off\",\n \"@typescript-eslint/dot-notation\": [\"error\", { allowKeywords: true }],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-base-to-string.md\n \"@typescript-eslint/no-base-to-string\": [\n \"error\",\n {\n ignoredTypeNames: [\"RegExp\"],\n },\n ],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md\n \"@typescript-eslint/no-confusing-void-expression\": [\n \"error\",\n {\n ignoreArrowShorthand: true,\n ignoreVoidOperator: false,\n },\n ],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md\n \"@typescript-eslint/no-floating-promises\": [\n \"error\",\n {\n ignoreIIFE: true,\n ignoreVoid: true,\n },\n ],\n\n // Disallow iterating over an array with a for-in loop\n \"@typescript-eslint/no-for-in-array\": \"error\",\n\n // Replace 'no-throw-literal' rule with '@typescript-eslint' version\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md\n \"no-throw-literal\": \"off\",\n \"@typescript-eslint/no-throw-literal\": bestPracticesRules[\"no-throw-literal\"],\n\n // Replace 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md\n \"no-implied-eval\": \"off\",\n \"no-new-func\": \"off\",\n \"@typescript-eslint/no-implied-eval\": bestPracticesRules[\"no-implied-eval\"],\n\n // Disallow the void operator except when used to discard a value.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md\n \"@typescript-eslint/no-meaningless-void-operator\": [\"error\", { checkNever: true }],\n\n // Disallow Promises in places not designed to handle them.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-misused-promises.md\n \"@typescript-eslint/no-misused-promises\": [\n \"error\",\n {\n checksConditionals: true,\n checksVoidReturn: {\n arguments: true,\n attributes: false,\n properties: true,\n returns: true,\n variables: true,\n },\n },\n ],\n\n // Warns if a type assertion does not change the type of an expression\n // Disabling here because in most cases the explicitness is still valuable\n \"@typescript-eslint/no-unnecessary-type-assertion\": \"off\",\n\n // Enforce includes method over indexOf method.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-includes.md\n \"@typescript-eslint/prefer-includes\": \"error\",\n\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md\n \"@typescript-eslint/prefer-nullish-coalescing\": [\n \"error\",\n {\n ignoreConditionalTests: true,\n ignoreMixedLogicalExpressions: true,\n },\n ],\n\n // Enforce RegExp#exec over String#match if no global flag is provided.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md\n \"@typescript-eslint/prefer-regexp-exec\": \"error\",\n\n // Enforce that this is used when only this type is returned.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-return-this-type.md\n \"@typescript-eslint/prefer-return-this-type\": \"error\",\n\n // Enforce using String#startsWith and String#endsWith over other equivalent methods of checking substrings.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md\n \"@typescript-eslint/prefer-string-starts-ends-with\": \"error\",\n\n // Replace 'require-await' rule with '@typescript-eslint' version\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md\n \"require-await\": \"off\",\n \"@typescript-eslint/require-await\": bestPracticesRules[\"require-await\"],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/promise-function-async.md\n \"@typescript-eslint/promise-function-async\": \"error\",\n\n // Enforces unbound methods are called with their expected scope\n \"@typescript-eslint/unbound-method\": [\"error\", { ignoreStatic: false }],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-array-sort-compare.md\n \"@typescript-eslint/require-array-sort-compare\": [\n \"error\",\n {\n ignoreStringArrays: false,\n },\n ],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md\n \"@typescript-eslint/return-await\": [\"error\", \"always\"],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md\n \"@typescript-eslint/switch-exhaustiveness-check\": \"error\",\n\n // Disallow unnecessary namespace qualifiers.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md\n \"@typescript-eslint/no-unnecessary-qualifier\": \"error\",\n\n // When adding two variables, operands must both be of type number or of type string\n \"@typescript-eslint/restrict-plus-operands\": \"error\",\n\n // Disallow conditionals where the type is always truthy or always falsy.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md\n \"@typescript-eslint/no-unnecessary-condition\": \"error\",\n\n // Disallow type arguments that are equal to the default.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md\n \"@typescript-eslint/no-unnecessary-type-arguments\": \"error\",\n\n // Requires that private members are marked as readonly if they're never modified outside of the constructor\n \"@typescript-eslint/prefer-readonly\": [\"error\", { onlyInlineLambdas: false }],\n\n // Enforce using type parameter when calling Array#reduce instead of casting.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md\n \"@typescript-eslint/prefer-reduce-type-parameter\": \"error\",\n },\n});\n\nexport default config;\n"]}
1
+ {"version":3,"sources":["../src/typescript-type-checking.ts"],"names":["bestPracticesRules","best_practices_default","config","createConfig","typescript_type_checking_default"],"mappings":"4GAKA,IAAMA,EAAqBC,EAAoB,MAEzCC,EAASC,EAAa,aAAc,CAOtC,MAAO,CAEH,oCAAqC,QAErC,6CAA8C,CAC1C,QACA,CACI,uCAAwC,EAC5C,CACJ,EAGA,kCAAmC,CAAC,QAAS,CAAE,cAAe,EAAK,CAAC,EAEpE,uCAAwC,CACpC,QACA,CACI,iBAAkB,CAAC,QAAQ,CAC/B,CACJ,EAGA,kDAAmD,CAC/C,QACA,CACI,qBAAsB,GACtB,mBAAoB,EACxB,CACJ,EAGA,0CAA2C,CACvC,QACA,CACI,WAAY,GACZ,WAAY,EAChB,CACJ,EAGA,qCAAsC,QAEtC,qCAAsCH,EAAmB,iBAAiB,EAI1E,kDAAmD,CAAC,QAAS,CAAE,WAAY,EAAK,CAAC,EAEjF,yCAA0C,CACtC,QACA,CACI,mBAAoB,GACpB,iBAAkB,CACd,UAAW,GACX,WAAY,GACZ,WAAY,GACZ,QAAS,GACT,UAAW,EACf,CACJ,CACJ,EAGA,sCAAuCA,EAAmB,kBAAkB,EAE5E,8CAA+C,QAE/C,8CAA+C,QAI/C,mDAAoD,QAIpD,mDAAoD,MAIpD,qCAAsC,QAItC,+CAAgD,CAC5C,QACA,CACI,uBAAwB,GACxB,8BAA+B,EACnC,CACJ,EAGA,qCAAsC,CAAC,QAAS,CAAE,kBAAmB,EAAM,CAAC,EAI5E,kDAAmD,QAInD,wCAAyC,QAIzC,6CAA8C,QAI9C,oDAAqD,QAErD,4CAA6C,QAG7C,gDAAiD,CAC7C,QACA,CACI,mBAAoB,EACxB,CACJ,EAEA,mCAAoCA,EAAmB,eAAe,EAGtE,4CAA6C,QAG7C,kCAAmC,CAAC,QAAS,QAAQ,EAGrD,iDAAkD,QAIlD,oCAAqC,CAAC,QAAS,CAAE,aAAc,EAAM,CAAC,EAGtE,eAAgB,MAIhB,kBAAmB,MAGnB,cAAe,MAGf,mBAAoB,MAIpB,gBAAiB,KACrB,CACJ,CAAC,EAEMI,EAAQF","sourcesContent":["import type { Linter } from \"eslint\";\n\nimport bestPracticesConfig from \"./config/best-practices\";\nimport { createConfig } from \"./utils/create-config\";\n\nconst bestPracticesRules = bestPracticesConfig.rules as Linter.RulesRecord;\n\nconst config = createConfig(\"typescript\", {\n // TODO: enable the rule when typescript-eslint 6.0.0 is released\n // extends: [\n // \"plugin:@typescript-eslint/recommended-type-checked\",\n // \"plugin:@typescript-eslint/strict-type-checked\",\n // \"plugin:@typescript-eslint/stylistic-type-checked\"\n // ],\n rules: {\n // Disallows awaiting a value that is not a Thenable\n \"@typescript-eslint/await-thenable\": \"error\",\n\n \"@typescript-eslint/consistent-type-exports\": [\n \"error\",\n {\n fixMixedExportsWithInlineTypeSpecifier: true,\n },\n ],\n\n // Replace 'dot-notation' rule with '@typescript-eslint' version\n \"@typescript-eslint/dot-notation\": [\"error\", { allowKeywords: true }],\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-base-to-string.md\n \"@typescript-eslint/no-base-to-string\": [\n \"error\",\n {\n ignoredTypeNames: [\"RegExp\"],\n },\n ],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md\n \"@typescript-eslint/no-confusing-void-expression\": [\n \"error\",\n {\n ignoreArrowShorthand: true,\n ignoreVoidOperator: false,\n },\n ],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md\n \"@typescript-eslint/no-floating-promises\": [\n \"error\",\n {\n ignoreIIFE: true,\n ignoreVoid: true,\n },\n ],\n\n // Disallow iterating over an array with a for-in loop\n \"@typescript-eslint/no-for-in-array\": \"error\",\n\n \"@typescript-eslint/no-implied-eval\": bestPracticesRules[\"no-implied-eval\"],\n\n // Replace 'no-throw-literal' rule with '@typescript-eslint' version\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md\n \"@typescript-eslint/no-meaningless-void-operator\": [\"error\", { checkNever: true }],\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-misused-promises.md\n \"@typescript-eslint/no-misused-promises\": [\n \"error\",\n {\n checksConditionals: true,\n checksVoidReturn: {\n arguments: true,\n attributes: false,\n properties: true,\n returns: true,\n variables: true,\n },\n },\n ],\n\n // Replace 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version\n \"@typescript-eslint/no-throw-literal\": bestPracticesRules[\"no-throw-literal\"],\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md\n \"@typescript-eslint/no-unnecessary-condition\": \"error\",\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md\n \"@typescript-eslint/no-unnecessary-qualifier\": \"error\",\n\n // Disallow the void operator except when used to discard a value.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md\n \"@typescript-eslint/no-unnecessary-type-arguments\": \"error\",\n\n // Disallow Promises in places not designed to handle them.\n // Disabling here because in most cases the explicitness is still valuable\n \"@typescript-eslint/no-unnecessary-type-assertion\": \"off\",\n\n // Warns if a type assertion does not change the type of an expression\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-includes.md\n \"@typescript-eslint/prefer-includes\": \"error\",\n\n // Enforce includes method over indexOf method.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md\n \"@typescript-eslint/prefer-nullish-coalescing\": [\n \"error\",\n {\n ignoreConditionalTests: true,\n ignoreMixedLogicalExpressions: true,\n },\n ],\n\n // Requires that private members are marked as readonly if they're never modified outside of the constructor\n \"@typescript-eslint/prefer-readonly\": [\"error\", { onlyInlineLambdas: false }],\n\n // Enforce RegExp#exec over String#match if no global flag is provided.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md\n \"@typescript-eslint/prefer-reduce-type-parameter\": \"error\",\n\n // Enforce that this is used when only this type is returned.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md\n \"@typescript-eslint/prefer-regexp-exec\": \"error\",\n\n // Enforce using String#startsWith and String#endsWith over other equivalent methods of checking substrings.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-return-this-type.md\n \"@typescript-eslint/prefer-return-this-type\": \"error\",\n\n // Replace 'require-await' rule with '@typescript-eslint' version\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md\n \"@typescript-eslint/prefer-string-starts-ends-with\": \"error\",\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/promise-function-async.md\n \"@typescript-eslint/promise-function-async\": \"error\",\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-array-sort-compare.md\n \"@typescript-eslint/require-array-sort-compare\": [\n \"error\",\n {\n ignoreStringArrays: false,\n },\n ],\n\n \"@typescript-eslint/require-await\": bestPracticesRules[\"require-await\"],\n\n // When adding two variables, operands must both be of type number or of type string\n \"@typescript-eslint/restrict-plus-operands\": \"error\",\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md\n \"@typescript-eslint/return-await\": [\"error\", \"always\"],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md\n \"@typescript-eslint/switch-exhaustiveness-check\": \"error\",\n\n // Disallow unnecessary namespace qualifiers.\n // Enforces unbound methods are called with their expected scope\n \"@typescript-eslint/unbound-method\": [\"error\", { ignoreStatic: false }],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md\n \"dot-notation\": \"off\",\n\n // Disallow conditionals where the type is always truthy or always falsy.\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md\n \"no-implied-eval\": \"off\",\n\n // Disallow type arguments that are equal to the default.\n \"no-new-func\": \"off\",\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md\n \"no-throw-literal\": \"off\",\n\n // Enforce using type parameter when calling Array#reduce instead of casting.\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md\n \"require-await\": \"off\",\n },\n});\n\nexport default config;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/eslint-config",
3
- "version": "7.3.2",
3
+ "version": "8.0.0",
4
4
  "description": "ESLint shareable config for the Anolilab JavaScript style guide.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -85,6 +85,7 @@
85
85
  "name": "Daniel Bannert",
86
86
  "email": "d.bannert@anolilab.de"
87
87
  },
88
+ "type": "commonjs",
88
89
  "exports": {
89
90
  ".": {
90
91
  "types": "./dist/index.d.ts",
@@ -111,13 +112,13 @@
111
112
  "postinstall": "node ./skip.js || node ./dist/postinstall.js"
112
113
  },
113
114
  "dependencies": {
114
- "@anolilab/package-json-utils": "1.5.1",
115
+ "@anolilab/package-json-utils": "2.0.0",
115
116
  "@html-eslint/eslint-plugin": "^0.19.0",
116
117
  "@html-eslint/parser": "^0.19.0",
117
118
  "@rushstack/eslint-patch": "^1.3.2",
118
119
  "@rushstack/eslint-plugin-security": "^0.6.0",
119
- "@typescript-eslint/eslint-plugin": ">=5.60.1",
120
- "@typescript-eslint/parser": "^5.60.1",
120
+ "@typescript-eslint/eslint-plugin": ">=5.61.0",
121
+ "@typescript-eslint/parser": "^5.61.0",
121
122
  "confusing-browser-globals": "^1.0.11",
122
123
  "eslint-import-resolver-node": "^0.3.7",
123
124
  "eslint-import-resolver-typescript": "^3.5.5",
@@ -135,6 +136,7 @@
135
136
  "eslint-plugin-no-use-extend-native": "^0.5.0",
136
137
  "eslint-plugin-promise": "^6.1.1",
137
138
  "eslint-plugin-regexp": "^1.15.0",
139
+ "eslint-plugin-security": "^1.7.1",
138
140
  "eslint-plugin-simple-import-sort": "^10.0.0",
139
141
  "eslint-plugin-sonarjs": "^0.19.0",
140
142
  "eslint-plugin-sort-keys-fix": "^1.1.2",
@@ -151,13 +153,13 @@
151
153
  "yaml-eslint-parser": "^1.2.2"
152
154
  },
153
155
  "devDependencies": {
154
- "@anolilab/semantic-release-preset": "4.0.3",
156
+ "@anolilab/semantic-release-preset": "5.0.0",
155
157
  "@testing-library/dom": "^9.3.1",
156
158
  "@total-typescript/ts-reset": "^0.4.2",
157
159
  "@types/confusing-browser-globals": "^1.0.0",
158
160
  "@types/eslint": "^8.40.2",
159
161
  "@types/semver": "^7.5.0",
160
- "eslint": "^8.43.0",
162
+ "eslint": "^8.44.0",
161
163
  "eslint-find-rules": "^4.1.0",
162
164
  "eslint-plugin-babel": "^5.3.1",
163
165
  "eslint-plugin-cypress": "^2.13.3",
@@ -166,7 +168,7 @@
166
168
  "eslint-plugin-jest-async": "^1.0.3",
167
169
  "eslint-plugin-jest-dom": "^5.0.1",
168
170
  "eslint-plugin-jest-formatting": "^3.1.0",
169
- "eslint-plugin-jsdoc": "^46.4.0",
171
+ "eslint-plugin-jsdoc": "^46.4.3",
170
172
  "eslint-plugin-jsx-a11y": "^6.7.1",
171
173
  "eslint-plugin-no-unsanitized": "^4.0.2",
172
174
  "eslint-plugin-prefer-object-spread": "^1.2.1",
@@ -183,11 +185,11 @@
183
185
  "jest": "^29.5.0",
184
186
  "react": "^18.2.0",
185
187
  "rimraf": "^5.0.1",
186
- "semantic-release": "^21.0.5",
188
+ "semantic-release": "^21.0.6",
187
189
  "tsup": "^7.1.0",
188
190
  "type-fest": "^3.12.0",
189
- "typescript": "^5.1.5",
190
- "vitest": "^0.32.2"
191
+ "typescript": "^5.1.6",
192
+ "vitest": "^0.32.4"
191
193
  },
192
194
  "peerDependencies": {
193
195
  "eslint": "^8.15.0"
@@ -202,7 +204,7 @@
202
204
  "eslint-plugin-jest-async": "^1.0.3",
203
205
  "eslint-plugin-jest-dom": "^5.0.1",
204
206
  "eslint-plugin-jest-formatting": "^3.1.0",
205
- "eslint-plugin-jsdoc": "^46.4.0",
207
+ "eslint-plugin-jsdoc": "^46.4.3",
206
208
  "eslint-plugin-jsx-a11y": "^6.7.1",
207
209
  "eslint-plugin-n": "^16.0.1",
208
210
  "eslint-plugin-no-unsanitized": "^4.0.2",
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var e={rules:{"accessor-pairs":"off","array-callback-return":["error",{allowImplicit:!0}],"block-scoped-var":"error",complexity:["off",11],"class-methods-use-this":["error",{exceptMethods:[]}],"consistent-return":"error",curly:["error","multi-line"],"default-case":["error",{commentPattern:"^no default$"}],"default-case-last":"error","default-param-last":"error","dot-location":["error","property"],eqeqeq:["error","always",{null:"ignore"}],"grouped-accessor-pairs":"error","guard-for-in":"error","max-classes-per-file":["error",1],"no-alert":"error","no-caller":"error","no-case-declarations":"error","no-constructor-return":"error","no-div-regex":"off","no-else-return":["error",{allowElseIf:!1}],"no-empty-function":["error",{allow:["arrowFunctions","functions","methods"]}],"no-empty-pattern":"error","no-empty-static-block":"error","no-eq-null":"off","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-fallthrough":"error","no-floating-decimal":"error","no-global-assign":["error",{exceptions:[]}],"no-native-reassign":"off","no-implicit-coercion":["off",{boolean:!1,number:!0,string:!0,allow:[]}],"no-implicit-globals":"off","no-implied-eval":"error","no-invalid-this":"off","no-iterator":"error","no-labels":["error",{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":"error","no-loop-func":"error","no-magic-numbers":["off",{ignore:[],ignoreArrayIndexes:!0,enforceConst:!0,detectObjects:!1}],"no-multi-spaces":["error",{ignoreEOLComments:!1}],"no-multi-str":"error","no-new":"error","no-new-func":"error","no-new-wrappers":"error","no-nonoctal-decimal-escape":"error","no-octal":"error","no-octal-escape":"error","no-param-reassign":["error",{props:!0,ignorePropertyModificationsFor:["acc","accumulator","e","ctx","context","req","request","res","response","$scope","staticContext"]}],"no-proto":"error","no-redeclare":"error","no-restricted-properties":["error",{object:"arguments",property:"callee",message:"arguments.callee is deprecated"},{object:"global",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"self",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"window",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"global",property:"isNaN",message:"Please use Number.isNaN instead"},{object:"self",property:"isNaN",message:"Please use Number.isNaN instead"},{object:"window",property:"isNaN",message:"Please use Number.isNaN instead"},{property:"__defineGetter__",message:"Please use Object.defineProperty instead."},{property:"__defineSetter__",message:"Please use Object.defineProperty instead."},{object:"Math",property:"pow",message:"Use the exponentiation operator (**) instead."},{object:"globalThis",property:"isNaN",message:"Use `Number.isNaN` instead."},{object:"globalThis",property:"isFinite",message:"Use `Number.isFinite` instead."},{object:"globalThis",property:"parseFloat",message:"Use `Number.parseFloat` instead."},{object:"globalThis",property:"parseInt",message:"Use `Number.parseInt` instead."},{object:"window",property:"parseFloat",message:"Use `Number.parseFloat` instead."},{object:"window",property:"parseInt",message:"Use `Number.parseInt` instead."},{property:"__proto__",message:"Use `Object.getPrototypeOf` instead."},{property:"__lookupGetter__",message:"Use `Object.getOwnPropertyDescriptor` instead."},{property:"__lookupSetter__",message:"Use `Object.getOwnPropertyDescriptor` instead."}],"no-return-assign":["error","always"],"no-return-await":"error","no-script-url":"error","no-self-assign":["error",{props:!0}],"no-self-compare":"error","no-sequences":"error","no-throw-literal":"error","no-unmodified-loop-condition":"off","no-unused-expressions":["error",{allowShortCircuit:!1,allowTernary:!1,allowTaggedTemplates:!1}],"no-unused-labels":"error","no-useless-call":"off","no-useless-catch":"error","no-useless-concat":"error","no-useless-escape":"error","no-useless-return":"error","no-void":"error","no-warning-comments":["off",{terms:["todo","fixme","xxx","@todo"],location:"start"}],"no-with":"error","prefer-promise-reject-errors":["error",{allowEmptyReject:!0}],"prefer-named-capture-group":"off","prefer-regex-literals":"error",radix:"error","require-await":"off","require-unicode-regexp":"off","vars-on-top":"error","wrap-iife":["error","outside",{functionPrototypeMethods:!1}],yoda:"error","dot-notation":["error",{allowKeywords:!0}]}},r=e;
4
-
5
- exports.a = r;
6
- //# sourceMappingURL=out.js.map
7
- //# sourceMappingURL=chunk-5S3UQ6WJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/config/best-practices.ts"],"names":["config","best_practices_default"],"mappings":"AAEA,IAAMA,EAAwB,CAC1B,MAAO,CAEH,iBAAkB,MAIlB,wBAAyB,CAAC,QAAS,CAAE,cAAe,EAAK,CAAC,EAG1D,mBAAoB,QAGpB,WAAY,CAAC,MAAO,EAAE,EAItB,yBAA0B,CACtB,QACA,CACI,cAAe,CAAC,CACpB,CACJ,EAGA,oBAAqB,QAGrB,MAAO,CAAC,QAAS,YAAY,EAG7B,eAAgB,CAAC,QAAS,CAAE,eAAgB,cAAe,CAAC,EAI5D,oBAAqB,QAGrB,qBAAsB,QAItB,eAAgB,CAAC,QAAS,UAAU,EAIpC,OAAQ,CAAC,QAAS,SAAU,CAAE,KAAM,QAAS,CAAC,EAI9C,yBAA0B,QAG1B,eAAgB,QAIhB,uBAAwB,CAAC,QAAS,CAAC,EAGnC,WAAY,QAGZ,YAAa,QAIb,uBAAwB,QAIxB,wBAAyB,QAIzB,eAAgB,MAIhB,iBAAkB,CAAC,QAAS,CAAE,YAAa,EAAM,CAAC,EAIlD,oBAAqB,CACjB,QACA,CACI,MAAO,CAAC,iBAAkB,YAAa,SAAS,CACpD,CACJ,EAIA,mBAAoB,QAIpB,wBAAyB,QAGzB,aAAc,MAGd,UAAW,QAGX,mBAAoB,QAGpB,gBAAiB,QAIjB,iBAAkB,QAGlB,iBAAkB,QAGlB,sBAAuB,QAIvB,mBAAoB,CAAC,QAAS,CAAE,WAAY,CAAC,CAAE,CAAC,EAEhD,qBAAsB,MAItB,uBAAwB,CACpB,MACA,CACI,QAAS,GACT,OAAQ,GACR,OAAQ,GACR,MAAO,CAAC,CACZ,CACJ,EAIA,sBAAuB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gCACb,EACA,CACI,SAAU,YACV,QAAS,sCACb,EACA,CACI,SAAU,mBACV,QAAS,gDACb,EACA,CACI,SAAU,mBACV,QAAS,gDACb,CACJ,EAGA,mBAAoB,CAAC,QAAS,QAAQ,EAGtC,kBAAmB,QAGnB,gBAAiB,QAIjB,iBAAkB,CACd,QACA,CACI,MAAO,EACX,CACJ,EAGA,kBAAmB,QAGnB,eAAgB,QAGhB,mBAAoB,QAIpB,+BAAgC,MAGhC,wBAAyB,CACrB,QACA,CACI,kBAAmB,GACnB,aAAc,GACd,qBAAsB,EAC1B,CACJ,EAIA,mBAAoB,QAGpB,kBAAmB,MAInB,mBAAoB,QAIpB,oBAAqB,QAIrB,oBAAqB,QAIrB,oBAAqB,QAIrB,UAAW,QAGX,sBAAuB,CACnB,MACA,CACI,MAAO,CAAC,OAAQ,QAAS,MAAO,OAAO,EACvC,SAAU,OACd,CACJ,EAGA,UAAW,QAIX,+BAAgC,CAAC,QAAS,CAAE,iBAAkB,EAAK,CAAC,EAIpE,6BAA8B,MAG9B,wBAAyB,QAGzB,MAAO,QAIP,gBAAiB,MAIjB,yBAA0B,MAG1B,cAAe,QAIf,YAAa,CAAC,QAAS,UAAW,CAAE,yBAA0B,EAAM,CAAC,EAGrE,KAAM,QAEN,eAAgB,CAAC,QAAS,CAAE,cAAe,EAAK,CAAC,CACrD,CACJ,EAEOC,EAAQD","sourcesContent":["import type { Linter } from \"eslint\";\n\nconst config: Linter.Config = {\n rules: {\n // enforces getter/setter pairs in objects\n \"accessor-pairs\": \"off\",\n\n // enforces return statements in callbacks of array's methods\n // https://eslint.org/docs/rules/array-callback-return\n \"array-callback-return\": [\"error\", { allowImplicit: true }],\n\n // treat var statements as if they were block scoped\n \"block-scoped-var\": \"error\",\n\n // specify the maximum cyclomatic complexity allowed in a program\n complexity: [\"off\", 11],\n\n // enforce that class methods use \"this\"\n // https://eslint.org/docs/rules/class-methods-use-this\n \"class-methods-use-this\": [\n \"error\",\n {\n exceptMethods: [],\n },\n ],\n\n // require return statements to either always or never specify values\n \"consistent-return\": \"error\",\n\n // specify curly brace conventions for all control statements\n curly: [\"error\", \"multi-line\"], // multiline\n\n // require default case in switch statements\n \"default-case\": [\"error\", { commentPattern: \"^no default$\" }],\n\n // Enforce default clauses in switch statements to be last\n // https://eslint.org/docs/rules/default-case-last\n \"default-case-last\": \"error\",\n\n // https://eslint.org/docs/rules/default-param-last\n \"default-param-last\": \"error\",\n\n // enforces consistent newlines before or after dots\n // https://eslint.org/docs/rules/dot-location\n \"dot-location\": [\"error\", \"property\"],\n\n // require the use of === and !==\n // https://eslint.org/docs/rules/eqeqeq\n eqeqeq: [\"error\", \"always\", { null: \"ignore\" }],\n\n // Require grouped accessor pairs in object literals and classes\n // https://eslint.org/docs/rules/grouped-accessor-pairs\n \"grouped-accessor-pairs\": \"error\",\n\n // make sure for-in loops have an if statement\n \"guard-for-in\": \"error\",\n\n // enforce a maximum number of classes per file\n // https://eslint.org/docs/rules/max-classes-per-file\n \"max-classes-per-file\": [\"error\", 1],\n\n // disallow the use of alert, confirm, and prompt\n \"no-alert\": \"error\",\n\n // disallow use of arguments.caller or arguments.callee\n \"no-caller\": \"error\",\n\n // disallow lexical declarations in case/default clauses\n // https://eslint.org/docs/rules/no-case-declarations.html\n \"no-case-declarations\": \"error\",\n\n // Disallow returning value in constructor\n // https://eslint.org/docs/rules/no-constructor-return\n \"no-constructor-return\": \"error\",\n\n // disallow division operators explicitly at beginning of regular expression\n // https://eslint.org/docs/rules/no-div-regex\n \"no-div-regex\": \"off\",\n\n // disallow else after a return in an if\n // https://eslint.org/docs/rules/no-else-return\n \"no-else-return\": [\"error\", { allowElseIf: false }],\n\n // disallow empty functions, except for standalone funcs/arrows\n // https://eslint.org/docs/rules/no-empty-function\n \"no-empty-function\": [\n \"error\",\n {\n allow: [\"arrowFunctions\", \"functions\", \"methods\"],\n },\n ],\n\n // disallow empty destructuring patterns\n // https://eslint.org/docs/rules/no-empty-pattern\n \"no-empty-pattern\": \"error\",\n\n // Disallow empty static blocks\n // https://eslint.org/docs/latest/rules/no-empty-static-block\n \"no-empty-static-block\": \"error\",\n\n // disallow comparisons to null without a type-checking operator\n \"no-eq-null\": \"off\",\n\n // disallow use of eval()\n \"no-eval\": \"error\",\n\n // disallow adding to native types\n \"no-extend-native\": \"error\",\n\n // disallow unnecessary function binding\n \"no-extra-bind\": \"error\",\n\n // disallow Unnecessary Labels\n // https://eslint.org/docs/rules/no-extra-label\n \"no-extra-label\": \"error\",\n\n // disallow fallthrough of case statements\n \"no-fallthrough\": \"error\",\n\n // disallow the use of leading or trailing decimal points in numeric literals\n \"no-floating-decimal\": \"error\",\n\n // disallow reassignments of native objects or read-only globals\n // https://eslint.org/docs/rules/no-global-assign\n \"no-global-assign\": [\"error\", { exceptions: [] }],\n // deprecated in favor of no-global-assign\n \"no-native-reassign\": \"off\",\n\n // disallow implicit type conversions\n // https://eslint.org/docs/rules/no-implicit-coercion\n \"no-implicit-coercion\": [\n \"off\",\n {\n boolean: false,\n number: true,\n string: true,\n allow: [],\n },\n ],\n\n // disallow var and named functions in global scope\n // https://eslint.org/docs/rules/no-implicit-globals\n \"no-implicit-globals\": \"off\",\n\n // disallow use of eval()-like methods\n \"no-implied-eval\": \"error\",\n\n // disallow this keywords outside of classes or class-like objects\n \"no-invalid-this\": \"off\",\n\n // disallow usage of __iterator__ property\n \"no-iterator\": \"error\",\n\n // disallow use of labels for anything other than loops and switches\n \"no-labels\": [\"error\", { allowLoop: false, allowSwitch: false }],\n\n // disallow unnecessary nested blocks\n \"no-lone-blocks\": \"error\",\n\n // disallow creation of functions within loops\n \"no-loop-func\": \"error\",\n\n // disallow magic numbers\n // https://eslint.org/docs/rules/no-magic-numbers\n \"no-magic-numbers\": [\n \"off\",\n {\n ignore: [],\n ignoreArrayIndexes: true,\n enforceConst: true,\n detectObjects: false,\n },\n ],\n\n // disallow use of multiple spaces\n \"no-multi-spaces\": [\n \"error\",\n {\n ignoreEOLComments: false,\n },\n ],\n\n // disallow use of multiline strings\n \"no-multi-str\": \"error\",\n\n // disallow use of new operator when not part of the assignment or comparison\n \"no-new\": \"error\",\n\n // disallow use of new operator for Function object\n \"no-new-func\": \"error\",\n\n // disallows creating new instances of String, Number, and Boolean\n \"no-new-wrappers\": \"error\",\n\n // Disallow \\8 and \\9 escape sequences in string literals\n // https://eslint.org/docs/rules/no-nonoctal-decimal-escape\n \"no-nonoctal-decimal-escape\": \"error\",\n\n // disallow use of (old style) octal literals\n \"no-octal\": \"error\",\n\n // disallow use of octal escape sequences in string literals, such as\n // var foo = 'Copyright \\251';\n \"no-octal-escape\": \"error\",\n\n // disallow reassignment of function parameters\n // disallow parameter object manipulation except for specific exclusions\n // rule: https://eslint.org/docs/rules/no-param-reassign.html\n \"no-param-reassign\": [\n \"error\",\n {\n props: true,\n ignorePropertyModificationsFor: [\n \"acc\", // for reduce accumulators\n \"accumulator\", // for reduce accumulators\n \"e\", // for e.returnvalue\n \"ctx\", // for Koa routing\n \"context\", // for Koa routing\n \"req\", // for Express requests\n \"request\", // for Express requests\n \"res\", // for Express responses\n \"response\", // for Express responses\n \"$scope\", // for Angular 1 scopes\n \"staticContext\", // for ReactRouter context\n ],\n },\n ],\n\n // disallow usage of __proto__ property\n \"no-proto\": \"error\",\n\n // disallow declaring the same variable more than once\n \"no-redeclare\": \"error\",\n\n // disallow certain object properties\n // https://eslint.org/docs/rules/no-restricted-properties\n \"no-restricted-properties\": [\n \"error\",\n {\n object: \"arguments\",\n property: \"callee\",\n message: \"arguments.callee is deprecated\",\n },\n {\n object: \"global\",\n property: \"isFinite\",\n message: \"Please use Number.isFinite instead\",\n },\n {\n object: \"self\",\n property: \"isFinite\",\n message: \"Please use Number.isFinite instead\",\n },\n {\n object: \"window\",\n property: \"isFinite\",\n message: \"Please use Number.isFinite instead\",\n },\n {\n object: \"global\",\n property: \"isNaN\",\n\n message: \"Please use Number.isNaN instead\",\n },\n {\n object: \"self\",\n property: \"isNaN\",\n message: \"Please use Number.isNaN instead\",\n },\n {\n object: \"window\",\n property: \"isNaN\",\n message: \"Please use Number.isNaN instead\",\n },\n {\n property: \"__defineGetter__\",\n message: \"Please use Object.defineProperty instead.\",\n },\n {\n property: \"__defineSetter__\",\n message: \"Please use Object.defineProperty instead.\",\n },\n {\n object: \"Math\",\n property: \"pow\",\n message: \"Use the exponentiation operator (**) instead.\",\n },\n {\n object: \"globalThis\",\n property: \"isNaN\",\n message: \"Use `Number.isNaN` instead.\",\n },\n {\n object: \"globalThis\",\n property: \"isFinite\",\n message: \"Use `Number.isFinite` instead.\",\n },\n {\n object: \"globalThis\",\n property: \"parseFloat\",\n message: \"Use `Number.parseFloat` instead.\",\n },\n {\n object: \"globalThis\",\n property: \"parseInt\",\n message: \"Use `Number.parseInt` instead.\",\n },\n {\n object: \"window\",\n property: \"parseFloat\",\n message: \"Use `Number.parseFloat` instead.\",\n },\n {\n object: \"window\",\n property: \"parseInt\",\n message: \"Use `Number.parseInt` instead.\",\n },\n {\n property: \"__proto__\",\n message: \"Use `Object.getPrototypeOf` instead.\",\n },\n {\n property: \"__lookupGetter__\",\n message: \"Use `Object.getOwnPropertyDescriptor` instead.\",\n },\n {\n property: \"__lookupSetter__\",\n message: \"Use `Object.getOwnPropertyDescriptor` instead.\",\n },\n ],\n\n // disallow use of assignment in return statement\n \"no-return-assign\": [\"error\", \"always\"],\n\n // disallow redundant `return await`\n \"no-return-await\": \"error\",\n\n // disallow use of `javascript:` urls.\n \"no-script-url\": \"error\",\n\n // disallow self assignment\n // https://eslint.org/docs/rules/no-self-assign\n \"no-self-assign\": [\n \"error\",\n {\n props: true,\n },\n ],\n\n // disallow comparisons where both sides are exactly the same\n \"no-self-compare\": \"error\",\n\n // disallow use of comma operator\n \"no-sequences\": \"error\",\n\n // restrict what can be thrown as an exception\n \"no-throw-literal\": \"error\",\n\n // disallow unmodified conditions of loops\n // https://eslint.org/docs/rules/no-unmodified-loop-condition\n \"no-unmodified-loop-condition\": \"off\",\n\n // disallow usage of expressions in statement position\n \"no-unused-expressions\": [\n \"error\",\n {\n allowShortCircuit: false,\n allowTernary: false,\n allowTaggedTemplates: false,\n },\n ],\n\n // disallow unused labels\n // https://eslint.org/docs/rules/no-unused-labels\n \"no-unused-labels\": \"error\",\n\n // disallow unnecessary .call() and .apply()\n \"no-useless-call\": \"off\",\n\n // Disallow unnecessary catch clauses\n // https://eslint.org/docs/rules/no-useless-catch\n \"no-useless-catch\": \"error\",\n\n // disallow useless string concatenation\n // https://eslint.org/docs/rules/no-useless-concat\n \"no-useless-concat\": \"error\",\n\n // disallow unnecessary string escaping\n // https://eslint.org/docs/rules/no-useless-escape\n \"no-useless-escape\": \"error\",\n\n // disallow redundant return; keywords\n // https://eslint.org/docs/rules/no-useless-return\n \"no-useless-return\": \"error\",\n\n // disallow use of void operator\n // https://eslint.org/docs/rules/no-void\n \"no-void\": \"error\",\n\n // disallow usage of configurable warning terms in comments: e.g. todo\n \"no-warning-comments\": [\n \"off\",\n {\n terms: [\"todo\", \"fixme\", \"xxx\", \"@todo\"],\n location: \"start\",\n },\n ],\n\n // disallow use of the with statement\n \"no-with\": \"error\",\n\n // require using Error objects as Promise rejection reasons\n // https://eslint.org/docs/rules/prefer-promise-reject-errors\n \"prefer-promise-reject-errors\": [\"error\", { allowEmptyReject: true }],\n\n // Suggest using named capture group in regular expression\n // https://eslint.org/docs/rules/prefer-named-capture-group\n \"prefer-named-capture-group\": \"off\",\n\n // https://eslint.org/docs/rules/prefer-regex-literals\n \"prefer-regex-literals\": \"error\",\n\n // require use of the second argument for parseInt()\n radix: \"error\",\n\n // require `await` in `async function` (note: this is a horrible rule that should never be used)\n // https://eslint.org/docs/rules/require-await\n \"require-await\": \"off\",\n\n // Enforce the use of u flag on RegExp\n // https://eslint.org/docs/rules/require-unicode-regexp\n \"require-unicode-regexp\": \"off\",\n\n // requires to declare all vars on top of their containing scope\n \"vars-on-top\": \"error\",\n\n // require immediate function invocation to be wrapped in parentheses\n // https://eslint.org/docs/rules/wrap-iife.html\n \"wrap-iife\": [\"error\", \"outside\", { functionPrototypeMethods: false }],\n\n // require or disallow Yoda conditions\n yoda: \"error\",\n // encourages use of dot notation whenever possible\n \"dot-notation\": [\"error\", { allowKeywords: true }],\n },\n};\n\nexport default config;\n"]}
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var e={env:{es6:!0},parserOptions:{ecmaVersion:6,sourceType:"module",ecmaFeatures:{generators:!1,objectLiteralDuplicateProperties:!1}},rules:{"arrow-body-style":["error","as-needed",{requireReturnForObjectLiteral:!0}],"arrow-parens":["error","always"],"arrow-spacing":["error",{before:!0,after:!0}],"constructor-super":"error","generator-star-spacing":["error",{before:!1,after:!0}],"no-class-assign":"error","no-confusing-arrow":["error",{allowParens:!0}],"no-const-assign":"error","no-dupe-class-members":"error","no-duplicate-imports":"off","no-new-symbol":"error","no-restricted-exports":["error",{restrictDefaultExports:{direct:!1,named:!0,defaultFrom:!1,namedFrom:!1,namespaceFrom:!0},restrictedNamedExports:["then"]}],"no-restricted-imports":["error",{paths:[{name:"lodash.isequal",message:"Lodash modularised (and lodash < 4.17.11) have CVE vulnerabilities. Please use tree-shakeable imports like lodash/xxx instead"},{name:"lodash.uniqueId",message:"Lodash modularised (and lodash < 4.17.11) have CVE vulnerabilities. Please use tree-shakeable imports like lodash/xxx instead"},{name:"lodash.mergewith",message:"Lodash modularised (and lodash < 4.17.11) have CVE vulnerabilities. Please use tree-shakeable imports like lodash/xxx instead"},{name:"lodash.pick",message:"Lodash modularised (and lodash < 4.17.11) have CVE vulnerabilities. Please use tree-shakeable imports like lodash/xxx instead"},{name:"error"},{name:"domain"},{name:"freelist"},{name:"smalloc"},{name:"punycode"},{name:"sys"},{name:"querystring",message:'Is legacy, npm version got deprecated, migrate to URLSearchParams as recommended or try "qs" as a package'},{name:"colors",message:"Please use one of the following instead: chalk, kleur, ansi-colors, @colors/colors"},{name:"mkdirp",message:"node v10.12 mkdir supports recursive option"},{name:"faker",message:'Please use "@faker-js/faker" as a replacement'},{name:"xtend",message:"Please use Object.assign or spread { ...obj }"},{name:"object-assign",message:"Please use Object.assign or spread { ...obj }"},{name:"extend-shallow",message:"Please use Object.assign or spread { ...obj }"},{name:"rimraf",message:"node supports recursive option now"},{name:"pad-left",message:'just use "".padStart() and "".padEnd()'},{name:"pad-right",message:'just use "".padStart() and "".padEnd()'},{name:"left-pad",message:'just use "".padStart() and "".padEnd()'},{name:"right-pad",message:'just use "".padStart() and "".padEnd()'},{name:"pad",message:'just use "".padStart() and "".padEnd()'},{name:"safe-buffer"},{name:"safer-buffer"},{name:"array-flatten",message:"just use [].flat() or some other polyfill"},{name:"request",message:"Been deprecated"},{name:"co",message:"use async/await instead"},{name:"windows-1252",message:"Please use TextDecoder instead"},{name:"string_decoder",message:"Please use TextDecoder instead"},{name:"concat-map",message:"Please use array.prototype.flatMap instead"},{name:"buffer-alloc"}],patterns:["lodash.*"]}],"no-this-before-super":"error","no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":["error",{ignoreDestructuring:!1,ignoreImport:!1,ignoreExport:!1}],"no-var":"error","object-shorthand":["error","always",{ignoreConstructors:!1,avoidQuotes:!0}],"prefer-arrow-callback":["error",{allowNamedFunctions:!1,allowUnboundThis:!0}],"prefer-const":["error",{destructuring:"any",ignoreReadBeforeAssign:!0}],"prefer-destructuring":["error",{VariableDeclarator:{array:!1,object:!0},AssignmentExpression:{array:!0,object:!1}},{enforceForRenamedProperties:!1}],"prefer-numeric-literals":"error","prefer-reflect":"off","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error","require-yield":"error","rest-spread-spacing":["error","never"],"sort-imports":["off",{ignoreCase:!1,ignoreDeclarationSort:!1,ignoreMemberSort:!1,memberSyntaxSortOrder:["none","all","multiple","single"]}],"symbol-description":"error","template-curly-spacing":"error","yield-star-spacing":["error","after"]}},r=e;
4
-
5
- exports.a = r;
6
- //# sourceMappingURL=out.js.map
7
- //# sourceMappingURL=chunk-GGJONTGP.js.map