@hexadrop/eslint-config 0.0.1-beta.1 → 0.0.1-beta.10

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
@@ -881,7 +881,9 @@ var IMPORTS_CONFIG_NAME_RULES_TYPESCRIPT = `${IMPORTS_CONFIG_NAME_RULES}/typescr
881
881
  var IMPORTS_CONFIG_NAME_RULES_STATIC = `${IMPORTS_CONFIG_NAME_RULES}/static`;
882
882
  var IMPORTS_CONFIG_NAME_RULES_STATIC_MARKDOWN_SOURCE = `${IMPORTS_CONFIG_NAME_RULES_STATIC}/markdown/source`;
883
883
  var IMPORTS_CONFIG_NAME_RULES_STYLISTIC = `${IMPORTS_CONFIG_NAME_RULES}/stylistic`;
884
- var IMPORTS_CONFIG_NAME_RULES_STYLISTIC_MARKDOWN_SOURCE = `${IMPORTS_CONFIG_NAME_RULES_STYLISTIC}//markdown/source`;
884
+ var IMPORTS_CONFIG_NAME_RULES_STYLISTIC_ASTRO = `${IMPORTS_CONFIG_NAME_RULES_STYLISTIC}/astro`;
885
+ var IMPORTS_CONFIG_NAME_RULES_STYLISTIC_TYPESCRIPT_DTS = `${IMPORTS_CONFIG_NAME_RULES_STYLISTIC}/typescript/dts`;
886
+ var IMPORTS_CONFIG_NAME_RULES_STYLISTIC_MARKDOWN_SOURCE = `${IMPORTS_CONFIG_NAME_RULES_STYLISTIC}/markdown/source`;
885
887
 
886
888
  // src/config/imports/imports.config.ts
887
889
  async function imports(options) {
@@ -1057,6 +1059,15 @@ async function imports(options) {
1057
1059
  ]
1058
1060
  }
1059
1061
  });
1062
+ if (typescript2) {
1063
+ configs.push({
1064
+ files: DTS_GLOBS,
1065
+ name: IMPORTS_CONFIG_NAME_RULES_STYLISTIC_TYPESCRIPT_DTS,
1066
+ rules: {
1067
+ [`${importXPluginRename}/prefer-default-export`]: "off"
1068
+ }
1069
+ });
1070
+ }
1060
1071
  if (markdown2) {
1061
1072
  configs.push({
1062
1073
  files: GLOB_MARKDOWN_SOURCE,
@@ -1066,6 +1077,16 @@ async function imports(options) {
1066
1077
  }
1067
1078
  });
1068
1079
  }
1080
+ if (astro2) {
1081
+ configs.push({
1082
+ files: GLOB_ASTRO,
1083
+ name: IMPORTS_CONFIG_NAME_RULES_STYLISTIC_ASTRO,
1084
+ rules: {
1085
+ [`${importXPluginRename}/exports-last`]: ["off"],
1086
+ [`${importXPluginRename}/prefer-default-export`]: ["off"]
1087
+ }
1088
+ });
1089
+ }
1069
1090
  }
1070
1091
  return configs;
1071
1092
  }
@@ -1301,6 +1322,7 @@ async function stylistic(options) {
1301
1322
  [`${stylisticPluginRename}/line-comment-position`]: ["error", { position: "above" }],
1302
1323
  [`${stylisticPluginRename}/max-len`]: "off",
1303
1324
  [`${stylisticPluginRename}/multiline-comment-style`]: ["error", "starred-block"],
1325
+ [`${stylisticPluginRename}/multiline-ternary`]: "off",
1304
1326
  [`${stylisticPluginRename}/no-extra-semi`]: "error",
1305
1327
  [`${stylisticPluginRename}/padding-line-between-statements`]: [
1306
1328
  "error",
@@ -1882,13 +1904,19 @@ function defaultOptions(options = {}) {
1882
1904
  } else if (installedTypescript) {
1883
1905
  if (options.typescript === void 0) {
1884
1906
  typescript2 = getCwdTsconfigPath() ?? true;
1885
- } else if (options.typescript === "string" || Array.isArray(options.typescript)) {
1907
+ } else if (options.typescript === "string") {
1886
1908
  typescript2 = options.typescript.length > 0 ? options.typescript : true;
1909
+ } else if (Array.isArray(options.typescript)) {
1910
+ typescript2 = options.typescript.length > 0 ? options.typescript.filter(Boolean) : true;
1887
1911
  }
1888
1912
  }
1889
1913
  return {
1890
1914
  astro: options.astro ?? installedAstro,
1891
- ignore: options.ignore ?? true,
1915
+ ignore: typeof options.ignore === "object" ? {
1916
+ ...options.ignore,
1917
+ files: typeof options.ignore.files === "string" ? options.ignore.files : options.ignore.files?.filter(Boolean) ?? [],
1918
+ globs: options.ignore.globs?.filter(Boolean) ?? []
1919
+ } : options.ignore ?? true,
1892
1920
  imports: options.imports ?? true,
1893
1921
  json: options.json ?? true,
1894
1922
  markdown: options.markdown ?? true,
@@ -1898,7 +1926,11 @@ function defaultOptions(options = {}) {
1898
1926
  node: true,
1899
1927
  webpack: false,
1900
1928
  ...options.module,
1901
- ignore: [String.raw`bun\:.*`, String.raw`astro\:.*`, ...options.module?.ignore ?? []]
1929
+ ignore: [
1930
+ String.raw`bun\:.*`,
1931
+ String.raw`astro\:.*`,
1932
+ ...options.module?.ignore?.filter(Boolean) ?? []
1933
+ ]
1902
1934
  },
1903
1935
  node: options.node ?? true,
1904
1936
  react: options.react ?? installedReact,