@anolilab/eslint-config 5.0.9 → 6.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 +32 -0
- package/README.md +226 -73
- package/dist/chunk-3XUVOUJE.mjs +5 -0
- package/dist/chunk-3XUVOUJE.mjs.map +1 -0
- package/dist/chunk-6E2RGUNG.js +7 -0
- package/dist/chunk-6E2RGUNG.js.map +1 -0
- package/dist/chunk-ARKJLBXP.js +7 -0
- package/dist/chunk-ARKJLBXP.js.map +1 -0
- package/dist/chunk-B7GQAMYJ.js +9 -0
- package/dist/chunk-B7GQAMYJ.js.map +1 -0
- package/dist/chunk-DJDHW6UR.mjs +5 -0
- package/dist/chunk-DJDHW6UR.mjs.map +1 -0
- package/dist/chunk-F6JHPR4L.mjs +7 -0
- package/dist/chunk-F6JHPR4L.mjs.map +1 -0
- package/dist/chunk-G7JIJH44.mjs +5 -0
- package/dist/chunk-G7JIJH44.mjs.map +1 -0
- package/dist/chunk-NO36P4BR.js +9 -0
- package/dist/chunk-NO36P4BR.js.map +1 -0
- package/dist/chunk-PCIKFIV2.js +7 -0
- package/dist/chunk-PCIKFIV2.js.map +1 -0
- package/dist/chunk-RWRS63WY.mjs +7 -0
- package/dist/chunk-RWRS63WY.mjs.map +1 -0
- package/dist/chunk-SV64EPVP.js +7 -0
- package/dist/chunk-SV64EPVP.js.map +1 -0
- package/dist/chunk-UJAIXHCQ.js +13 -0
- package/dist/chunk-UJAIXHCQ.js.map +1 -0
- package/dist/chunk-WDMF75TJ.mjs +5 -0
- package/dist/chunk-WDMF75TJ.mjs.map +1 -0
- package/dist/chunk-WSETOOIE.mjs +5 -0
- package/dist/chunk-WSETOOIE.mjs.map +1 -0
- package/dist/chunk-XND2BWC4.mjs +7 -0
- package/dist/chunk-XND2BWC4.mjs.map +1 -0
- package/dist/chunk-YMWD4DNM.js +8 -0
- package/dist/chunk-YMWD4DNM.js.map +1 -0
- package/dist/config/best-practices.d.ts +5 -0
- package/dist/config/best-practices.js +9 -0
- package/dist/config/best-practices.js.map +1 -0
- package/dist/config/best-practices.mjs +3 -0
- package/dist/config/best-practices.mjs.map +1 -0
- package/dist/config/errors.d.ts +5 -0
- package/dist/config/errors.js +9 -0
- package/dist/config/errors.js.map +1 -0
- package/dist/config/errors.mjs +3 -0
- package/dist/config/errors.mjs.map +1 -0
- package/dist/config/es6.d.ts +5 -0
- package/dist/config/es6.js +9 -0
- package/dist/config/es6.js.map +1 -0
- package/dist/config/es6.mjs +3 -0
- package/dist/config/es6.mjs.map +1 -0
- package/dist/config/plugins/antfu.d.ts +5 -0
- package/dist/config/plugins/antfu.js +10 -0
- package/dist/config/plugins/antfu.js.map +1 -0
- package/dist/config/plugins/antfu.mjs +8 -0
- package/dist/config/plugins/antfu.mjs.map +1 -0
- package/dist/config/plugins/array-func.d.ts +5 -0
- package/dist/config/plugins/array-func.js +9 -0
- package/dist/config/plugins/array-func.js.map +1 -0
- package/dist/config/plugins/array-func.mjs +7 -0
- package/dist/config/plugins/array-func.mjs.map +1 -0
- package/dist/config/plugins/ava.d.ts +5 -0
- package/dist/config/plugins/ava.js +7 -0
- package/dist/config/plugins/ava.js.map +1 -0
- package/dist/config/plugins/ava.mjs +5 -0
- package/dist/config/plugins/ava.mjs.map +1 -0
- package/dist/config/plugins/babel.d.ts +5 -0
- package/dist/config/plugins/babel.js +12 -0
- package/dist/config/plugins/babel.js.map +1 -0
- package/dist/config/plugins/babel.mjs +10 -0
- package/dist/config/plugins/babel.mjs.map +1 -0
- package/dist/config/plugins/compat.d.ts +5 -0
- package/dist/config/plugins/compat.js +7 -0
- package/dist/config/plugins/compat.js.map +1 -0
- package/dist/config/plugins/compat.mjs +5 -0
- package/dist/config/plugins/compat.mjs.map +1 -0
- package/dist/config/plugins/cypress.d.ts +5 -0
- package/dist/config/plugins/cypress.js +7 -0
- package/dist/config/plugins/cypress.js.map +1 -0
- package/dist/config/plugins/cypress.mjs +5 -0
- package/dist/config/plugins/cypress.mjs.map +1 -0
- package/dist/config/plugins/es.d.ts +5 -0
- package/dist/config/plugins/es.js +7 -0
- package/dist/config/plugins/es.js.map +1 -0
- package/dist/config/plugins/es.mjs +5 -0
- package/dist/config/plugins/es.mjs.map +1 -0
- package/dist/config/plugins/eslint-comments.d.ts +5 -0
- package/dist/config/plugins/eslint-comments.js +7 -0
- package/dist/config/plugins/eslint-comments.js.map +1 -0
- package/dist/config/plugins/eslint-comments.mjs +5 -0
- package/dist/config/plugins/eslint-comments.mjs.map +1 -0
- package/dist/config/plugins/html.d.ts +5 -0
- package/dist/config/plugins/html.js +7 -0
- package/dist/config/plugins/html.js.map +1 -0
- package/dist/config/plugins/html.mjs +5 -0
- package/dist/config/plugins/html.mjs.map +1 -0
- package/dist/config/plugins/import.d.ts +5 -0
- package/dist/config/plugins/import.js +9 -0
- package/dist/config/plugins/import.js.map +1 -0
- package/dist/config/plugins/import.mjs +3 -0
- package/dist/config/plugins/import.mjs.map +1 -0
- package/dist/config/plugins/jest-async.d.ts +5 -0
- package/dist/config/plugins/jest-async.js +7 -0
- package/dist/config/plugins/jest-async.js.map +1 -0
- package/dist/config/plugins/jest-async.mjs +5 -0
- package/dist/config/plugins/jest-async.mjs.map +1 -0
- package/dist/config/plugins/jest-dom.d.ts +5 -0
- package/dist/config/plugins/jest-dom.js +7 -0
- package/dist/config/plugins/jest-dom.js.map +1 -0
- package/dist/config/plugins/jest-dom.mjs +5 -0
- package/dist/config/plugins/jest-dom.mjs.map +1 -0
- package/dist/config/plugins/jest-formatting.d.ts +5 -0
- package/dist/config/plugins/jest-formatting.js +7 -0
- package/dist/config/plugins/jest-formatting.js.map +1 -0
- package/dist/config/plugins/jest-formatting.mjs +5 -0
- package/dist/config/plugins/jest-formatting.mjs.map +1 -0
- package/dist/config/plugins/jest.d.ts +5 -0
- package/dist/config/plugins/jest.js +7 -0
- package/dist/config/plugins/jest.js.map +1 -0
- package/dist/config/plugins/jest.mjs +5 -0
- package/dist/config/plugins/jest.mjs.map +1 -0
- package/dist/config/plugins/jsdoc.d.ts +5 -0
- package/dist/config/plugins/jsdoc.js +11 -0
- package/dist/config/plugins/jsdoc.js.map +1 -0
- package/dist/config/plugins/jsdoc.mjs +9 -0
- package/dist/config/plugins/jsdoc.mjs.map +1 -0
- package/dist/config/plugins/jsonc.d.ts +5 -0
- package/dist/config/plugins/jsonc.js +11 -0
- package/dist/config/plugins/jsonc.js.map +1 -0
- package/dist/config/plugins/jsonc.mjs +9 -0
- package/dist/config/plugins/jsonc.mjs.map +1 -0
- package/dist/config/plugins/jsx-a11y.d.ts +5 -0
- package/dist/config/plugins/jsx-a11y.js +7 -0
- package/dist/config/plugins/jsx-a11y.js.map +1 -0
- package/dist/config/plugins/jsx-a11y.mjs +5 -0
- package/dist/config/plugins/jsx-a11y.mjs.map +1 -0
- package/dist/config/plugins/lodash-fp.d.ts +5 -0
- package/dist/config/plugins/lodash-fp.js +7 -0
- package/dist/config/plugins/lodash-fp.js.map +1 -0
- package/dist/config/plugins/lodash-fp.mjs +5 -0
- package/dist/config/plugins/lodash-fp.mjs.map +1 -0
- package/dist/config/plugins/lodash.d.ts +5 -0
- package/dist/config/plugins/lodash.js +7 -0
- package/dist/config/plugins/lodash.js.map +1 -0
- package/dist/config/plugins/lodash.mjs +5 -0
- package/dist/config/plugins/lodash.mjs.map +1 -0
- package/dist/config/plugins/markdown.d.ts +5 -0
- package/dist/config/plugins/markdown.js +7 -0
- package/dist/config/plugins/markdown.js.map +1 -0
- package/dist/config/plugins/markdown.mjs +5 -0
- package/dist/config/plugins/markdown.mjs.map +1 -0
- package/dist/config/plugins/mdx.d.ts +5 -0
- package/dist/config/plugins/mdx.js +7 -0
- package/dist/config/plugins/mdx.js.map +1 -0
- package/dist/config/plugins/mdx.mjs +5 -0
- package/dist/config/plugins/mdx.mjs.map +1 -0
- package/dist/config/plugins/no-extend-native.d.ts +5 -0
- package/dist/config/plugins/no-extend-native.js +7 -0
- package/dist/config/plugins/no-extend-native.js.map +1 -0
- package/dist/config/plugins/no-extend-native.mjs +5 -0
- package/dist/config/plugins/no-extend-native.mjs.map +1 -0
- package/dist/config/plugins/no-loops.d.ts +5 -0
- package/dist/config/plugins/no-loops.js +7 -0
- package/dist/config/plugins/no-loops.js.map +1 -0
- package/dist/config/plugins/no-loops.mjs +5 -0
- package/dist/config/plugins/no-loops.mjs.map +1 -0
- package/dist/config/plugins/no-secrets.d.ts +5 -0
- package/dist/config/plugins/no-secrets.js +7 -0
- package/dist/config/plugins/no-secrets.js.map +1 -0
- package/dist/config/plugins/no-secrets.mjs +5 -0
- package/dist/config/plugins/no-secrets.mjs.map +1 -0
- package/dist/config/plugins/no-unsanitized.d.ts +5 -0
- package/dist/config/plugins/no-unsanitized.js +7 -0
- package/dist/config/plugins/no-unsanitized.js.map +1 -0
- package/dist/config/plugins/no-unsanitized.mjs +5 -0
- package/dist/config/plugins/no-unsanitized.mjs.map +1 -0
- package/dist/config/plugins/node.d.ts +5 -0
- package/dist/config/plugins/node.js +9 -0
- package/dist/config/plugins/node.js.map +1 -0
- package/dist/config/plugins/node.mjs +7 -0
- package/dist/config/plugins/node.mjs.map +1 -0
- package/dist/config/plugins/optimize-regex.d.ts +5 -0
- package/dist/config/plugins/optimize-regex.js +7 -0
- package/dist/config/plugins/optimize-regex.js.map +1 -0
- package/dist/config/plugins/optimize-regex.mjs +5 -0
- package/dist/config/plugins/optimize-regex.mjs.map +1 -0
- package/dist/config/plugins/promise.d.ts +5 -0
- package/dist/config/plugins/promise.js +7 -0
- package/dist/config/plugins/promise.js.map +1 -0
- package/dist/config/plugins/promise.mjs +5 -0
- package/dist/config/plugins/promise.mjs.map +1 -0
- package/dist/config/plugins/react-hooks.d.ts +5 -0
- package/dist/config/plugins/react-hooks.js +7 -0
- package/dist/config/plugins/react-hooks.js.map +1 -0
- package/dist/config/plugins/react-hooks.mjs +5 -0
- package/dist/config/plugins/react-hooks.mjs.map +1 -0
- package/dist/config/plugins/react-redux.d.ts +5 -0
- package/dist/config/plugins/react-redux.js +7 -0
- package/dist/config/plugins/react-redux.js.map +1 -0
- package/dist/config/plugins/react-redux.mjs +5 -0
- package/dist/config/plugins/react-redux.mjs.map +1 -0
- package/dist/config/plugins/react.d.ts +5 -0
- package/dist/config/plugins/react.js +21 -0
- package/dist/config/plugins/react.js.map +1 -0
- package/dist/config/plugins/react.mjs +15 -0
- package/dist/config/plugins/react.mjs.map +1 -0
- package/dist/config/plugins/security.d.ts +5 -0
- package/dist/config/plugins/security.js +7 -0
- package/dist/config/plugins/security.js.map +1 -0
- package/dist/config/plugins/security.mjs +5 -0
- package/dist/config/plugins/security.mjs.map +1 -0
- package/dist/config/plugins/simple-import-sort.d.ts +5 -0
- package/dist/config/plugins/simple-import-sort.js +7 -0
- package/dist/config/plugins/simple-import-sort.js.map +1 -0
- package/dist/config/plugins/simple-import-sort.mjs +5 -0
- package/dist/config/plugins/simple-import-sort.mjs.map +1 -0
- package/dist/config/plugins/sonarjs.d.ts +5 -0
- package/dist/config/plugins/sonarjs.js +7 -0
- package/dist/config/plugins/sonarjs.js.map +1 -0
- package/dist/config/plugins/sonarjs.mjs +5 -0
- package/dist/config/plugins/sonarjs.mjs.map +1 -0
- package/dist/config/plugins/sort-keys-fix.d.ts +5 -0
- package/dist/config/plugins/sort-keys-fix.js +7 -0
- package/dist/config/plugins/sort-keys-fix.js.map +1 -0
- package/dist/config/plugins/sort-keys-fix.mjs +5 -0
- package/dist/config/plugins/sort-keys-fix.mjs.map +1 -0
- package/dist/config/plugins/tailwindcss.d.ts +5 -0
- package/dist/config/plugins/tailwindcss.js +7 -0
- package/dist/config/plugins/tailwindcss.js.map +1 -0
- package/dist/config/plugins/tailwindcss.mjs +5 -0
- package/dist/config/plugins/tailwindcss.mjs.map +1 -0
- package/dist/config/plugins/testing-library.d.ts +5 -0
- package/dist/config/plugins/testing-library.js +10 -0
- package/dist/config/plugins/testing-library.js.map +1 -0
- package/dist/config/plugins/testing-library.mjs +8 -0
- package/dist/config/plugins/testing-library.mjs.map +1 -0
- package/dist/config/plugins/toml.d.ts +5 -0
- package/dist/config/plugins/toml.js +7 -0
- package/dist/config/plugins/toml.js.map +1 -0
- package/dist/config/plugins/toml.mjs +5 -0
- package/dist/config/plugins/toml.mjs.map +1 -0
- package/dist/config/plugins/tsdoc.d.ts +5 -0
- package/dist/config/plugins/tsdoc.js +9 -0
- package/dist/config/plugins/tsdoc.js.map +1 -0
- package/dist/config/plugins/tsdoc.mjs +7 -0
- package/dist/config/plugins/tsdoc.mjs.map +1 -0
- package/dist/config/plugins/typescript-sort-keys.d.ts +5 -0
- package/dist/config/plugins/typescript-sort-keys.js +7 -0
- package/dist/config/plugins/typescript-sort-keys.js.map +1 -0
- package/dist/config/plugins/typescript-sort-keys.mjs +5 -0
- package/dist/config/plugins/typescript-sort-keys.mjs.map +1 -0
- package/dist/config/plugins/typescript.d.ts +5 -0
- package/dist/config/plugins/typescript.js +18 -0
- package/dist/config/plugins/typescript.js.map +1 -0
- package/dist/config/plugins/typescript.mjs +16 -0
- package/dist/config/plugins/typescript.mjs.map +1 -0
- package/dist/config/plugins/unicorn.d.ts +5 -0
- package/dist/config/plugins/unicorn.js +15 -0
- package/dist/config/plugins/unicorn.js.map +1 -0
- package/dist/config/plugins/unicorn.mjs +9 -0
- package/dist/config/plugins/unicorn.mjs.map +1 -0
- package/dist/config/plugins/vitest.d.ts +5 -0
- package/dist/config/plugins/vitest.js +7 -0
- package/dist/config/plugins/vitest.js.map +1 -0
- package/dist/config/plugins/vitest.mjs +5 -0
- package/dist/config/plugins/vitest.mjs.map +1 -0
- package/dist/config/plugins/yml.d.ts +5 -0
- package/dist/config/plugins/yml.js +7 -0
- package/dist/config/plugins/yml.js.map +1 -0
- package/dist/config/plugins/yml.mjs +5 -0
- package/dist/config/plugins/yml.mjs.map +1 -0
- package/dist/config/plugins/you-dont-need-lodash-underscore.d.ts +5 -0
- package/dist/config/plugins/you-dont-need-lodash-underscore.js +7 -0
- package/dist/config/plugins/you-dont-need-lodash-underscore.js.map +1 -0
- package/dist/config/plugins/you-dont-need-lodash-underscore.mjs +5 -0
- package/dist/config/plugins/you-dont-need-lodash-underscore.mjs.map +1 -0
- package/dist/config/plugins/you-dont-need-momentjs.d.ts +5 -0
- package/dist/config/plugins/you-dont-need-momentjs.js +7 -0
- package/dist/config/plugins/you-dont-need-momentjs.js.map +1 -0
- package/dist/config/plugins/you-dont-need-momentjs.mjs +5 -0
- package/dist/config/plugins/you-dont-need-momentjs.mjs.map +1 -0
- package/dist/config/plugins/zod.d.ts +5 -0
- package/dist/config/plugins/zod.js +7 -0
- package/dist/config/plugins/zod.js.map +1 -0
- package/dist/config/plugins/zod.mjs +5 -0
- package/dist/config/plugins/zod.mjs.map +1 -0
- package/dist/config/style.d.ts +5 -0
- package/dist/config/style.js +9 -0
- package/dist/config/style.js.map +1 -0
- package/dist/config/style.mjs +3 -0
- package/dist/config/style.mjs.map +1 -0
- package/dist/config/variables.d.ts +5 -0
- package/dist/config/variables.js +9 -0
- package/dist/config/variables.js.map +1 -0
- package/dist/config/variables.mjs +3 -0
- package/dist/config/variables.mjs.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +16 -0
- package/dist/index.mjs.map +1 -0
- package/dist/postinstall.d.ts +2 -0
- package/dist/postinstall.js +65 -0
- package/dist/postinstall.js.map +1 -0
- package/dist/postinstall.mjs +63 -0
- package/dist/postinstall.mjs.map +1 -0
- package/dist/typescript-type-checking.d.ts +5 -0
- package/dist/typescript-type-checking.js +10 -0
- package/dist/typescript-type-checking.js.map +1 -0
- package/dist/typescript-type-checking.mjs +8 -0
- package/dist/typescript-type-checking.mjs.map +1 -0
- package/package.json +106 -50
- package/config.cjs +0 -88
- package/index.cjs +0 -58
- package/lib/check-missing.cjs +0 -57
- package/lib/is-module-available.cjs +0 -8
- package/lib/loggers.cjs +0 -12
- package/lib/postinstall.cjs +0 -115
- package/lib/show-loaded.cjs +0 -21
- package/lib/utils.cjs +0 -90
- package/rules/best-practices.cjs +0 -395
- package/rules/errors.cjs +0 -177
- package/rules/es6.cjs +0 -217
- package/rules/plugins/array-func.cjs +0 -13
- package/rules/plugins/babel.cjs +0 -36
- package/rules/plugins/compat.cjs +0 -3
- package/rules/plugins/cypress.cjs +0 -13
- package/rules/plugins/eslint-comments.cjs +0 -11
- package/rules/plugins/html.cjs +0 -3
- package/rules/plugins/import.cjs +0 -265
- package/rules/plugins/jest-async.cjs +0 -6
- package/rules/plugins/jest-dom.cjs +0 -3
- package/rules/plugins/jest-formatting.cjs +0 -3
- package/rules/plugins/jest.cjs +0 -43
- package/rules/plugins/jsdoc.cjs +0 -4
- package/rules/plugins/json.cjs +0 -40
- package/rules/plugins/jsonc.cjs +0 -70
- package/rules/plugins/jsx-a11y.cjs +0 -261
- package/rules/plugins/lodash-fp.cjs +0 -7
- package/rules/plugins/lodash.cjs +0 -52
- package/rules/plugins/markdown.cjs +0 -32
- package/rules/plugins/mdx.cjs +0 -4
- package/rules/plugins/no-loops.cjs +0 -7
- package/rules/plugins/no-secrets.cjs +0 -20
- package/rules/plugins/no-unsanitized.cjs +0 -8
- package/rules/plugins/node.cjs +0 -44
- package/rules/plugins/optimize-regex.cjs +0 -6
- package/rules/plugins/promise.cjs +0 -9
- package/rules/plugins/react-hooks.cjs +0 -20
- package/rules/plugins/react-redux.cjs +0 -9
- package/rules/plugins/react.cjs +0 -659
- package/rules/plugins/simple-import-sort.cjs +0 -10
- package/rules/plugins/sonarjs.cjs +0 -5
- package/rules/plugins/sort-keys-fix.cjs +0 -6
- package/rules/plugins/tailwindcss.cjs +0 -4
- package/rules/plugins/testing-library.cjs +0 -34
- package/rules/plugins/toml.cjs +0 -9
- package/rules/plugins/typescript-sort-keys.cjs +0 -19
- package/rules/plugins/typescript.cjs +0 -427
- package/rules/plugins/unicorn.cjs +0 -20
- package/rules/plugins/yml.cjs +0 -12
- package/rules/plugins/you-dont-need-lodash-underscore.cjs +0 -3
- package/rules/plugins/you-dont-need-momentjs.cjs +0 -3
- package/rules/style.cjs +0 -629
- package/rules/variables.cjs +0 -54
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
## @anolilab/eslint-config [6.0.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@5.0.10...@anolilab/eslint-config@6.0.0) (2023-06-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### ⚠ BREAKING CHANGES
|
|
5
|
+
|
|
6
|
+
* Changed package to support cjs and mjs, updated depracated and disabled rules
|
|
7
|
+
|
|
8
|
+
Signed-off-by: prisis <d.bannert@anolilab.de>
|
|
9
|
+
|
|
10
|
+
### Performance Improvements
|
|
11
|
+
|
|
12
|
+
* changed eslint-config to a comprehensive eslint code style, added new rules for ava, antfu ,zod, vitest , updated depracated and disabled rules, Added a better readme and adjusted logger output to container more infos, Added engine rules, rules will be added based on the engine version or tscofnig target, Moved eslint typescript linting to a new file `typescript-type-checking` to improve eslint speed., Updated postinstall script to be more adaptive to the environment, Added @rushstack/eslint-patch ([4f195d4](https://github.com/anolilab/javascript-style-guide/commit/4f195d43b723dbf0d0ca33d9eda1cccf426555c5))
|
|
13
|
+
|
|
14
|
+
## @anolilab/eslint-config [5.1.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@5.0.10...@anolilab/eslint-config@5.1.0) (2023-06-16)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* added ava updated readme ([151b373](https://github.com/anolilab/javascript-style-guide/commit/151b37348076fc14f5e33d7654fc7fe95085987d))
|
|
20
|
+
* added some antfu rules ([53e7483](https://github.com/anolilab/javascript-style-guide/commit/53e748338de7fd3f28ffab788dbce5a3f180455e))
|
|
21
|
+
* changed files to ts ([ec9b148](https://github.com/anolilab/javascript-style-guide/commit/ec9b148fec7d149208826f38cb9136f347d4497a))
|
|
22
|
+
* optimized some rules ([31356f8](https://github.com/anolilab/javascript-style-guide/commit/31356f8e461039e234627a55fe609508e20b7f70))
|
|
23
|
+
* transformed all files to ts, added new config loader, added better logger info ([00a7a91](https://github.com/anolilab/javascript-style-guide/commit/00a7a912c3dbe3f03690163e4ef6ee3ca42d6028))
|
|
24
|
+
* update README.md ([1981a0f](https://github.com/anolilab/javascript-style-guide/commit/1981a0f42ca5ea00cbe8c75c3875c7b46db931f0))
|
|
25
|
+
|
|
26
|
+
## @anolilab/eslint-config [5.0.10](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@5.0.9...@anolilab/eslint-config@5.0.10) (2023-06-16)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* added missing n in vitest.cofig.* ([16fe216](https://github.com/anolilab/javascript-style-guide/commit/16fe21611b08c6ed61c39ed93277a49ff8967b73))
|
|
32
|
+
|
|
1
33
|
## @anolilab/eslint-config [5.0.9](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@5.0.8...@anolilab/eslint-config@5.0.9) (2023-06-15)
|
|
2
34
|
|
|
3
35
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
# ESLint config
|
|
1
|
+
# Anolilab ESLint config
|
|
2
2
|
|
|
3
|
-
This package provides Anolilab’s
|
|
3
|
+
This package provides Anolilab’s most comprehensive code style guide as an extensible shared config.
|
|
4
|
+
|
|
5
|
+
With a range of useful plugins that are often too time-consuming to setup, based on your project’s dependencies we will notify you about missing eslint plugins.
|
|
6
|
+
|
|
7
|
+
The goal is to reduce noise in code version control and promote use of the latest ES features.
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
|
|
11
|
+
[![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url]
|
|
12
|
+
|
|
13
|
+
</div>
|
|
4
14
|
|
|
5
15
|
---
|
|
6
16
|
|
|
@@ -14,12 +24,31 @@ This package provides Anolilab’s .eslintrc.cjs as an extensible shared config,
|
|
|
14
24
|
|
|
15
25
|
---
|
|
16
26
|
|
|
27
|
+
## Highlights
|
|
28
|
+
|
|
29
|
+
- Zero-config, but configurable when needed.
|
|
30
|
+
- Enforces readable code, because you read more code than you write.
|
|
31
|
+
- No need to specify file paths to lint as it lints all JS/TS files except for commonly ignored paths.
|
|
32
|
+
- Config overrides per files/globs.
|
|
33
|
+
- TypeScript supported by default, if `typescript` was installed.
|
|
34
|
+
- Includes many useful ESLint plugins, like [unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn), [import](https://github.com/benmosher/eslint-plugin-import) and [more](#plugins).
|
|
35
|
+
- Automatically enables rules based on the [engines](https://docs.npmjs.com/files/package.json#engines) field in your package.json.
|
|
36
|
+
- Specify indent and semicolon preferences easily without messing with the rule config.
|
|
37
|
+
|
|
17
38
|
## Install
|
|
18
39
|
|
|
19
40
|
To install this config, run the following command.
|
|
20
41
|
|
|
21
42
|
```bash
|
|
22
|
-
|
|
43
|
+
npm install eslint @anolilab/eslint-config --save-dev
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
yarn add -D eslint @anolilab/eslint-config
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
pnpm add -D eslint @anolilab/eslint-config
|
|
23
52
|
```
|
|
24
53
|
|
|
25
54
|
## Usage
|
|
@@ -52,7 +81,7 @@ module.exports = {
|
|
|
52
81
|
},
|
|
53
82
|
rules: {
|
|
54
83
|
// Customize your rules
|
|
55
|
-
}
|
|
84
|
+
},
|
|
56
85
|
};
|
|
57
86
|
```
|
|
58
87
|
|
|
@@ -61,38 +90,68 @@ For more advanced use cases see the example configurations for Node, TypeScript,
|
|
|
61
90
|
> Note: `@anolilab/eslint-config` will handle the configuration for almost all eslint-plugins / eslint-configs automatically.
|
|
62
91
|
> With this you only need to install the needed plugins/configs for TypeScript or React and you done.
|
|
63
92
|
|
|
64
|
-
###
|
|
93
|
+
### TypeScript
|
|
65
94
|
|
|
66
95
|
```bash
|
|
67
|
-
npm install --save-dev eslint
|
|
96
|
+
npm install --save-dev eslint typescript @anolilab/eslint-config
|
|
68
97
|
```
|
|
69
98
|
|
|
70
|
-
|
|
99
|
+
Please extend the `.eslintrc.cjs` file with the correct `tsconfig.js` path if you have a custom path.
|
|
71
100
|
|
|
72
|
-
```
|
|
73
|
-
|
|
101
|
+
```js
|
|
102
|
+
module.exports = {
|
|
103
|
+
parserOptions: {
|
|
104
|
+
project: "./tsconfig.eslint.json",
|
|
105
|
+
},
|
|
106
|
+
};
|
|
74
107
|
```
|
|
75
108
|
|
|
76
|
-
|
|
109
|
+
For projects that use TypeScript and want additional rules that require type information (rules using type information take longer to run).
|
|
77
110
|
|
|
78
|
-
|
|
79
|
-
|
|
111
|
+
Extend the `.eslintrc.cjs` file:
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
module.children = {
|
|
115
|
+
root: true,
|
|
116
|
+
extends: ["@anolilab/eslint-config", "@anolilab/eslint-config/typescript-type-checking"],
|
|
117
|
+
env: {
|
|
118
|
+
// Your environments (which contains several predefined global variables)
|
|
119
|
+
//
|
|
120
|
+
// browser: true,
|
|
121
|
+
// node: true,
|
|
122
|
+
// mocha: true,
|
|
123
|
+
// jest: true,
|
|
124
|
+
// jquery: true
|
|
125
|
+
},
|
|
126
|
+
globals: {
|
|
127
|
+
// Your global variables (setting to false means it's not allowed to be reassigned)
|
|
128
|
+
//
|
|
129
|
+
// myGlobal: false
|
|
130
|
+
},
|
|
131
|
+
rules: {
|
|
132
|
+
// Customize your rules
|
|
133
|
+
},
|
|
134
|
+
};
|
|
80
135
|
```
|
|
81
136
|
|
|
82
|
-
|
|
137
|
+
### React
|
|
138
|
+
|
|
139
|
+
You need to have "react" and "react-dom" installed.
|
|
83
140
|
|
|
84
141
|
```bash
|
|
85
|
-
npm install --save-dev eslint
|
|
142
|
+
npm install --save-dev eslint eslint-plugin-react eslint-plugin-react-hooks @anolilab/eslint-config
|
|
86
143
|
```
|
|
87
144
|
|
|
88
|
-
|
|
145
|
+
Or for the use of `TypeScript` in react install "typescript" as a dev dependency.
|
|
146
|
+
|
|
147
|
+
Please extend the `.eslintrc.cjs` file with the correct `tsconfig.js` path if you have a custom path.
|
|
89
148
|
|
|
90
149
|
```js
|
|
91
|
-
|
|
150
|
+
module.exports = {
|
|
92
151
|
parserOptions: {
|
|
93
152
|
project: "./tsconfig.eslint.json",
|
|
94
153
|
},
|
|
95
|
-
}
|
|
154
|
+
};
|
|
96
155
|
```
|
|
97
156
|
|
|
98
157
|
### MDX
|
|
@@ -101,11 +160,61 @@ export default {
|
|
|
101
160
|
npm install --save-dev eslint eslint-plugin-mdx @anolilab/eslint-config
|
|
102
161
|
```
|
|
103
162
|
|
|
163
|
+
### Config
|
|
164
|
+
|
|
165
|
+
You can configure `@anolilab/eslint-config` options with your `package.json` file.
|
|
166
|
+
|
|
167
|
+
Add this property to your package.json:
|
|
168
|
+
|
|
169
|
+
```json5
|
|
170
|
+
{
|
|
171
|
+
anolilab: {
|
|
172
|
+
"eslint-config": {
|
|
173
|
+
// options
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
#### indent
|
|
180
|
+
|
|
181
|
+
Type: `number`
|
|
182
|
+
|
|
183
|
+
Default: `4`
|
|
184
|
+
|
|
185
|
+
It will throw an error if the value is not numeric.
|
|
186
|
+
|
|
187
|
+
#### plugin
|
|
188
|
+
|
|
189
|
+
Type: `object` -> key: `string` value: `boolean`
|
|
190
|
+
|
|
191
|
+
Disable a plugin in your package.json config to turn it off globally in your project.
|
|
192
|
+
|
|
193
|
+
Example using package.json:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"anolilab": {
|
|
198
|
+
"eslint-config": {
|
|
199
|
+
"plugin": {
|
|
200
|
+
"unicorn": false
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
#### warn_on_unsupported_typescript_version
|
|
208
|
+
|
|
209
|
+
Type: `boolean`
|
|
210
|
+
|
|
211
|
+
Default: `false`
|
|
212
|
+
|
|
104
213
|
### Let [Prettier](https://prettier.io/) handle style-related rules
|
|
105
214
|
|
|
106
215
|
Prettier is a code formatting tool that offers fewer options but is more professional than the style-related rules in ESLint.
|
|
107
216
|
|
|
108
|
-
Now that Prettier has become a necessary tool in front end projects, eslint-config
|
|
217
|
+
Now that Prettier has become a necessary tool in front end projects, `@anolilab/eslint-config` does not need to maintain the style-related rules in ESLint anymore, so we completely removed all Prettier related rules in the v3 version, and use ESLint to check logical errors which it’s good at.
|
|
109
218
|
|
|
110
219
|
As for whether two spaces or four spaces are used for indentation and whether there is a semicolon at the end, you can configure it in the project’s .prettierrc.cjs. Of course, we also provide a recommended Prettier configuration for your reference.
|
|
111
220
|
|
|
@@ -126,55 +235,68 @@ npm install --save-dev @babel/eslint-parser
|
|
|
126
235
|
### Code Quality
|
|
127
236
|
|
|
128
237
|
This plugin provide a range of code quality rules:
|
|
129
|
-
|
|
238
|
+
|
|
239
|
+
- [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
|
|
130
240
|
|
|
131
241
|
### Languages
|
|
242
|
+
|
|
132
243
|
The following plugins expand esLint to work with json files, and lint JavaScript contained in HTML, and MarkDown:
|
|
133
244
|
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
245
|
+
- [eslint-plugin-html](https://github.com/BenoitZugmeyer/eslint-plugin-html)
|
|
246
|
+
- [eslint-plugin-jsonc](https://github.com/ota-meshi/eslint-plugin-jsonc)
|
|
247
|
+
- [eslint-plugin-markdown](https://github.com/eslint/eslint-plugin-markdown)
|
|
248
|
+
- [eslint-plugin-mdx](https://github.com/mdx-js/eslint-mdx)
|
|
249
|
+
- [eslint-plugin-toml](https://github.com/ota-meshi/eslint-plugin-toml)
|
|
250
|
+
- [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml)
|
|
137
251
|
|
|
138
|
-
When linting code snippets in Markdown files, a few [rules](rules/plugins/markdown.cjs#L3) relating to globals and unused vars are disabled.
|
|
252
|
+
When linting code snippets in Markdown files, a few [rules](src/rules/plugins/markdown.cjs#L3) relating to globals and unused vars are disabled.
|
|
139
253
|
|
|
140
254
|
### Library Plugins
|
|
141
255
|
|
|
142
|
-
|
|
256
|
+
If a supported library is part of your project then it’s related esLint plugins will be loaded. The following plugins are supported:
|
|
143
257
|
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
258
|
+
- [eslint-plugin-fsa](https://github.com/joseph-galindo/eslint-plugin-fsa)
|
|
259
|
+
- [eslint-plugin-lodash](https://github.com/wix/eslint-plugin-lodash)
|
|
260
|
+
- You need to install `eslint-plugin-lodash` and `lodash` to use this plugin.
|
|
261
|
+
- [eslint-plugin-lodash-fp](https://github.com/jfmengels/eslint-plugin-lodash-fp)
|
|
262
|
+
- You need to install `eslint-plugin-lodash-fp` and `lodash` to use this plugin.
|
|
263
|
+
- [eslint-plugin-react-redux](https://github.com/DianaSuvorova/eslint-plugin-react-redux#readme)
|
|
264
|
+
- You need to install `eslint-plugin-react-redux` and `react-redux` to use this plugin.
|
|
265
|
+
- [eslint-plugin-redux-saga](https://github.com/pke/eslint-plugin-redux-saga)
|
|
266
|
+
- You need to install `eslint-plugin-redux-saga` and `redux-saga` to use this plugin.
|
|
149
267
|
|
|
150
268
|
### Practices
|
|
151
269
|
|
|
152
270
|
The following esLint plugins enforce good coding practices:
|
|
153
271
|
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
- [eslint-plugin-switch-case](https://github.com/lukeapage/eslint-plugin-switch-case)
|
|
272
|
+
- [eslint-plugin-array-func](https://github.com/freaktechnik/eslint-plugin-array-func)
|
|
273
|
+
- [eslint-plugin-eslint-comments](https://github.com/mysticatea/eslint-plugin-eslint-comments)
|
|
274
|
+
- [eslint-plugin-optimize-regex](https://github.com/BrainMaestro/eslint-plugin-optimize-regex)
|
|
275
|
+
- [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise)
|
|
276
|
+
- [eslint-plugin-no-loops](https://github.com/buildo/eslint-plugin-no-loops)
|
|
277
|
+
- [eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort)
|
|
278
|
+
- [eslint-plugin-es](https://github.com/mysticatea/eslint-plugin-es)
|
|
162
279
|
|
|
163
280
|
### Security
|
|
164
281
|
|
|
165
282
|
These plugins add code security rules to esLint:
|
|
166
283
|
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
284
|
+
- [eslint-plugin-no-secrets](https://github.com/nickdeis/eslint-plugin-no-secrets)
|
|
285
|
+
- [eslint-plugin-no-unsanitized](https://github.com/mozilla/eslint-plugin-no-unsanitized)
|
|
286
|
+
- [eslint-plugin-sonarjs](https://github.com/SonarSource/eslint-plugin-sonarjs)
|
|
170
287
|
|
|
171
288
|
### Test Libraries
|
|
172
289
|
|
|
173
|
-
|
|
290
|
+
The following test plugins are supported:
|
|
174
291
|
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
292
|
+
- [eslint-plugin-ava](https://github.com/avajs/eslint-plugin-ava)
|
|
293
|
+
- You need to install `eslint-plugin-ava` and `ava` to use this plugin.
|
|
294
|
+
- [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest)
|
|
295
|
+
- You need to install `eslint-plugin-jest` and `jest` to use this plugin.
|
|
296
|
+
- [eslint-plugin-jest-async](https://www.npmjs.com/package/eslint-plugin-jest-async)
|
|
297
|
+
- You need to install `eslint-plugin-jest-async` and `jest` to use this plugin.
|
|
298
|
+
- [eslint-plugin-cypress](https://github.com/cypress-io/eslint-plugin-cypress)
|
|
299
|
+
- You need to install `eslint-plugin-cypress` and `cypress` to use this plugin.
|
|
178
300
|
|
|
179
301
|
### List of used plugins
|
|
180
302
|
|
|
@@ -202,13 +324,7 @@ ESLint will not lint `.vue`, `.ts` or `.tsx` files in VSCode by default, you nee
|
|
|
202
324
|
|
|
203
325
|
```json
|
|
204
326
|
{
|
|
205
|
-
|
|
206
|
-
"javascript",
|
|
207
|
-
"javascriptreact",
|
|
208
|
-
"vue",
|
|
209
|
-
"typescript",
|
|
210
|
-
"typescriptreact"
|
|
211
|
-
]
|
|
327
|
+
"eslint.validate": ["css", "html", "javascript", "javascriptreact", "json", "markdown", "typescript", "typescriptreact", "yaml"]
|
|
212
328
|
}
|
|
213
329
|
```
|
|
214
330
|
|
|
@@ -218,33 +334,63 @@ If you want to enable auto-fix-on-save, you need to set your `.vscode/settings.j
|
|
|
218
334
|
|
|
219
335
|
```json
|
|
220
336
|
{
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
337
|
+
"editor.codeActionsOnSave": {
|
|
338
|
+
"source.fixAll.eslint": true
|
|
339
|
+
},
|
|
340
|
+
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
|
341
|
+
"editor.formatOnSave": true
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
Additionally, we found it that being explicit about which formatter you are using for each file improves DX:
|
|
346
|
+
|
|
347
|
+
```json
|
|
348
|
+
{
|
|
349
|
+
"[css]": {
|
|
350
|
+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
351
|
+
},
|
|
352
|
+
"[html]": {
|
|
353
|
+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
354
|
+
},
|
|
355
|
+
"[javascript]": {
|
|
356
|
+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
357
|
+
},
|
|
358
|
+
"[javascriptreact]": {
|
|
359
|
+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
360
|
+
},
|
|
361
|
+
"[json]": {
|
|
362
|
+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
363
|
+
},
|
|
364
|
+
"[markdown]": {
|
|
365
|
+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
366
|
+
},
|
|
367
|
+
"[typescript]": {
|
|
368
|
+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
369
|
+
},
|
|
370
|
+
"[typescriptreact]": {
|
|
371
|
+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
372
|
+
},
|
|
373
|
+
"[yaml]": {
|
|
374
|
+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
375
|
+
}
|
|
225
376
|
}
|
|
226
377
|
```
|
|
227
378
|
|
|
228
|
-
|
|
379
|
+
While not required if you've configured explicit formatter for each file type, I advise that you explicitly disable prettier extension in your project:
|
|
229
380
|
|
|
230
381
|
```json
|
|
231
382
|
{
|
|
232
|
-
|
|
233
|
-
"editor.tabSize": 2,
|
|
234
|
-
"editor.formatOnSave": true,
|
|
235
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
236
|
-
"eslint.validate": ["javascript", "javascriptreact", "vue", "typescript", "typescriptreact"],
|
|
237
|
-
"editor.codeActionsOnSave": {
|
|
238
|
-
"source.fixAll.eslint": true
|
|
239
|
-
}
|
|
383
|
+
"prettier.enable": false
|
|
240
384
|
}
|
|
241
385
|
```
|
|
242
386
|
|
|
387
|
+
Sharing these settings in your project should be sufficient to prevent local settings accidentally overriding the desired formatter behavior.
|
|
388
|
+
|
|
243
389
|
## Q & A
|
|
244
390
|
|
|
245
391
|
### Why not standard
|
|
246
392
|
|
|
247
|
-
The standard specification believes that everyone should not waste time in personalized specifications, but the entire community should unify a specification. This statement makes
|
|
393
|
+
The standard specification believes that everyone should not waste time in personalized specifications, but the entire community should unify a specification. This statement makes sense, but it runs against the ESLint’s design philosophy.
|
|
248
394
|
Don’t you remember how ESLint defeated JSHint and became the most popular JS code inspection tool? It’s because of the plugin and configuration that ESLint advocates, which meets the individual needs of different technology stacks of different teams.
|
|
249
395
|
|
|
250
396
|
Therefore, `@anolilab/eslint-config` also inherits the philosophy of ESLint. It will not force you to use our config.
|
|
@@ -255,20 +401,27 @@ Libraries in this ecosystem make the best effort to track
|
|
|
255
401
|
[Node.js’ release schedule](https://nodejs.org/en/about/releases/). Here’s [a
|
|
256
402
|
post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
|
|
257
403
|
|
|
258
|
-
Contributing
|
|
259
|
-
------------
|
|
404
|
+
## Contributing
|
|
260
405
|
|
|
261
406
|
If you would like to help take a look at the [list of issues](https://github.com/anolilab/javascript-style-guide/issues) and check our [Contributing](.github/CONTRIBUTING.md) guild.
|
|
262
407
|
|
|
263
408
|
> **Note:** please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
|
|
264
409
|
|
|
265
|
-
Credits
|
|
266
|
-
-------------
|
|
410
|
+
## Credits
|
|
267
411
|
|
|
268
|
-
-
|
|
269
|
-
-
|
|
412
|
+
- [Daniel Bannert](https://github.com/prisis)
|
|
413
|
+
- [All Contributors](https://github.com/anolilab/javascript-style-guide/graphs/contributors)
|
|
414
|
+
- [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb)
|
|
415
|
+
- [eslint-config-alloy](https://github.com/AlloyTeam/eslint-config-alloy)
|
|
416
|
+
- [eslint-config-canonical](https://github.com/gajus/eslint-config-canonical)
|
|
270
417
|
|
|
271
|
-
License
|
|
272
|
-
-------------
|
|
418
|
+
## License
|
|
273
419
|
|
|
274
420
|
The anolilab javascript-style-guide is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT)
|
|
421
|
+
|
|
422
|
+
[typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
|
|
423
|
+
[typescript-url]: "typescript"
|
|
424
|
+
[license-image]: https://img.shields.io/npm/l/@anolilab/eslint-config?color=blueviolet&style=for-the-badge
|
|
425
|
+
[license-url]: LICENSE.md "license"
|
|
426
|
+
[npm-image]: https://img.shields.io/npm/v/@anolilab/eslint-config/latest.svg?style=for-the-badge&logo=npm
|
|
427
|
+
[npm-url]: https://www.npmjs.com/package/@anolilab/eslint-config/v/latest "npm"
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var r=(t,e)=>{let s=["*.js","*.mjs","*.cjs"];switch(t){case"typescript":{s=["*.ts","*.tsx","*.mts","*.cts"];break}case"jsx_and_tsx":{s=["*.jsx","*.tsx"];break}case"js_and_ts":{s=["*.js","*.mjs","*.cjs","*.ts","*.mts","*.cts"];break}case"all":{s=["*.js","*.jsx","*.mjs","*.cjs","*.ts","*.tsx","*.mts","*.cts"];break}}return {overrides:[{files:s,...e}]}},a=r;
|
|
2
|
+
|
|
3
|
+
export { a };
|
|
4
|
+
//# sourceMappingURL=out.js.map
|
|
5
|
+
//# sourceMappingURL=chunk-3XUVOUJE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/create-config.ts"],"names":["createConfig","type","config","files","create_config_default"],"mappings":"AAEA,IAAMA,EAAe,CAACC,EAAyEC,IAAkE,CAC7J,IAAIC,EAAQ,CAAC,OAAQ,QAAS,OAAO,EAGrC,OAAQF,EAAM,CACV,IAAK,aAAc,CAEfE,EAAQ,CAAC,OAAQ,QAAS,QAAS,OAAO,EAE1C,KACJ,CACA,IAAK,cAAe,CAChBA,EAAQ,CAAC,QAAS,OAAO,EAEzB,KACJ,CACA,IAAK,YAAa,CACdA,EAAQ,CAAC,OAAQ,QAAS,QAAS,OAAQ,QAAS,OAAO,EAE3D,KACJ,CACA,IAAK,MAAO,CACRA,EAAQ,CAAC,OAAQ,QAAS,QAAS,QAAS,OAAQ,QAAS,QAAS,OAAO,EAE7E,KACJ,CAEJ,CAEA,MAAO,CACH,UAAW,CACP,CACI,MAAAA,EACA,GAAGD,CACP,CACJ,CACJ,CACJ,EAEOE,EAAQJ","sourcesContent":["import type { Linter } from \"eslint\";\n\nconst createConfig = (type: \"all\" | \"javascript\" | \"js_and_ts\" | \"jsx_and_tsx\" | \"typescript\", config: Omit<Linter.Config, \"files|overrides\">): Linter.Config => {\n let files = [\"*.js\", \"*.mjs\", \"*.cjs\"];\n\n // eslint-disable-next-line default-case\n switch (type) {\n case \"typescript\": {\n // @see https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#new-file-extensions\n files = [\"*.ts\", \"*.tsx\", \"*.mts\", \"*.cts\"];\n\n break;\n }\n case \"jsx_and_tsx\": {\n files = [\"*.jsx\", \"*.tsx\"];\n\n break;\n }\n case \"js_and_ts\": {\n files = [\"*.js\", \"*.mjs\", \"*.cjs\", \"*.ts\", \"*.mts\", \"*.cts\"];\n\n break;\n }\n case \"all\": {\n files = [\"*.js\", \"*.jsx\", \"*.mjs\", \"*.cjs\", \"*.ts\", \"*.tsx\", \"*.mts\", \"*.cts\"];\n\n break;\n }\n // No default\n }\n\n return {\n overrides: [\n {\n files,\n ...config,\n },\n ],\n };\n};\n\nexport default createConfig;\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
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-6E2RGUNG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,MAGvB,kBAAmB,QAGnB,kBAAmB,MAGnB,cAAe,QAGf,YAAa,CAAC,QAAS,CAAE,UAAW,GAAO,YAAa,EAAM,CAAC,EAG/D,iBAAkB,QAGlB,eAAgB,QAIhB,mBAAoB,CAChB,MACA,CACI,OAAQ,CAAC,EACT,mBAAoB,GACpB,aAAc,GACd,cAAe,EACnB,CACJ,EAGA,kBAAmB,CACf,QACA,CACI,kBAAmB,EACvB,CACJ,EAGA,eAAgB,QAGhB,SAAU,QAGV,cAAe,QAGf,kBAAmB,QAInB,6BAA8B,QAG9B,WAAY,QAIZ,kBAAmB,QAKnB,oBAAqB,CACjB,QACA,CACI,MAAO,GACP,+BAAgC,CAC5B,MACA,cACA,IACA,MACA,UACA,MACA,UACA,MACA,WACA,SACA,eACJ,CACJ,CACJ,EAGA,WAAY,QAGZ,eAAgB,QAIhB,2BAA4B,CACxB,QACA,CACI,OAAQ,YACR,SAAU,SACV,QAAS,gCACb,EACA,CACI,OAAQ,SACR,SAAU,WAEV,QAAS,oCACb,EACA,CACI,OAAQ,OACR,SAAU,WACV,QAAS,oCACb,EACA,CACI,OAAQ,SACR,SAAU,WACV,QAAS,oCACb,EACA,CACI,OAAQ,SACR,SAAU,QAEV,QAAS,iCACb,EACA,CACI,OAAQ,OACR,SAAU,QACV,QAAS,iCACb,EACA,CACI,OAAQ,SACR,SAAU,QACV,QAAS,iCACb,EACA,CACI,SAAU,mBACV,QAAS,2CACb,EACA,CACI,SAAU,mBACV,QAAS,2CACb,EACA,CACI,OAAQ,OACR,SAAU,MACV,QAAS,+CACb,EACA,CACI,OAAQ,aACR,SAAU,QACV,QAAS,6BACb,EACA,CACI,OAAQ,aACR,SAAU,WACV,QAAS,gCACb,EACA,CACI,OAAQ,aACR,SAAU,aACV,QAAS,kCACb,EACA,CACI,OAAQ,aACR,SAAU,WACV,QAAS,gCACb,EACA,CACI,OAAQ,SACR,SAAU,aACV,QAAS,kCACb,EACA,CACI,OAAQ,SACR,SAAU,WACV,QAAS,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 // eslint-disable-next-line sonarjs/no-duplicate-string\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 // eslint-disable-next-line sonarjs/no-duplicate-string\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"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var r=(t,e)=>{let s=["*.js","*.mjs","*.cjs"];switch(t){case"typescript":{s=["*.ts","*.tsx","*.mts","*.cts"];break}case"jsx_and_tsx":{s=["*.jsx","*.tsx"];break}case"js_and_ts":{s=["*.js","*.mjs","*.cjs","*.ts","*.mts","*.cts"];break}case"all":{s=["*.js","*.jsx","*.mjs","*.cjs","*.ts","*.tsx","*.mts","*.cts"];break}}return {overrides:[{files:s,...e}]}},a=r;
|
|
4
|
+
|
|
5
|
+
exports.a = a;
|
|
6
|
+
//# sourceMappingURL=out.js.map
|
|
7
|
+
//# sourceMappingURL=chunk-ARKJLBXP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/create-config.ts"],"names":["createConfig","type","config","files","create_config_default"],"mappings":"AAEA,IAAMA,EAAe,CAACC,EAAyEC,IAAkE,CAC7J,IAAIC,EAAQ,CAAC,OAAQ,QAAS,OAAO,EAGrC,OAAQF,EAAM,CACV,IAAK,aAAc,CAEfE,EAAQ,CAAC,OAAQ,QAAS,QAAS,OAAO,EAE1C,KACJ,CACA,IAAK,cAAe,CAChBA,EAAQ,CAAC,QAAS,OAAO,EAEzB,KACJ,CACA,IAAK,YAAa,CACdA,EAAQ,CAAC,OAAQ,QAAS,QAAS,OAAQ,QAAS,OAAO,EAE3D,KACJ,CACA,IAAK,MAAO,CACRA,EAAQ,CAAC,OAAQ,QAAS,QAAS,QAAS,OAAQ,QAAS,QAAS,OAAO,EAE7E,KACJ,CAEJ,CAEA,MAAO,CACH,UAAW,CACP,CACI,MAAAA,EACA,GAAGD,CACP,CACJ,CACJ,CACJ,EAEOE,EAAQJ","sourcesContent":["import type { Linter } from \"eslint\";\n\nconst createConfig = (type: \"all\" | \"javascript\" | \"js_and_ts\" | \"jsx_and_tsx\" | \"typescript\", config: Omit<Linter.Config, \"files|overrides\">): Linter.Config => {\n let files = [\"*.js\", \"*.mjs\", \"*.cjs\"];\n\n // eslint-disable-next-line default-case\n switch (type) {\n case \"typescript\": {\n // @see https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#new-file-extensions\n files = [\"*.ts\", \"*.tsx\", \"*.mts\", \"*.cts\"];\n\n break;\n }\n case \"jsx_and_tsx\": {\n files = [\"*.jsx\", \"*.tsx\"];\n\n break;\n }\n case \"js_and_ts\": {\n files = [\"*.js\", \"*.mjs\", \"*.cjs\", \"*.ts\", \"*.mts\", \"*.cts\"];\n\n break;\n }\n case \"all\": {\n files = [\"*.js\", \"*.jsx\", \"*.mjs\", \"*.cjs\", \"*.ts\", \"*.tsx\", \"*.mts\", \"*.cts\"];\n\n break;\n }\n // No default\n }\n\n return {\n overrides: [\n {\n files,\n ...config,\n },\n ],\n };\n};\n\nexport default createConfig;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var packageJsonUtils = require('@anolilab/package-json-utils');
|
|
4
|
+
|
|
5
|
+
var e={env:{es6:!0},parserOptions:{ecmaVersion:6,sourceType:"module"},plugins:["import"],settings:{"import/resolver":{node:{extensions:[".mjs",".js",".json"]},...packageJsonUtils.hasTypescript?{typescript:{alwaysTryTypes:!0,project:packageJsonUtils.fromRoot("tsconfig.json")}}:{}},...packageJsonUtils.hasTypescript?{"import/parsers":{"@typescript-eslint/parser":[".ts",".tsx"]}}:{},"import/extensions":[".js",".mjs",".jsx"],"import/core-modules":[],"import/ignore":["\\.(coffee|scss|css|less|hbs|svg|json)$"]},rules:{"import/no-unresolved":["error",{commonjs:!0,caseSensitive:!0}],"import/named":"error","import/default":"off","import/namespace":"off","import/export":"error","import/no-named-as-default":"error","import/no-named-as-default-member":"error","import/no-deprecated":"off","import/no-extraneous-dependencies":["error",{devDependencies:["test/**","tests/**","spec/**","**/fixture/**","**/__mocks__/**","test.{js,jsx}","test-*.{js,jsx}","**/*{.,_}{test,spec}.{js,jsx}","**/jest.config.cjs","**/jest.setup.js","**/vue.config.cjs","**/webpack.config.cjs","**/webpack.config.*.js","**/rollup.config.cjs","**/rollup.config.*.js","**/gulpfile.js","**/gulpfile.*.js","**/Gruntfile{,.js}","**/protractor.conf.js","**/protractor.conf.*.js","**/karma.conf.js","**/.eslintrc.js","**/.eslintrc.cjs","**/vite.config.js","**/vite.config.ts","**/vitest.config.js","**/vitest.config.ts"],optionalDependencies:!1}],"import/no-mutable-exports":"error","import/no-commonjs":"off","import/no-amd":"error","import/no-nodejs-modules":"off","import/first":"error","import/imports-first":"off","import/no-duplicates":"error","import/no-namespace":"error","import/extensions":["error","ignorePackages",{js:"never",mjs:"never",jsx:"never"}],"import/order":["error",{groups:[["builtin","external","internal"]]}],"import/newline-after-import":"error","import/prefer-default-export":"error","import/no-restricted-paths":"off","import/max-dependencies":["off",{max:10}],"import/no-absolute-path":"error","import/no-dynamic-require":"error","import/no-internal-modules":["off",{allow:[]}],"import/unambiguous":"off","import/no-webpack-loader-syntax":"error","import/no-unassigned-import":"off","import/no-named-default":"error","import/no-anonymous-default-export":["off",{allowArray:!1,allowArrowFunction:!1,allowAnonymousClass:!1,allowAnonymousFunction:!1,allowLiteral:!1,allowObject:!1}],"import/exports-last":"error","import/group-exports":"off","import/no-default-export":"off","import/no-named-export":"off","import/no-self-import":"error","import/no-cycle":["error",{maxDepth:"\u221E"}],"import/no-useless-path-segments":["error",{commonjs:!0,noUselessIndex:!0}],"import/dynamic-import-chunkname":["off",{importFunctions:[],webpackChunknameFormat:"[0-9a-zA-Z-_/.]+"}],"import/no-relative-parent-imports":"off","import/no-unused-modules":"off","import/consistent-type-specifier-style":["off","prefer-inline"],"import/no-empty-named-blocks":"error"},overrides:[{files:["*.ts","*.tsx","*.mts","*.cts"],rules:{"import/export":"off","import/default":"off","import/named":"off"}}]},s=e;
|
|
6
|
+
|
|
7
|
+
exports.a = s;
|
|
8
|
+
//# sourceMappingURL=out.js.map
|
|
9
|
+
//# sourceMappingURL=chunk-B7GQAMYJ.js.map
|