@anolilab/eslint-config 9.0.2 → 9.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/chunk-3Y2MNMYX.js +8 -0
  3. package/dist/chunk-3Y2MNMYX.js.map +1 -0
  4. package/dist/config/plugins/antfu.js +2 -2
  5. package/dist/config/plugins/array-func.js +2 -2
  6. package/dist/config/plugins/babel.js +2 -2
  7. package/dist/config/plugins/es.js +2 -2
  8. package/dist/config/plugins/eslint-comments.js +3 -2
  9. package/dist/config/plugins/eslint-comments.js.map +1 -1
  10. package/dist/config/plugins/etc.js +2 -2
  11. package/dist/config/plugins/jsonc.js +3 -3
  12. package/dist/config/plugins/jsonc.js.map +1 -1
  13. package/dist/config/plugins/markdown.js +3 -2
  14. package/dist/config/plugins/markdown.js.map +1 -1
  15. package/dist/config/plugins/mdx.js +3 -2
  16. package/dist/config/plugins/mdx.js.map +1 -1
  17. package/dist/config/plugins/perfectionist.js +2 -2
  18. package/dist/config/plugins/react-hooks.js +2 -2
  19. package/dist/config/plugins/react-redux.js +2 -2
  20. package/dist/config/plugins/react-usememo.js +2 -2
  21. package/dist/config/plugins/react.js +1 -1
  22. package/dist/config/plugins/react.js.map +1 -1
  23. package/dist/config/plugins/regexp.js +2 -2
  24. package/dist/config/plugins/sonarjs.js +2 -2
  25. package/dist/config/plugins/tailwindcss.js +2 -2
  26. package/dist/config/plugins/tanstack-query.js +2 -2
  27. package/dist/config/plugins/testing-library.js +2 -2
  28. package/dist/config/plugins/tsdoc.js +2 -2
  29. package/dist/config/plugins/you-dont-need-lodash-underscore.js +2 -2
  30. package/dist/config/plugins/you-dont-need-momentjs.js +2 -2
  31. package/dist/config/plugins/zod.js +2 -2
  32. package/dist/index.js +9 -9
  33. package/dist/index.js.map +1 -1
  34. package/dist/typescript-type-checking.js +5 -3
  35. package/dist/typescript-type-checking.js.map +1 -1
  36. package/globals.js +1 -0
  37. package/package.json +7 -2
  38. package/typescript-type-checking.js +1 -0
  39. package/dist/chunk-YRRY5AGG.js +0 -8
  40. package/dist/chunk-YRRY5AGG.js.map +0 -1
@@ -1,11 +1,13 @@
1
1
  'use strict';
2
2
 
3
+ var chunkX3W6J3PZ_js = require('./chunk-X3W6J3PZ.js');
3
4
  var chunkMQFZFF2T_js = require('./chunk-MQFZFF2T.js');
4
- var chunkYRRY5AGG_js = require('./chunk-YRRY5AGG.js');
5
+ var chunk3Y2MNMYX_js = require('./chunk-3Y2MNMYX.js');
5
6
  require('./chunk-3NVDJZNH.js');
7
+ var process = require('process');
6
8
 
