@tb-dev/eslint-config 5.3.0 → 5.3.2

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/dist/index.cjs CHANGED
@@ -29,7 +29,11 @@ async function interopDefault(promise) {
29
29
  return result.default ?? result;
30
30
  }
31
31
  function isEnabled(config, feature) {
32
- if (Array.isArray(config)) return config.includes(feature);
32
+ if (Array.isArray(config)) {
33
+ return config.includes(feature);
34
+ } else if (typeof config === "boolean") {
35
+ return config;
36
+ }
33
37
  switch (feature) {
34
38
  case "perfectionist":
35
39
  return config?.perfectionist ?? true;
@@ -703,7 +707,7 @@ async function typescript(options) {
703
707
  "@typescript-eslint/prefer-enum-initializers": "error",
704
708
  "@typescript-eslint/prefer-find": "error",
705
709
  "@typescript-eslint/prefer-for-of": "error",
706
- "@typescript-eslint/prefer-function-type": "error",
710
+ "@typescript-eslint/prefer-function-type": "off",
707
711
  "@typescript-eslint/prefer-includes": "error",
708
712
  "@typescript-eslint/prefer-literal-enum-member": "error",
709
713
  "@typescript-eslint/prefer-nullish-coalescing": [
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ declare interface ConfigObject {
15
15
  }
16
16
 
17
17
  declare interface ConfigOptions {
18
- features?: FeaturesObject | (keyof FeaturesObject)[];
18
+ features?: FeaturesObject | (keyof FeaturesObject)[] | boolean;
19
19
  /** `tsconfig.json` files for TypeScript. */
20
20
  project: string[];
21
21
  ignores?: Ignores['ignores'];
package/dist/index.js CHANGED
@@ -25,7 +25,11 @@ async function interopDefault(promise) {
25
25
  return result.default ?? result;
26
26
  }
27
27
  function isEnabled(config, feature) {
28
- if (Array.isArray(config)) return config.includes(feature);
28
+ if (Array.isArray(config)) {
29
+ return config.includes(feature);
30
+ } else if (typeof config === "boolean") {
31
+ return config;
32
+ }
29
33
  switch (feature) {
30
34
  case "perfectionist":
31
35
  return config?.perfectionist ?? true;
@@ -699,7 +703,7 @@ async function typescript(options) {
699
703
  "@typescript-eslint/prefer-enum-initializers": "error",
700
704
  "@typescript-eslint/prefer-find": "error",
701
705
  "@typescript-eslint/prefer-for-of": "error",
702
- "@typescript-eslint/prefer-function-type": "error",
706
+ "@typescript-eslint/prefer-function-type": "off",
703
707
  "@typescript-eslint/prefer-includes": "error",
704
708
  "@typescript-eslint/prefer-literal-enum-member": "error",
705
709
  "@typescript-eslint/prefer-nullish-coalescing": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tb-dev/eslint-config",
3
- "version": "5.3.0",
3
+ "version": "5.3.2",
4
4
  "description": "ESLint config",
5
5
  "license": "MIT",
6
6
  "type": "module",