@anolilab/eslint-config 7.3.1 → 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.
- package/CHANGELOG.md +54 -0
- package/README.md +35 -23
- package/dist/chunk-3NVDJZNH.js +7 -0
- package/dist/chunk-3NVDJZNH.js.map +1 -0
- package/dist/{chunk-SV64EPVP.js → chunk-6COSQA7M.js} +2 -2
- package/dist/chunk-6COSQA7M.js.map +1 -0
- package/dist/chunk-BH4PQLFK.js +10 -0
- package/dist/chunk-BH4PQLFK.js.map +1 -0
- package/dist/chunk-KKHL2OSJ.js +7 -0
- package/dist/chunk-KKHL2OSJ.js.map +1 -0
- package/dist/chunk-MQFZFF2T.js +7 -0
- package/dist/chunk-MQFZFF2T.js.map +1 -0
- package/dist/chunk-PW4WCSOE.js +9 -0
- package/dist/chunk-PW4WCSOE.js.map +1 -0
- package/dist/{chunk-YMWD4DNM.js → chunk-SEYYGHPU.js} +1 -1
- package/dist/chunk-SEYYGHPU.js.map +1 -0
- package/dist/chunk-TWVXPNWB.js +9 -0
- package/dist/chunk-TWVXPNWB.js.map +1 -0
- package/dist/{chunk-VJL7NPM4.js → chunk-VW5ZVT2B.js} +2 -2
- package/dist/chunk-VW5ZVT2B.js.map +1 -0
- package/dist/{chunk-UJAIXHCQ.js → chunk-ZFO6DTP4.js} +2 -2
- package/dist/{chunk-RWRS63WY.mjs.map → chunk-ZFO6DTP4.js.map} +1 -1
- package/dist/config/best-practices.js +3 -2
- package/dist/config/errors.js +3 -2
- package/dist/config/es6.js +3 -2
- package/dist/config/plugins/antfu.js +3 -2
- package/dist/config/plugins/antfu.js.map +1 -1
- package/dist/config/plugins/array-func.js +3 -2
- package/dist/config/plugins/array-func.js.map +1 -1
- package/dist/config/plugins/ava.js +3 -1
- package/dist/config/plugins/ava.js.map +1 -1
- package/dist/config/plugins/babel.js +7 -5
- package/dist/config/plugins/babel.js.map +1 -1
- package/dist/config/plugins/compat.js +2 -0
- package/dist/config/plugins/compat.js.map +1 -1
- package/dist/config/plugins/cypress.js +2 -0
- package/dist/config/plugins/cypress.js.map +1 -1
- package/dist/config/plugins/es.js +3 -2
- package/dist/config/plugins/es.js.map +1 -1
- package/dist/config/plugins/eslint-comments.js +3 -1
- package/dist/config/plugins/eslint-comments.js.map +1 -1
- package/dist/config/plugins/etc.js +3 -2
- package/dist/config/plugins/etc.js.map +1 -1
- package/dist/config/plugins/html.js +4 -3
- package/dist/config/plugins/html.js.map +1 -1
- package/dist/config/plugins/import.js +3 -2
- package/dist/config/plugins/jest-async.js +2 -0
- package/dist/config/plugins/jest-async.js.map +1 -1
- package/dist/config/plugins/jest-dom.js +2 -0
- package/dist/config/plugins/jest-dom.js.map +1 -1
- package/dist/config/plugins/jest-formatting.js +2 -0
- package/dist/config/plugins/jest-formatting.js.map +1 -1
- package/dist/config/plugins/jest.js +3 -1
- package/dist/config/plugins/jest.js.map +1 -1
- package/dist/config/plugins/jsdoc.js +4 -3
- package/dist/config/plugins/jsdoc.js.map +1 -1
- package/dist/config/plugins/jsonc.js +4 -3
- package/dist/config/plugins/jsonc.js.map +1 -1
- package/dist/config/plugins/jsx-a11y.js +2 -1
- package/dist/config/plugins/jsx-a11y.js.map +1 -1
- package/dist/config/plugins/lodash-fp.js +2 -0
- package/dist/config/plugins/lodash-fp.js.map +1 -1
- package/dist/config/plugins/lodash.js +3 -1
- package/dist/config/plugins/lodash.js.map +1 -1
- package/dist/config/plugins/markdown.js +3 -1
- package/dist/config/plugins/markdown.js.map +1 -1
- package/dist/config/plugins/mdx.js +3 -1
- package/dist/config/plugins/mdx.js.map +1 -1
- package/dist/config/plugins/no-extend-native.js +2 -0
- package/dist/config/plugins/no-extend-native.js.map +1 -1
- package/dist/config/plugins/no-loops.js +2 -0
- package/dist/config/plugins/no-loops.js.map +1 -1
- package/dist/config/plugins/no-secrets.js +3 -1
- package/dist/config/plugins/no-secrets.js.map +1 -1
- package/dist/config/plugins/no-unsanitized.js +2 -0
- package/dist/config/plugins/no-unsanitized.js.map +1 -1
- package/dist/config/plugins/node.js +2 -1
- package/dist/config/plugins/node.js.map +1 -1
- package/dist/config/plugins/playwright.js +2 -1
- package/dist/config/plugins/playwright.js.map +1 -1
- package/dist/config/plugins/promise.js +2 -0
- package/dist/config/plugins/promise.js.map +1 -1
- package/dist/config/plugins/react-hooks.js +3 -1
- package/dist/config/plugins/react-hooks.js.map +1 -1
- package/dist/config/plugins/react-redux.js +3 -1
- package/dist/config/plugins/react-redux.js.map +1 -1
- package/dist/config/plugins/react.js +10 -7
- package/dist/config/plugins/react.js.map +1 -1
- package/dist/config/plugins/regexp.js +3 -2
- package/dist/config/plugins/regexp.js.map +1 -1
- package/dist/config/plugins/security.js +4 -2
- package/dist/config/plugins/security.js.map +1 -1
- package/dist/config/plugins/simple-import-sort.js +3 -1
- package/dist/config/plugins/simple-import-sort.js.map +1 -1
- package/dist/config/plugins/sonarjs.js +3 -2
- package/dist/config/plugins/sonarjs.js.map +1 -1
- package/dist/config/plugins/sort-keys-fix.js +2 -0
- package/dist/config/plugins/sort-keys-fix.js.map +1 -1
- package/dist/config/plugins/storybook.js +3 -1
- package/dist/config/plugins/storybook.js.map +1 -1
- package/dist/config/plugins/tailwindcss.js +3 -2
- package/dist/config/plugins/tailwindcss.js.map +1 -1
- package/dist/config/plugins/tanstack-query.js +3 -2
- package/dist/config/plugins/tanstack-query.js.map +1 -1
- package/dist/config/plugins/testing-library.js +4 -3
- package/dist/config/plugins/testing-library.js.map +1 -1
- package/dist/config/plugins/toml.js +3 -1
- package/dist/config/plugins/toml.js.map +1 -1
- package/dist/config/plugins/tsdoc.js +3 -2
- package/dist/config/plugins/tsdoc.js.map +1 -1
- package/dist/config/plugins/typescript-sort-keys.js +2 -0
- package/dist/config/plugins/typescript-sort-keys.js.map +1 -1
- package/dist/config/plugins/typescript.js +9 -7
- package/dist/config/plugins/typescript.js.map +1 -1
- package/dist/config/plugins/unicorn.js +4 -3
- package/dist/config/plugins/unicorn.js.map +1 -1
- package/dist/config/plugins/vitest.js +3 -1
- package/dist/config/plugins/vitest.js.map +1 -1
- package/dist/config/plugins/yml.js +4 -3
- package/dist/config/plugins/yml.js.map +1 -1
- package/dist/config/plugins/you-dont-need-lodash-underscore.js +2 -0
- package/dist/config/plugins/you-dont-need-lodash-underscore.js.map +1 -1
- package/dist/config/plugins/you-dont-need-momentjs.js +2 -0
- package/dist/config/plugins/you-dont-need-momentjs.js.map +1 -1
- package/dist/config/plugins/zod.js +2 -0
- package/dist/config/plugins/zod.js.map +1 -1
- package/dist/config/style.js +4 -2
- package/dist/config/variables.js +3 -2
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +8 -5
- package/dist/postinstall.js.map +1 -1
- package/dist/typescript-type-checking.js +4 -3
- package/dist/typescript-type-checking.js.map +1 -1
- package/package.json +17 -16
- package/dist/chunk-5IW32NSH.mjs +0 -5
- package/dist/chunk-5IW32NSH.mjs.map +0 -1
- package/dist/chunk-5S3UQ6WJ.js +0 -7
- package/dist/chunk-5S3UQ6WJ.js.map +0 -1
- package/dist/chunk-6SZIWSYU.mjs +0 -7
- package/dist/chunk-6SZIWSYU.mjs.map +0 -1
- package/dist/chunk-DJDHW6UR.mjs +0 -5
- package/dist/chunk-DJDHW6UR.mjs.map +0 -1
- package/dist/chunk-G7JIJH44.mjs +0 -5
- package/dist/chunk-G7JIJH44.mjs.map +0 -1
- package/dist/chunk-GGJONTGP.js +0 -7
- package/dist/chunk-GGJONTGP.js.map +0 -1
- package/dist/chunk-HRJ2DUAI.mjs +0 -7
- package/dist/chunk-HRJ2DUAI.mjs.map +0 -1
- package/dist/chunk-IDETTC6F.mjs +0 -5
- package/dist/chunk-IDETTC6F.mjs.map +0 -1
- package/dist/chunk-NE6XHV4I.js +0 -9
- package/dist/chunk-NE6XHV4I.js.map +0 -1
- package/dist/chunk-RWRS63WY.mjs +0 -7
- package/dist/chunk-SV64EPVP.js.map +0 -1
- package/dist/chunk-T6DHTHDB.mjs +0 -7
- package/dist/chunk-T6DHTHDB.mjs.map +0 -1
- package/dist/chunk-U5JQC7EA.mjs +0 -5
- package/dist/chunk-U5JQC7EA.mjs.map +0 -1
- package/dist/chunk-UJAIXHCQ.js.map +0 -1
- package/dist/chunk-VJL7NPM4.js.map +0 -1
- package/dist/chunk-XJPLKY3T.js +0 -9
- package/dist/chunk-XJPLKY3T.js.map +0 -1
- package/dist/chunk-YMWD4DNM.js.map +0 -1
- package/dist/config/best-practices.d.mts +0 -5
- package/dist/config/best-practices.mjs +0 -3
- package/dist/config/best-practices.mjs.map +0 -1
- package/dist/config/errors.d.mts +0 -5
- package/dist/config/errors.mjs +0 -3
- package/dist/config/errors.mjs.map +0 -1
- package/dist/config/es6.d.mts +0 -5
- package/dist/config/es6.mjs +0 -3
- package/dist/config/es6.mjs.map +0 -1
- package/dist/config/plugins/antfu.d.mts +0 -5
- package/dist/config/plugins/antfu.mjs +0 -8
- package/dist/config/plugins/antfu.mjs.map +0 -1
- package/dist/config/plugins/array-func.d.mts +0 -5
- package/dist/config/plugins/array-func.mjs +0 -7
- package/dist/config/plugins/array-func.mjs.map +0 -1
- package/dist/config/plugins/ava.d.mts +0 -5
- package/dist/config/plugins/ava.mjs +0 -5
- package/dist/config/plugins/ava.mjs.map +0 -1
- package/dist/config/plugins/babel.d.mts +0 -5
- package/dist/config/plugins/babel.mjs +0 -12
- package/dist/config/plugins/babel.mjs.map +0 -1
- package/dist/config/plugins/compat.d.mts +0 -5
- package/dist/config/plugins/compat.mjs +0 -5
- package/dist/config/plugins/compat.mjs.map +0 -1
- package/dist/config/plugins/cypress.d.mts +0 -5
- package/dist/config/plugins/cypress.mjs +0 -5
- package/dist/config/plugins/cypress.mjs.map +0 -1
- package/dist/config/plugins/es.d.mts +0 -5
- package/dist/config/plugins/es.mjs +0 -7
- package/dist/config/plugins/es.mjs.map +0 -1
- package/dist/config/plugins/eslint-comments.d.mts +0 -5
- package/dist/config/plugins/eslint-comments.mjs +0 -5
- package/dist/config/plugins/eslint-comments.mjs.map +0 -1
- package/dist/config/plugins/etc.d.mts +0 -5
- package/dist/config/plugins/etc.mjs +0 -7
- package/dist/config/plugins/etc.mjs.map +0 -1
- package/dist/config/plugins/html.d.mts +0 -5
- package/dist/config/plugins/html.mjs +0 -9
- package/dist/config/plugins/html.mjs.map +0 -1
- package/dist/config/plugins/import.d.mts +0 -5
- package/dist/config/plugins/import.mjs +0 -3
- package/dist/config/plugins/import.mjs.map +0 -1
- package/dist/config/plugins/jest-async.d.mts +0 -5
- package/dist/config/plugins/jest-async.mjs +0 -5
- package/dist/config/plugins/jest-async.mjs.map +0 -1
- package/dist/config/plugins/jest-dom.d.mts +0 -5
- package/dist/config/plugins/jest-dom.mjs +0 -5
- package/dist/config/plugins/jest-dom.mjs.map +0 -1
- package/dist/config/plugins/jest-formatting.d.mts +0 -5
- package/dist/config/plugins/jest-formatting.mjs +0 -5
- package/dist/config/plugins/jest-formatting.mjs.map +0 -1
- package/dist/config/plugins/jest.d.mts +0 -5
- package/dist/config/plugins/jest.mjs +0 -5
- package/dist/config/plugins/jest.mjs.map +0 -1
- package/dist/config/plugins/jsdoc.d.mts +0 -5
- package/dist/config/plugins/jsdoc.mjs +0 -9
- package/dist/config/plugins/jsdoc.mjs.map +0 -1
- package/dist/config/plugins/jsonc.d.mts +0 -5
- package/dist/config/plugins/jsonc.mjs +0 -14
- package/dist/config/plugins/jsonc.mjs.map +0 -1
- package/dist/config/plugins/jsx-a11y.d.mts +0 -5
- package/dist/config/plugins/jsx-a11y.mjs +0 -7
- package/dist/config/plugins/jsx-a11y.mjs.map +0 -1
- package/dist/config/plugins/lodash-fp.d.mts +0 -5
- package/dist/config/plugins/lodash-fp.mjs +0 -5
- package/dist/config/plugins/lodash-fp.mjs.map +0 -1
- package/dist/config/plugins/lodash.d.mts +0 -5
- package/dist/config/plugins/lodash.mjs +0 -5
- package/dist/config/plugins/lodash.mjs.map +0 -1
- package/dist/config/plugins/markdown.d.mts +0 -5
- package/dist/config/plugins/markdown.mjs +0 -5
- package/dist/config/plugins/markdown.mjs.map +0 -1
- package/dist/config/plugins/mdx.d.mts +0 -5
- package/dist/config/plugins/mdx.mjs +0 -5
- package/dist/config/plugins/mdx.mjs.map +0 -1
- package/dist/config/plugins/no-extend-native.d.mts +0 -5
- package/dist/config/plugins/no-extend-native.mjs +0 -5
- package/dist/config/plugins/no-extend-native.mjs.map +0 -1
- package/dist/config/plugins/no-loops.d.mts +0 -5
- package/dist/config/plugins/no-loops.mjs +0 -5
- package/dist/config/plugins/no-loops.mjs.map +0 -1
- package/dist/config/plugins/no-secrets.d.mts +0 -5
- package/dist/config/plugins/no-secrets.mjs +0 -5
- package/dist/config/plugins/no-secrets.mjs.map +0 -1
- package/dist/config/plugins/no-unsanitized.d.mts +0 -5
- package/dist/config/plugins/no-unsanitized.mjs +0 -5
- package/dist/config/plugins/no-unsanitized.mjs.map +0 -1
- package/dist/config/plugins/node.d.mts +0 -5
- package/dist/config/plugins/node.mjs +0 -7
- package/dist/config/plugins/node.mjs.map +0 -1
- package/dist/config/plugins/playwright.d.mts +0 -5
- package/dist/config/plugins/playwright.mjs +0 -7
- package/dist/config/plugins/playwright.mjs.map +0 -1
- package/dist/config/plugins/promise.d.mts +0 -5
- package/dist/config/plugins/promise.mjs +0 -5
- package/dist/config/plugins/promise.mjs.map +0 -1
- package/dist/config/plugins/react-hooks.d.mts +0 -5
- package/dist/config/plugins/react-hooks.mjs +0 -5
- package/dist/config/plugins/react-hooks.mjs.map +0 -1
- package/dist/config/plugins/react-redux.d.mts +0 -5
- package/dist/config/plugins/react-redux.mjs +0 -5
- package/dist/config/plugins/react-redux.mjs.map +0 -1
- package/dist/config/plugins/react.d.mts +0 -5
- package/dist/config/plugins/react.mjs +0 -19
- package/dist/config/plugins/react.mjs.map +0 -1
- package/dist/config/plugins/regexp.d.mts +0 -5
- package/dist/config/plugins/regexp.mjs +0 -7
- package/dist/config/plugins/regexp.mjs.map +0 -1
- package/dist/config/plugins/security.d.mts +0 -5
- package/dist/config/plugins/security.mjs +0 -5
- package/dist/config/plugins/security.mjs.map +0 -1
- package/dist/config/plugins/simple-import-sort.d.mts +0 -5
- package/dist/config/plugins/simple-import-sort.mjs +0 -5
- package/dist/config/plugins/simple-import-sort.mjs.map +0 -1
- package/dist/config/plugins/sonarjs.d.mts +0 -5
- package/dist/config/plugins/sonarjs.mjs +0 -7
- package/dist/config/plugins/sonarjs.mjs.map +0 -1
- package/dist/config/plugins/sort-keys-fix.d.mts +0 -5
- package/dist/config/plugins/sort-keys-fix.mjs +0 -5
- package/dist/config/plugins/sort-keys-fix.mjs.map +0 -1
- package/dist/config/plugins/storybook.d.mts +0 -5
- package/dist/config/plugins/storybook.mjs +0 -5
- package/dist/config/plugins/storybook.mjs.map +0 -1
- package/dist/config/plugins/tailwindcss.d.mts +0 -5
- package/dist/config/plugins/tailwindcss.mjs +0 -7
- package/dist/config/plugins/tailwindcss.mjs.map +0 -1
- package/dist/config/plugins/tanstack-query.d.mts +0 -5
- package/dist/config/plugins/tanstack-query.mjs +0 -7
- package/dist/config/plugins/tanstack-query.mjs.map +0 -1
- package/dist/config/plugins/testing-library.d.mts +0 -5
- package/dist/config/plugins/testing-library.mjs +0 -10
- package/dist/config/plugins/testing-library.mjs.map +0 -1
- package/dist/config/plugins/toml.d.mts +0 -5
- package/dist/config/plugins/toml.mjs +0 -5
- package/dist/config/plugins/toml.mjs.map +0 -1
- package/dist/config/plugins/tsdoc.d.mts +0 -5
- package/dist/config/plugins/tsdoc.mjs +0 -7
- package/dist/config/plugins/tsdoc.mjs.map +0 -1
- package/dist/config/plugins/typescript-sort-keys.d.mts +0 -5
- package/dist/config/plugins/typescript-sort-keys.mjs +0 -5
- package/dist/config/plugins/typescript-sort-keys.mjs.map +0 -1
- package/dist/config/plugins/typescript.d.mts +0 -5
- package/dist/config/plugins/typescript.mjs +0 -15
- package/dist/config/plugins/typescript.mjs.map +0 -1
- package/dist/config/plugins/unicorn.d.mts +0 -5
- package/dist/config/plugins/unicorn.mjs +0 -10
- package/dist/config/plugins/unicorn.mjs.map +0 -1
- package/dist/config/plugins/vitest.d.mts +0 -5
- package/dist/config/plugins/vitest.mjs +0 -5
- package/dist/config/plugins/vitest.mjs.map +0 -1
- package/dist/config/plugins/yml.d.mts +0 -5
- package/dist/config/plugins/yml.mjs +0 -9
- package/dist/config/plugins/yml.mjs.map +0 -1
- package/dist/config/plugins/you-dont-need-lodash-underscore.d.mts +0 -5
- package/dist/config/plugins/you-dont-need-lodash-underscore.mjs +0 -5
- package/dist/config/plugins/you-dont-need-lodash-underscore.mjs.map +0 -1
- package/dist/config/plugins/you-dont-need-momentjs.d.mts +0 -5
- package/dist/config/plugins/you-dont-need-momentjs.mjs +0 -5
- package/dist/config/plugins/you-dont-need-momentjs.mjs.map +0 -1
- package/dist/config/plugins/zod.d.mts +0 -5
- package/dist/config/plugins/zod.mjs +0 -5
- package/dist/config/plugins/zod.mjs.map +0 -1
- package/dist/config/style.d.mts +0 -5
- package/dist/config/style.mjs +0 -4
- package/dist/config/style.mjs.map +0 -1
- package/dist/config/variables.d.mts +0 -5
- package/dist/config/variables.mjs +0 -3
- package/dist/config/variables.mjs.map +0 -1
- package/dist/index.d.mts +0 -5
- package/dist/index.mjs +0 -18
- package/dist/index.mjs.map +0 -1
- package/dist/postinstall.d.mts +0 -2
- package/dist/postinstall.mjs +0 -63
- package/dist/postinstall.mjs.map +0 -1
- package/dist/typescript-type-checking.d.mts +0 -5
- package/dist/typescript-type-checking.mjs +0 -8
- package/dist/typescript-type-checking.mjs.map +0 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { a } from '../../chunk-HRJ2DUAI.mjs';
|
|
2
|
-
import '../../chunk-T6DHTHDB.mjs';
|
|
3
|
-
import { hasDependency, hasDevDependency } from '@anolilab/package-json-utils';
|
|
4
|
-
|
|
5
|
-
var t=a.rules;global.hasAnolilabEsLintConfigYamlPrettier||(global.hasAnolilabEsLintConfigYamlPrettier=hasDependency("prettier")||hasDevDependency("prettier"));var i={overrides:[{files:["*.yaml","*.yml"],extends:["plugin:yml/recommended",...global.hasAnolilabEsLintConfigYamlPrettier?["plugin:yml/prettier"]:[]],parser:"yaml-eslint-parser",rules:{"spaced-comment":"off",indent:["error",t.indent[1]]}}]},s=i;
|
|
6
|
-
|
|
7
|
-
export { s as default };
|
|
8
|
-
//# sourceMappingURL=out.js.map
|
|
9
|
-
//# sourceMappingURL=yml.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/plugins/yml.ts"],"names":["hasDependency","hasDevDependency","styleRules","style_default","config","yml_default"],"mappings":"8EAAA,OAAS,iBAAAA,EAAe,oBAAAC,MAAwB,+BAKhD,IAAMC,EAAaC,EAAY,MAE1B,OAAO,sCACR,OAAO,oCAAsCH,EAAc,UAAU,GAAKC,EAAiB,UAAU,GAGzG,IAAMG,EAAwB,CAC1B,UAAW,CACP,CACI,MAAO,CAAC,SAAU,OAAO,EACzB,QAAS,CAAC,yBAA0B,GAAI,OAAO,oCAAsC,CAAC,qBAAqB,EAAI,CAAC,CAAE,EAClH,OAAQ,qBACR,MAAO,CACH,iBAAkB,MAClB,OAAQ,CAAC,QAAUF,EAAW,OAAoB,CAAC,CAAW,CAClE,CACJ,CACJ,CACJ,EAEOG,EAAQD","sourcesContent":["import { hasDependency, hasDevDependency } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\n\nimport styleConfig from \"../style\";\n\nconst styleRules = styleConfig.rules as Linter.RulesRecord;\n\nif (!global.hasAnolilabEsLintConfigYamlPrettier) {\n global.hasAnolilabEsLintConfigYamlPrettier = hasDependency(\"prettier\") || hasDevDependency(\"prettier\");\n}\n\nconst config: Linter.Config = {\n overrides: [\n {\n files: [\"*.yaml\", \"*.yml\"],\n extends: [\"plugin:yml/recommended\", ...(global.hasAnolilabEsLintConfigYamlPrettier ? [\"plugin:yml/prettier\"] : [])],\n parser: \"yaml-eslint-parser\",\n rules: {\n \"spaced-comment\": \"off\",\n indent: [\"error\", (styleRules[\"indent\"] as any[])[1] as number],\n },\n },\n ],\n};\n\nexport default config;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/plugins/you-dont-need-lodash-underscore.ts"],"names":["config","you_dont_need_lodash_underscore_default"],"mappings":"AAEA,IAAMA,EAAwB,CAC1B,QAAS,CAAC,mDAAmD,CACjE,EAEOC,EAAQD","sourcesContent":["import type { Linter } from \"eslint\";\n\nconst config: Linter.Config = {\n extends: [\"plugin:you-dont-need-lodash-underscore/compatible\"],\n};\n\nexport default config;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/plugins/you-dont-need-momentjs.ts"],"names":["config","you_dont_need_momentjs_default"],"mappings":"AAEA,IAAMA,EAAwB,CAC1B,QAAS,CAAC,2CAA2C,CACzD,EAEOC,EAAQD","sourcesContent":["import type { Linter } from \"eslint\";\n\nconst config: Linter.Config = {\n extends: [\"plugin:you-dont-need-momentjs/recommended\"],\n};\n\nexport default config;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/plugins/zod.ts"],"names":["config","zod_default"],"mappings":"AAEA,IAAMA,EAAwB,CAC1B,QAAS,CAAC,KAAK,EACf,MAAO,CACH,kBAAmB,QACnB,qBAAsB,OAC1B,CACJ,EAEOC,EAAQD","sourcesContent":["import type { Linter } from \"eslint\";\n\nconst config: Linter.Config = {\n plugins: [\"zod\"],\n rules: {\n \"zod/prefer-enum\": \"error\",\n \"zod/require-strict\": \"error\",\n },\n};\n\nexport default config;\n"]}
|
package/dist/config/style.d.mts
DELETED
package/dist/config/style.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/index.d.mts
DELETED
package/dist/index.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { b as b$1, a as a$2 } from './chunk-G7JIJH44.mjs';
|
|
2
|
-
import { a as a$1 } from './chunk-T6DHTHDB.mjs';
|
|
3
|
-
import '@rushstack/eslint-patch/modern-module-resolution';
|
|
4
|
-
import { hasDependency, hasDevDependency, pkg, packageIsTypeModule } from '@anolilab/package-json-utils';
|
|
5
|
-
import { join } from 'path';
|
|
6
|
-
import w from 'semver';
|
|
7
|
-
|
|
8
|
-
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(a$1?.plugin?.[o]!==!1){let r=[];n.forEach(s=>{(hasDependency(s)||hasDevDependency(s))&&r.push(s);}),r.length===n.length?m.push(o):(f[o]={},n.forEach(s=>{f[o][s]=hasDependency(s)||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&&(b$1(`
|
|
9
|
-
@anolilab/eslint-config loaded the following plugins:
|
|
10
|
-
`),b$1(" @rushstack/eslint-plugin-security"),["compat","eslint-comments","i","promise","simple-import-sort","unicorn","no-secrets","sonarjs","json","jsonc","markdown","toml","yml","es",...l].forEach(n=>a$2(n)));let e=!1;Object.entries(y).forEach(([n,o])=>{Object.values(o).some(Boolean)&&(e=!0,b$1(`
|
|
11
|
-
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||b$1(` ${s}`);}));}),e&&(b$1(`
|
|
12
|
-
To disable this message, add the following to your package.json:`),b$1(` "anolilab": { "eslint-config": { plugin: { "plugin-name": false } } }
|
|
13
|
-
`)),b$1('To disable all logging, add the following to your eslint command call "NO_LOGS=true eslint ..."'),global.hasAnolilabEsLintConfigLoaded=!0;}var a={},c;pkg?.engines?.node&&(c=pkg.engines.node);Object.entries(b).forEach(([e,n])=>{Object.keys(n).sort(w.rcompare).forEach(o=>{c&&w.intersects(c,`<${o}`)&&(a[e]=n[o]);});});(hasDependency("prettier")||hasDevDependency("prettier"))&&(global.hasAnolilabEsLintConfigPrettier||(global.hasAnolilabEsLintConfigPrettier=!0,a$1?.info_on_disabling_prettier_conflict_rule!==!1&&b$1(`
|
|
14
|
-
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=>join(__dirname,`./config/${e}.${packageIsTypeModule?"m":""}js`)),...l.map(e=>join(__dirname,`./config/plugins/${e}.${packageIsTypeModule?"m":""}js`))],rules:{...a},overrides:[{files:["**/migrations/*.{js,ts}"],rules:{"filenames/match-regex":"off"}},{files:["**/*.spec.{js,ts,tsx}","**/*.test.{js,ts,tsx}","**/__mocks__/*.{js,ts,tsx}","**/__tests__/*.{js,ts,tsx}","**/test/*.{js,ts,tsx}"],rules:{"no-magic-numbers":"off","sonarjs/no-duplicate-string":"off"}}],ignorePatterns:["!.*",".git/","node_modules/","bower_components/","jspm_packages/",".npm/","lib-cov/","coverage/",".nyc_output/",".cache/","build/","dist/","tmp/","**/*.min.*","*.d.ts","pnpm-lock.yaml"]},M=P;
|
|
15
|
-
|
|
16
|
-
export { M as default };
|
|
17
|
-
//# sourceMappingURL=out.js.map
|
|
18
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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":"yFAYA,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,QACZ,aAAc,CAAC,sBAAuB,YAAY,CACtD,EACA,CACI,WAAY,SACZ,aAAc,CAAC,SAAU,sBAAsB,CACnD,EACA,CACI,WAAY,YACZ,aAAc,CAAC,SAAU,yBAAyB,CACtD,EACA,CACI,WAAY,kCACZ,aAAc,CAAC,SAAU,+CAA+C,CAC5E,EACA,CACI,WAAY,MACZ,aAAc,CAAC,mBAAmB,CACtC,EACA,CACI,WAAY,iBACZ,aAAc,CAAC,8BAA8B,CACjD,EACA,CACI,WAAY,QACZ,aAAc,CAAC,QAAS,YAAa,qBAAqB,CAC9D,EACA,CACI,WAAY,cACZ,aAAc,CAAC,2BAA2B,CAC9C,EACA,CACI,WAAY,WACZ,aAAc,CAAC,QAAS,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J,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"]}
|
package/dist/postinstall.d.mts
DELETED
package/dist/postinstall.mjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { projectPath, packageIsTypeModule } from '@anolilab/package-json-utils';
|
|
2
|
-
import { writeFile, existsSync, readFileSync } from 'fs';
|
|
3
|
-
import { join } from 'path';
|
|
4
|
-
import { promisify } from 'util';
|
|
5
|
-
|
|
6
|
-
process.env.CI&&process.exit(0);var f=promisify(writeFile);console.log("Configuring @anolilab/eslint-config",projectPath,`
|
|
7
|
-
`);var t=".eslintrc",d=()=>{for(let o of [t,`${t}.js`,`${t}.cjs`,`${t}.mjs`,`${t}.json`,`${t}.yaml`,`${t}.yml`])if(existsSync(join(projectPath,o)))return console.warn(`\u26A0\uFE0F ${o} already exists;
|
|
8
|
-
Make sure that it includes the following for @anolilab/eslint-config'
|
|
9
|
-
to work as it should: { extends: ["@anolilab/eslint-config"] }.`),Promise.resolve();let s=join(projectPath,".eslintrc.js"),a="",c=`
|
|
10
|
-
parserOptions: {
|
|
11
|
-
ecmaVersion: "latest",
|
|
12
|
-
sourceType: ${packageIsTypeModule?'"module"':'"commonjs"'},
|
|
13
|
-
},`,p=join(projectPath,"tsconfig.json");if(existsSync(p)){let o=JSON.parse(readFileSync(p,"utf8")),e="latest";o.compilerOptions?.target&&(e=o.compilerOptions.target,e=e.toLowerCase()==="es2022"||e.toLowerCase()==="esnext"?"latest":e.toLowerCase().replace("es",""),e!=="latest"&&e!=="2022"&&e!=="2021"&&e!=="6"&&(a=`, "plugin:es-x/restrict-to-es${e}"`)),c=`
|
|
14
|
-
parserOptions: {
|
|
15
|
-
project: "./tsconfig.json",
|
|
16
|
-
ecmaVersion: ${e==="latest"?`"${e}"`:e},
|
|
17
|
-
sourceType: ${packageIsTypeModule?'"module"':'"commonjs"'},
|
|
18
|
-
},`;}let m=`/** @ts-check */
|
|
19
|
-
/** @type {import('eslint').Linter.Config} */
|
|
20
|
-
${packageIsTypeModule?"export default":"module.exports ="} {
|
|
21
|
-
root: true,
|
|
22
|
-
extends: ["@anolilab/eslint-config"${a}],
|
|
23
|
-
ignorePatterns: ["!**/*"],
|
|
24
|
-
env: {
|
|
25
|
-
// Your environments (which contains several predefined global variables)
|
|
26
|
-
// Most environments are loaded automatically if our rules are added
|
|
27
|
-
},${c}
|
|
28
|
-
globals: {
|
|
29
|
-
// Your global variables (setting to false means it's not allowed to be reassigned)
|
|
30
|
-
// myGlobal: false
|
|
31
|
-
},
|
|
32
|
-
rules: {
|
|
33
|
-
// Customize your rules
|
|
34
|
-
},
|
|
35
|
-
overrides: [
|
|
36
|
-
{
|
|
37
|
-
files: [
|
|
38
|
-
"*.ts",
|
|
39
|
-
"*.tsx",
|
|
40
|
-
"*.mts",
|
|
41
|
-
"*.cts",
|
|
42
|
-
"*.js",
|
|
43
|
-
"*.jsx",
|
|
44
|
-
],
|
|
45
|
-
// Set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting
|
|
46
|
-
parserOptions: {},
|
|
47
|
-
rules: {},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
files: ["*.ts", "*.tsx", "*.mts", "*.cts"],
|
|
51
|
-
// Set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting
|
|
52
|
-
parserOptions: {},
|
|
53
|
-
rules: {},
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
files: ["*.js", "*.jsx"],
|
|
57
|
-
rules: {},
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
};
|
|
61
|
-
`;return f(s,m,"utf8")},w=()=>{let s=join(projectPath,".eslintignore");return existsSync(s)?(console.warn("\u26A0\uFE0F .eslintignore already exists"),Promise.resolve()):f(s,"","utf8")};(async()=>{try{await Promise.all([d(),w()]),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(s){console.log("\u{1F62C} something went wrong:"),console.error(s),process.exit(1);}})();
|
|
62
|
-
//# sourceMappingURL=out.js.map
|
|
63
|
-
//# sourceMappingURL=postinstall.mjs.map
|
package/dist/postinstall.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,OAAiB,GAAGA,QAAkB,GAAGA,QAAkB,GAAGA,SAAmB,GAAGA,SAAmB,GAAGA,OAAgB,EAC7J,GAAIN,EAAWG,EAAKJ,EAAaS,CAAQ,CAAC,EACtC,eAAQ,KAAK,iBAAOA;AAAA;AAAA,gEAEgC,EAE7C,QAAQ,QAAQ,EAI/B,IAAMC,EAAaN,EAAKJ,EAAa,cAAc,EAE/CW,EAAgB,GAChBC,EAAgB;AAAA;AAAA;AAAA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ASE,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["import { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\nimport { existsSync, readFileSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport type { TsConfigJson } from \"type-fest\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/eslint-config\", projectPath, \"\\n\");\n\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}.mjs`, `${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.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} */\n${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\n root: true,\n extends: [\"@anolilab/eslint-config\"${pluginExtends}],\n ignorePatterns: [\"!**/*\"],\n env: {\n // Your environments (which contains several predefined global variables)\n // Most environments are loaded automatically if our rules are added\n },${parserOptions}\n globals: {\n // Your global variables (setting to false means it's not allowed to be reassigned)\n // myGlobal: false\n },\n rules: {\n // Customize your rules\n },\n overrides: [\n {\n files: [\n \"*.ts\",\n \"*.tsx\",\n \"*.mts\",\n \"*.cts\",\n \"*.js\",\n \"*.jsx\",\n ],\n // Set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting\n parserOptions: {},\n rules: {},\n },\n {\n files: [\"*.ts\", \"*.tsx\", \"*.mts\", \"*.cts\"],\n // Set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting\n parserOptions: {},\n rules: {},\n },\n {\n files: [\"*.js\", \"*.jsx\"],\n rules: {},\n },\n ],\n};\n`;\n\n 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,8 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-U5JQC7EA.mjs';
|
|
2
|
-
import { a as a$1 } from './chunk-5IW32NSH.mjs';
|
|
3
|
-
|
|
4
|
-
var e=a.rules,i=a$1("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;
|
|
5
|
-
|
|
6
|
-
export { o as default };
|
|
7
|
-
//# sourceMappingURL=out.js.map
|
|
8
|
-
//# sourceMappingURL=typescript-type-checking.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/typescript-type-checking.ts"],"names":["bestPracticesRules","best_practices_default","config","createConfig","typescript_type_checking_default"],"mappings":"kFAKA,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"]}
|