7
- var e=chunkMQFZFF2T_js.a.rules,i=chunkYRRY5AGG_js.a("typescript",{rules:{"@typescript-eslint/await-thenable":"error","@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!0}],"@typescript-eslint/dot-notation":["error",{allowKeywords:!0}],"@typescript-eslint/no-base-to-string":["error",{ignoredTypeNames:["RegExp"]}],"@typescript-eslint/no-confusing-void-expression":["error",{ignoreArrowShorthand:!0,ignoreVoidOperator:!1}],"@typescript-eslint/no-floating-promises":["error",{ignoreIIFE:!0,ignoreVoid:!0}],"@typescript-eslint/no-for-in-array":"error","@typescript-eslint/no-implied-eval":e["no-implied-eval"],"@typescript-eslint/no-meaningless-void-operator":["error",{checkNever:!0}],"@typescript-eslint/no-misused-promises":["error",{checksConditionals:!0,checksVoidReturn:{arguments:!0,attributes:!1,properties:!0,returns:!0,variables:!0}}],"@typescript-eslint/no-throw-literal":e["no-throw-literal"],"@typescript-eslint/no-unnecessary-condition":"error","@typescript-eslint/no-unnecessary-qualifier":"error","@typescript-eslint/no-unnecessary-type-arguments":"error","@typescript-eslint/no-unnecessary-type-assertion":"off","@typescript-eslint/prefer-includes":"error","@typescript-eslint/prefer-nullish-coalescing":["error",{ignoreConditionalTests:!0,ignoreMixedLogicalExpressions:!0}],"@typescript-eslint/prefer-readonly":["error",{onlyInlineLambdas:!1}],"@typescript-eslint/prefer-reduce-type-parameter":"error","@typescript-eslint/prefer-regexp-exec":"error","@typescript-eslint/prefer-return-this-type":"error","@typescript-eslint/prefer-string-starts-ends-with":"error","@typescript-eslint/promise-function-async":"error","@typescript-eslint/require-array-sort-compare":["error",{ignoreStringArrays:!1}],"@typescript-eslint/require-await":e["require-await"],"@typescript-eslint/restrict-plus-operands":"error","@typescript-eslint/return-await":["error","always"],"@typescript-eslint/switch-exhaustiveness-check":"error","@typescript-eslint/unbound-method":["error",{ignoreStatic:!1}],"dot-notation":"off","no-implied-eval":"off","no-new-func":"off","no-throw-literal":"off","require-await":"off"}}),o=i;
9
+ var r=chunkMQFZFF2T_js.a.rules,s=process.env.DISABLE_ESLINT_WARN_UNSUPPORTED_TYPESCRIPT_VERSION!=="true";chunkX3W6J3PZ_js.a.warn_on_unsupported_typescript_version!==void 0&&(s=chunkX3W6J3PZ_js.a.warn_on_unsupported_typescript_version);var o=chunk3Y2MNMYX_js.a("typescript",{parser:"@typescript-eslint/parser",parserOptions:{ecmaFeatures:{jsx:!0},sourceType:"module",warnOnUnsupportedTypeScriptVersion:s},plugins:["@typescript-eslint"],rules:{"@typescript-eslint/await-thenable":"error","@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!0}],"@typescript-eslint/dot-notation":["error",{allowKeywords:!0}],"@typescript-eslint/no-base-to-string":["error",{ignoredTypeNames:["RegExp"]}],"@typescript-eslint/no-confusing-void-expression":["error",{ignoreArrowShorthand:!0,ignoreVoidOperator:!1}],"@typescript-eslint/no-floating-promises":["error",{ignoreIIFE:!0,ignoreVoid:!0}],"@typescript-eslint/no-for-in-array":"error","@typescript-eslint/no-implied-eval":r["no-implied-eval"],"@typescript-eslint/no-meaningless-void-operator":["error",{checkNever:!0}],"@typescript-eslint/no-misused-promises":["error",{checksConditionals:!0,checksVoidReturn:{arguments:!0,attributes:!1,properties:!0,returns:!0,variables:!0}}],"@typescript-eslint/no-throw-literal":r["no-throw-literal"],"@typescript-eslint/no-unnecessary-condition":"error","@typescript-eslint/no-unnecessary-qualifier":"error","@typescript-eslint/no-unnecessary-type-arguments":"error","@typescript-eslint/no-unnecessary-type-assertion":"off","@typescript-eslint/prefer-includes":"error","@typescript-eslint/prefer-nullish-coalescing":["error",{ignoreConditionalTests:!0,ignoreMixedLogicalExpressions:!0}],"@typescript-eslint/prefer-readonly":["error",{onlyInlineLambdas:!1}],"@typescript-eslint/prefer-reduce-type-parameter":"error","@typescript-eslint/prefer-regexp-exec":"error","@typescript-eslint/prefer-return-this-type":"error","@typescript-eslint/prefer-string-starts-ends-with":"error","@typescript-eslint/promise-function-async":"error","@typescript-eslint/require-array-sort-compare":["error",{ignoreStringArrays:!1}],"@typescript-eslint/require-await":r["require-await"],"@typescript-eslint/restrict-plus-operands":"error","@typescript-eslint/return-await":["error","always"],"@typescript-eslint/switch-exhaustiveness-check":"error","@typescript-eslint/unbound-method":["error",{ignoreStatic:!1}],"dot-notation":"off","no-implied-eval":"off","no-new-func":"off","no-throw-literal":"off","require-await":"off"}}),u=o;
8
10
 
9
- module.exports = o;
11
+ module.exports = u;
10
12
  //# sourceMappingURL=out.js.map
11
13
  //# sourceMappingURL=typescript-type-checking.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/typescript-type-checking.ts"],"names":["bestPracticesRules","best_practices_default","config","createConfig","typescript_type_checking_default"],"mappings":"4GAKA,IAAMA,EAAqBC,EAAoB,MAEzCC,EAASC,EAAa,aAAc,CAOtC,MAAO,CAEH,oCAAqC,QAErC,6CAA8C,CAC1C,QACA,CACI,uCAAwC,EAC5C,CACJ,EAGA,kCAAmC,CAAC,QAAS,CAAE,cAAe,EAAK,CAAC,EAEpE,uCAAwC,CACpC,QACA,CACI,iBAAkB,CAAC,QAAQ,CAC/B,CACJ,EAGA,kDAAmD,CAC/C,QACA,CACI,qBAAsB,GACtB,mBAAoB,EACxB,CACJ,EAGA,0CAA2C,CACvC,QACA,CACI,WAAY,GACZ,WAAY,EAChB,CACJ,EAGA,qCAAsC,QAEtC,qCAAsCH,EAAmB,iBAAiB,EAI1E,kDAAmD,CAAC,QAAS,CAAE,WAAY,EAAK,CAAC,EAEjF,yCAA0C,CACtC,QACA,CACI,mBAAoB,GACpB,iBAAkB,CACd,UAAW,GACX,WAAY,GACZ,WAAY,GACZ,QAAS,GACT,UAAW,EACf,CACJ,CACJ,EAGA,sCAAuCA,EAAmB,kBAAkB,EAE5E,8CAA+C,QAE/C,8CAA+C,QAI/C,mDAAoD,QAIpD,mDAAoD,MAIpD,qCAAsC,QAItC,+CAAgD,CAC5C,QACA,CACI,uBAAwB,GACxB,8BAA+B,EACnC,CACJ,EAGA,qCAAsC,CAAC,QAAS,CAAE,kBAAmB,EAAM,CAAC,EAI5E,kDAAmD,QAInD,wCAAyC,QAIzC,6CAA8C,QAI9C,oDAAqD,QAErD,4CAA6C,QAG7C,gDAAiD,CAC7C,QACA,CACI,mBAAoB,EACxB,CACJ,EAEA,mCAAoCA,EAAmB,eAAe,EAGtE,4CAA6C,QAG7C,kCAAmC,CAAC,QAAS,QAAQ,EAGrD,iDAAkD,QAIlD,oCAAqC,CAAC,QAAS,CAAE,aAAc,EAAM,CAAC,EAGtE,eAAgB,MAIhB,kBAAmB,MAGnB,cAAe,MAGf,mBAAoB,MAIpB,gBAAiB,KACrB,CACJ,CAAC,EAEMI,EAAQF","sourcesContent":["import type { Linter } from \"eslint\";\n\nimport bestPracticesConfig from \"./config/best-practices\";\nimport { createConfig } from \"./utils/create-config\";\n\nconst bestPracticesRules = bestPracticesConfig.rules as Linter.RulesRecord;\n\nconst config = createConfig(\"typescript\", {\n // TODO: enable the rule when typescript-eslint 6.0.0 is released\n // extends: [\n // \"plugin:@typescript-eslint/recommended-type-checked\",\n // \"plugin:@typescript-eslint/strict-type-checked\",\n // \"plugin:@typescript-eslint/stylistic-type-checked\"\n // ],\n rules: {\n // Disallows awaiting a value that is not a Thenable\n \"@typescript-eslint/await-thenable\": \"error\",\n\n \"@typescript-eslint/consistent-type-exports\": [\n \"error\",\n {\n fixMixedExportsWithInlineTypeSpecifier: true,\n },\n ],\n\n // Replace 'dot-notation' rule with '@typescript-eslint' version\n \"@typescript-eslint/dot-notation\": [\"error\", { allowKeywords: true }],\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-base-to-string.md\n \"@typescript-eslint/no-base-to-string\": [\n \"error\",\n {\n ignoredTypeNames: [\"RegExp\"],\n },\n ],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md\n \"@typescript-eslint/no-confusing-void-expression\": [\n \"error\",\n {\n ignoreArrowShorthand: true,\n ignoreVoidOperator: false,\n },\n ],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md\n \"@typescript-eslint/no-floating-promises\": [\n \"error\",\n {\n ignoreIIFE: true,\n ignoreVoid: true,\n },\n ],\n\n // Disallow iterating over an array with a for-in loop\n \"@typescript-eslint/no-for-in-array\": \"error\",\n\n \"@typescript-eslint/no-implied-eval\": bestPracticesRules[\"no-implied-eval\"],\n\n // Replace 'no-throw-literal' rule with '@typescript-eslint' version\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md\n \"@typescript-eslint/no-meaningless-void-operator\": [\"error\", { checkNever: true }],\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-misused-promises.md\n \"@typescript-eslint/no-misused-promises\": [\n \"error\",\n {\n checksConditionals: true,\n checksVoidReturn: {\n arguments: true,\n attributes: false,\n properties: true,\n returns: true,\n variables: true,\n },\n },\n ],\n\n // Replace 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version\n \"@typescript-eslint/no-throw-literal\": bestPracticesRules[\"no-throw-literal\"],\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md\n \"@typescript-eslint/no-unnecessary-condition\": \"error\",\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md\n \"@typescript-eslint/no-unnecessary-qualifier\": \"error\",\n\n // Disallow the void operator except when used to discard a value.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md\n \"@typescript-eslint/no-unnecessary-type-arguments\": \"error\",\n\n // Disallow Promises in places not designed to handle them.\n // Disabling here because in most cases the explicitness is still valuable\n \"@typescript-eslint/no-unnecessary-type-assertion\": \"off\",\n\n // Warns if a type assertion does not change the type of an expression\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-includes.md\n \"@typescript-eslint/prefer-includes\": \"error\",\n\n // Enforce includes method over indexOf method.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md\n \"@typescript-eslint/prefer-nullish-coalescing\": [\n \"error\",\n {\n ignoreConditionalTests: true,\n ignoreMixedLogicalExpressions: true,\n },\n ],\n\n // Requires that private members are marked as readonly if they're never modified outside of the constructor\n \"@typescript-eslint/prefer-readonly\": [\"error\", { onlyInlineLambdas: false }],\n\n // Enforce RegExp#exec over String#match if no global flag is provided.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md\n \"@typescript-eslint/prefer-reduce-type-parameter\": \"error\",\n\n // Enforce that this is used when only this type is returned.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md\n \"@typescript-eslint/prefer-regexp-exec\": \"error\",\n\n // Enforce using String#startsWith and String#endsWith over other equivalent methods of checking substrings.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-return-this-type.md\n \"@typescript-eslint/prefer-return-this-type\": \"error\",\n\n // Replace 'require-await' rule with '@typescript-eslint' version\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md\n \"@typescript-eslint/prefer-string-starts-ends-with\": \"error\",\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/promise-function-async.md\n \"@typescript-eslint/promise-function-async\": \"error\",\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-array-sort-compare.md\n \"@typescript-eslint/require-array-sort-compare\": [\n \"error\",\n {\n ignoreStringArrays: false,\n },\n ],\n\n \"@typescript-eslint/require-await\": bestPracticesRules[\"require-await\"],\n\n // When adding two variables, operands must both be of type number or of type string\n \"@typescript-eslint/restrict-plus-operands\": \"error\",\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md\n \"@typescript-eslint/return-await\": [\"error\", \"always\"],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md\n \"@typescript-eslint/switch-exhaustiveness-check\": \"error\",\n\n // Disallow unnecessary namespace qualifiers.\n // Enforces unbound methods are called with their expected scope\n \"@typescript-eslint/unbound-method\": [\"error\", { ignoreStatic: false }],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md\n \"dot-notation\": \"off\",\n\n // Disallow conditionals where the type is always truthy or always falsy.\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md\n \"no-implied-eval\": \"off\",\n\n // Disallow type arguments that are equal to the default.\n \"no-new-func\": \"off\",\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md\n \"no-throw-literal\": \"off\",\n\n // Enforce using type parameter when calling Array#reduce instead of casting.\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md\n \"require-await\": \"off\",\n },\n});\n\nexport default config;\n"]}
1
+ {"version":3,"sources":["../src/typescript-type-checking.ts"],"names":["env","bestPracticesRules","best_practices_default","showUnsupportedTypeScriptVersionWarning","eslint_config_default","config","createConfig","typescript_type_checking_default"],"mappings":"oJACA,OAAS,OAAAA,MAAW,UAMpB,IAAMC,EAAqBC,EAAoB,MAE3CC,EAAmDH,EAAI,qDAA0D,OAEjHI,EAAqB,yCAA8C,SACnED,EAA0CC,EAAqB,wCAGnE,IAAMC,EAASC,EAAa,aAAc,CAOtC,OAAQ,4BACR,cAAe,CACX,aAAc,CACV,IAAK,EACT,EACA,WAAY,SACZ,mCAAoCH,CACxC,EACA,QAAS,CAAC,oBAAoB,EAC9B,MAAO,CAEH,oCAAqC,QAErC,6CAA8C,CAC1C,QACA,CACI,uCAAwC,EAC5C,CACJ,EAGA,kCAAmC,CAAC,QAAS,CAAE,cAAe,EAAK,CAAC,EAEpE,uCAAwC,CACpC,QACA,CACI,iBAAkB,CAAC,QAAQ,CAC/B,CACJ,EAGA,kDAAmD,CAC/C,QACA,CACI,qBAAsB,GACtB,mBAAoB,EACxB,CACJ,EAGA,0CAA2C,CACvC,QACA,CACI,WAAY,GACZ,WAAY,EAChB,CACJ,EAGA,qCAAsC,QAEtC,qCAAsCF,EAAmB,iBAAiB,EAI1E,kDAAmD,CAAC,QAAS,CAAE,WAAY,EAAK,CAAC,EAEjF,yCAA0C,CACtC,QACA,CACI,mBAAoB,GACpB,iBAAkB,CACd,UAAW,GACX,WAAY,GACZ,WAAY,GACZ,QAAS,GACT,UAAW,EACf,CACJ,CACJ,EAGA,sCAAuCA,EAAmB,kBAAkB,EAE5E,8CAA+C,QAE/C,8CAA+C,QAI/C,mDAAoD,QAIpD,mDAAoD,MAIpD,qCAAsC,QAItC,+CAAgD,CAC5C,QACA,CACI,uBAAwB,GACxB,8BAA+B,EACnC,CACJ,EAGA,qCAAsC,CAAC,QAAS,CAAE,kBAAmB,EAAM,CAAC,EAI5E,kDAAmD,QAInD,wCAAyC,QAIzC,6CAA8C,QAI9C,oDAAqD,QAErD,4CAA6C,QAG7C,gDAAiD,CAC7C,QACA,CACI,mBAAoB,EACxB,CACJ,EAEA,mCAAoCA,EAAmB,eAAe,EAGtE,4CAA6C,QAG7C,kCAAmC,CAAC,QAAS,QAAQ,EAGrD,iDAAkD,QAIlD,oCAAqC,CAAC,QAAS,CAAE,aAAc,EAAM,CAAC,EAGtE,eAAgB,MAIhB,kBAAmB,MAGnB,cAAe,MAGf,mBAAoB,MAIpB,gBAAiB,KACrB,CACJ,CAAC,EAEMM,EAAQF","sourcesContent":["import type { Linter } from \"eslint\";\nimport { env } from \"node:process\";\n\nimport bestPracticesConfig from \"./config/best-practices\";\nimport { createConfig } from \"./utils/create-config\";\nimport anolilabEslintConfig from \"./utils/eslint-config\";\n\nconst bestPracticesRules = bestPracticesConfig.rules as Linter.RulesRecord;\n\nlet showUnsupportedTypeScriptVersionWarning: boolean = env[\"DISABLE_ESLINT_WARN_UNSUPPORTED_TYPESCRIPT_VERSION\"] !== \"true\";\n\nif (anolilabEslintConfig[\"warn_on_unsupported_typescript_version\"] !== undefined) {\n showUnsupportedTypeScriptVersionWarning = anolilabEslintConfig[\"warn_on_unsupported_typescript_version\"];\n}\n\nconst config = createConfig(\"typescript\", {\n // TODO: enable the rule when typescript-eslint 6.0.0 is released\n // extends: [\n // \"plugin:@typescript-eslint/recommended-type-checked\",\n // \"plugin:@typescript-eslint/strict-type-checked\",\n // \"plugin:@typescript-eslint/stylistic-type-checked\"\n // ],\n parser: \"@typescript-eslint/parser\",\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n sourceType: \"module\",\n warnOnUnsupportedTypeScriptVersion: showUnsupportedTypeScriptVersionWarning,\n },\n plugins: [\"@typescript-eslint\"],\n rules: {\n // Disallows awaiting a value that is not a Thenable\n \"@typescript-eslint/await-thenable\": \"error\",\n\n \"@typescript-eslint/consistent-type-exports\": [\n \"error\",\n {\n fixMixedExportsWithInlineTypeSpecifier: true,\n },\n ],\n\n // Replace 'dot-notation' rule with '@typescript-eslint' version\n \"@typescript-eslint/dot-notation\": [\"error\", { allowKeywords: true }],\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-base-to-string.md\n \"@typescript-eslint/no-base-to-string\": [\n \"error\",\n {\n ignoredTypeNames: [\"RegExp\"],\n },\n ],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md\n \"@typescript-eslint/no-confusing-void-expression\": [\n \"error\",\n {\n ignoreArrowShorthand: true,\n ignoreVoidOperator: false,\n },\n ],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md\n \"@typescript-eslint/no-floating-promises\": [\n \"error\",\n {\n ignoreIIFE: true,\n ignoreVoid: true,\n },\n ],\n\n // Disallow iterating over an array with a for-in loop\n \"@typescript-eslint/no-for-in-array\": \"error\",\n\n \"@typescript-eslint/no-implied-eval\": bestPracticesRules[\"no-implied-eval\"],\n\n // Replace 'no-throw-literal' rule with '@typescript-eslint' version\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md\n \"@typescript-eslint/no-meaningless-void-operator\": [\"error\", { checkNever: true }],\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-misused-promises.md\n \"@typescript-eslint/no-misused-promises\": [\n \"error\",\n {\n checksConditionals: true,\n checksVoidReturn: {\n arguments: true,\n attributes: false,\n properties: true,\n returns: true,\n variables: true,\n },\n },\n ],\n\n // Replace 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version\n \"@typescript-eslint/no-throw-literal\": bestPracticesRules[\"no-throw-literal\"],\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md\n \"@typescript-eslint/no-unnecessary-condition\": \"error\",\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md\n \"@typescript-eslint/no-unnecessary-qualifier\": \"error\",\n\n // Disallow the void operator except when used to discard a value.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md\n \"@typescript-eslint/no-unnecessary-type-arguments\": \"error\",\n\n // Disallow Promises in places not designed to handle them.\n // Disabling here because in most cases the explicitness is still valuable\n \"@typescript-eslint/no-unnecessary-type-assertion\": \"off\",\n\n // Warns if a type assertion does not change the type of an expression\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-includes.md\n \"@typescript-eslint/prefer-includes\": \"error\",\n\n // Enforce includes method over indexOf method.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md\n \"@typescript-eslint/prefer-nullish-coalescing\": [\n \"error\",\n {\n ignoreConditionalTests: true,\n ignoreMixedLogicalExpressions: true,\n },\n ],\n\n // Requires that private members are marked as readonly if they're never modified outside of the constructor\n \"@typescript-eslint/prefer-readonly\": [\"error\", { onlyInlineLambdas: false }],\n\n // Enforce RegExp#exec over String#match if no global flag is provided.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md\n \"@typescript-eslint/prefer-reduce-type-parameter\": \"error\",\n\n // Enforce that this is used when only this type is returned.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md\n \"@typescript-eslint/prefer-regexp-exec\": \"error\",\n\n // Enforce using String#startsWith and String#endsWith over other equivalent methods of checking substrings.\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-return-this-type.md\n \"@typescript-eslint/prefer-return-this-type\": \"error\",\n\n // Replace 'require-await' rule with '@typescript-eslint' version\n // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md\n \"@typescript-eslint/prefer-string-starts-ends-with\": \"error\",\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/promise-function-async.md\n \"@typescript-eslint/promise-function-async\": \"error\",\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-array-sort-compare.md\n \"@typescript-eslint/require-array-sort-compare\": [\n \"error\",\n {\n ignoreStringArrays: false,\n },\n ],\n\n \"@typescript-eslint/require-await\": bestPracticesRules[\"require-await\"],\n\n // When adding two variables, operands must both be of type number or of type string\n \"@typescript-eslint/restrict-plus-operands\": \"error\",\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md\n \"@typescript-eslint/return-await\": [\"error\", \"always\"],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md\n \"@typescript-eslint/switch-exhaustiveness-check\": \"error\",\n\n // Disallow unnecessary namespace qualifiers.\n // Enforces unbound methods are called with their expected scope\n \"@typescript-eslint/unbound-method\": [\"error\", { ignoreStatic: false }],\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md\n \"dot-notation\": \"off\",\n\n // Disallow conditionals where the type is always truthy or always falsy.\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md\n \"no-implied-eval\": \"off\",\n\n // Disallow type arguments that are equal to the default.\n \"no-new-func\": \"off\",\n\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md\n \"no-throw-literal\": \"off\",\n\n // Enforce using type parameter when calling Array#reduce instead of casting.\n // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md\n \"require-await\": \"off\",\n },\n});\n\nexport default config;\n"]}
package/globals.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require("./dist/globals");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/eslint-config",
3
- "version": "9.0.2",
3
+ "version": "9.0.3",
4
4
  "description": "ESLint shareable config for the Anolilab JavaScript style guide.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -104,6 +104,8 @@
104
104
  "types": "dist/index.d.ts",
105
105
  "files": [
106
106
  "dist",
107
+ "globals.js",
108
+ "typescript-type-checking.js",
107
109
  "README.md",
108
110
  "CHANGELOG.md",
109
111
  "LICENSE.md"
@@ -116,6 +118,8 @@
116
118
  },
117
119
  "dependencies": {
118
120
  "@anolilab/package-json-utils": "2.0.1",
121
+ "@babel/eslint-parser": "^7.22.6",
122
+ "@babel/plugin-syntax-import-assertions": "^7.22.5",
119
123
  "@html-eslint/eslint-plugin": "^0.19.0",
120
124
  "@html-eslint/parser": "^0.19.0",
121
125
  "@rushstack/eslint-patch": "^1.3.2",
@@ -157,6 +161,7 @@
157
161
  },
158
162
  "devDependencies": {
159
163
  "@anolilab/semantic-release-preset": "5.0.1",
164
+ "@arthurgeron/eslint-plugin-react-usememo": "^1.1.4",
160
165
  "@testing-library/dom": "^9.3.1",
161
166
  "@total-typescript/ts-reset": "^0.4.2",
162
167
  "@types/confusing-browser-globals": "^1.0.0",
@@ -178,7 +183,6 @@
178
183
  "eslint-plugin-react": "^7.32.2",
179
184
  "eslint-plugin-react-hooks": "^4.6.0",
180
185
  "eslint-plugin-react-redux": "^4.0.0",
181
- "@arthurgeron/eslint-plugin-react-usememo": "^1.1.4",
182
186
  "eslint-plugin-storybook": "^0.6.12",
183
187
  "eslint-plugin-tailwindcss": "^3.13.0",
184
188
  "eslint-plugin-testing-library": "^5.11.0",
@@ -199,6 +203,7 @@
199
203
  "eslint": "^8.15.0"
200
204
  },
201
205
  "optionalDependencies": {
206
+ "@arthurgeron/eslint-plugin-react-usememo": "^1.1.4",
202
207
  "@tanstack/eslint-plugin-query": "^4.29.9",
203
208
  "eslint-plugin-array-func": "^3.1.8",
204
209
  "eslint-plugin-ava": "^14.0.0",
@@ -0,0 +1 @@
1
+ module.exports = require("./dist/typescript-type-checking");
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var r=s=>{switch(s){case"typescript":return ["*.ts","*.tsx","*.mts","*.cts","*.mdx"];case"jsx_and_tsx":return ["*.jsx","*.tsx","*.md{,x}"];case"js_and_ts":return ["*.js","*.mjs","*.cjs","*.ts","*.mts","*.cts","*.mdx"];case"javascript":return ["*.js","*.mjs","*.cjs"];case"all":return ["*.js","*.jsx","*.mjs","*.cjs","*.ts","*.tsx","*.mts","*.cts","*.mdx"];case"jest":return ["**/*.spec.{js,ts,tsx}","**/*.test.{js,ts,tsx}","**/test/*.{js,ts,tsx}","**/__mocks__/*.{js,ts,tsx}","**/__tests__/*.{js,ts,tsx}"];case"ava":return ["test.js","src/test.js","source/test.js","**/test-*.js","**/*.spec.js","**/*.test.js","**/test/**/*.js","**/tests/**/*.js","**/__tests__/**/*.js"];case"vitest":return ["**/__tests__/**/*.?(c|m)[jt]s?(x)","**/?(*.){test,spec}.?(c|m)[jt]s?(x)"];case"tests":return ["test.js","src/test.js","source/test.js","**/test-*.js","**/*.spec.js","**/*.test.js","**/test/**/*.js","**/tests/**/*.js","**/__tests__/**/*.js","**/*.spec.{js,ts,tsx}","**/*.test.{js,ts,tsx}","**/test/*.{js,ts,tsx}","**/__mocks__/*.{js,ts,tsx}","**/__tests__/*.{js,ts,tsx}","**/__tests__/**/*.?(c|m)[jt]s?(x)","**/?(*.){test,spec}.?(c|m)[jt]s?(x)"];default:throw new Error(`Unknown type: ${s}`)}},j=(s,t,e)=>({env:e,overrides:[{files:r(s),...t}]}),c=s=>({overrides:s.map(({config:t,type:e})=>({files:r(e),...t}))});
4
-
5
- exports.a = j;
6
- exports.b = c;
7
- //# sourceMappingURL=out.js.map
8
- //# sourceMappingURL=chunk-YRRY5AGG.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/create-config.ts"],"names":["getType","type","createConfig","config","environment","createConfigs","rules"],"mappings":"AAIA,IAAMA,EAAWC,GAAmB,CAChC,OAAQA,EAAM,CACV,IAAK,aAED,MAAO,CAAC,OAAQ,QAAS,QAAS,QAAS,OAAO,EAEtD,IAAK,cACD,MAAO,CAAC,QAAS,QAAS,UAAU,EAExC,IAAK,YACD,MAAO,CAAC,OAAQ,QAAS,QAAS,OAAQ,QAAS,QAAS,OAAO,EAEvE,IAAK,aACD,MAAO,CAAC,OAAQ,QAAS,OAAO,EAEpC,IAAK,MACD,MAAO,CAAC,OAAQ,QAAS,QAAS,QAAS,OAAQ,QAAS,QAAS,QAAS,OAAO,EAEzF,IAAK,OACD,MAAO,CAEH,wBACA,wBACA,wBAGA,6BACA,4BACJ,EAEJ,IAAK,MACD,MAAO,CACH,UACA,cACA,iBACA,eACA,eACA,eACA,kBACA,mBACA,sBACJ,EAEJ,IAAK,SACD,MAAO,CAAC,oCAAqC,qCAAqC,EAEtF,IAAK,QACD,MAAO,CAEH,UACA,cACA,iBACA,eACA,eACA,eACA,kBACA,mBACA,uBAGA,wBACA,wBACA,wBACA,6BACA,6BACA,oCACA,qCACJ,EAEJ,QACI,MAAM,IAAI,MAAM,iBAAiBA,CAAI,EAAE,CAE/C,CACJ,EAEaC,EAAe,CAACD,EAAgBE,EAA8CC,KAChF,CACH,IAAKA,EACL,UAAW,CACP,CACI,MAAOJ,EAAQC,CAAI,EACnB,GAAGE,CACP,CACJ,CACJ,GAESE,EACTC,IAKO,CACH,UAAWA,EAAM,IAAI,CAAC,CAAE,OAAAH,EAAQ,KAAAF,CAAK,KAC1B,CACH,MAAOD,EAAQC,CAAI,EACnB,GAAGE,CACP,EACH,CACL","sourcesContent":["import type { Linter } from \"eslint\";\n\ntype FileType = \"all\" | \"ava\" | \"javascript\" | \"jest\" | \"js_and_ts\" | \"jsx_and_tsx\" | \"tests\" | \"typescript\" | \"vitest\";\n\nconst getType = (type: FileType) => {\n switch (type) {\n case \"typescript\": {\n // @see https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#new-file-extensions\n return [\"*.ts\", \"*.tsx\", \"*.mts\", \"*.cts\", \"*.mdx\"];\n }\n case \"jsx_and_tsx\": {\n return [\"*.jsx\", \"*.tsx\", \"*.md{,x}\"];\n }\n case \"js_and_ts\": {\n return [\"*.js\", \"*.mjs\", \"*.cjs\", \"*.ts\", \"*.mts\", \"*.cts\", \"*.mdx\"];\n }\n case \"javascript\": {\n return [\"*.js\", \"*.mjs\", \"*.cjs\"];\n }\n case \"all\": {\n return [\"*.js\", \"*.jsx\", \"*.mjs\", \"*.cjs\", \"*.ts\", \"*.tsx\", \"*.mts\", \"*.cts\", \"*.mdx\"];\n }\n case \"jest\": {\n return [\n // Test files\n \"**/*.spec.{js,ts,tsx}\",\n \"**/*.test.{js,ts,tsx}\",\n \"**/test/*.{js,ts,tsx}\",\n\n // Facebook convention\n \"**/__mocks__/*.{js,ts,tsx}\",\n \"**/__tests__/*.{js,ts,tsx}\",\n ];\n }\n case \"ava\": {\n return [\n \"test.js\",\n \"src/test.js\",\n \"source/test.js\",\n \"**/test-*.js\",\n \"**/*.spec.js\",\n \"**/*.test.js\",\n \"**/test/**/*.js\",\n \"**/tests/**/*.js\",\n \"**/__tests__/**/*.js\",\n ];\n }\n case \"vitest\": {\n return [\"**/__tests__/**/*.?(c|m)[jt]s?(x)\", \"**/?(*.){test,spec}.?(c|m)[jt]s?(x)\"];\n }\n case \"tests\": {\n return [\n // ava\n \"test.js\",\n \"src/test.js\",\n \"source/test.js\",\n \"**/test-*.js\",\n \"**/*.spec.js\",\n \"**/*.test.js\",\n \"**/test/**/*.js\",\n \"**/tests/**/*.js\",\n \"**/__tests__/**/*.js\",\n\n // jest\n \"**/*.spec.{js,ts,tsx}\",\n \"**/*.test.{js,ts,tsx}\",\n \"**/test/*.{js,ts,tsx}\",\n \"**/__mocks__/*.{js,ts,tsx}\",\n \"**/__tests__/*.{js,ts,tsx}\",\n \"**/__tests__/**/*.?(c|m)[jt]s?(x)\",\n \"**/?(*.){test,spec}.?(c|m)[jt]s?(x)\",\n ];\n }\n default: {\n throw new Error(`Unknown type: ${type}`);\n }\n }\n};\n\nexport const createConfig = (type: FileType, config: Omit<Linter.ConfigOverride, \"files\">, environment?: { [name: string]: boolean }): Linter.Config => {\n return {\n env: environment,\n overrides: [\n {\n files: getType(type),\n ...config,\n },\n ],\n };\n};\nexport const createConfigs = (\n rules: {\n config: Omit<Linter.ConfigOverride, \"files\">;\n type: FileType;\n }[],\n): Linter.Config => {\n return {\n overrides: rules.map(({ config, type }) => {\n return {\n files: getType(type),\n ...config,\n };\n }),\n };\n};\n"]}