@shayanthenerd/eslint-config 0.30.3 → 0.31.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.
Files changed (42) hide show
  1. package/dist/configs/astro.mjs +6 -5
  2. package/dist/configs/baseline.mjs +1 -1
  3. package/dist/configs/css.mjs +5 -4
  4. package/dist/configs/cypress.mjs +4 -3
  5. package/dist/configs/html.mjs +4 -3
  6. package/dist/configs/importX.mjs +5 -4
  7. package/dist/configs/javascript.mjs +4 -3
  8. package/dist/configs/markdown.mjs +4 -3
  9. package/dist/configs/next.mjs +4 -3
  10. package/dist/configs/node.mjs +6 -5
  11. package/dist/configs/nuxt.mjs +23 -22
  12. package/dist/configs/packageJson.mjs +4 -3
  13. package/dist/configs/perfectionist.mjs +5 -4
  14. package/dist/configs/playwright.mjs +4 -3
  15. package/dist/configs/promise.mjs +5 -4
  16. package/dist/configs/react.mjs +4 -3
  17. package/dist/configs/storybook.mjs +4 -3
  18. package/dist/configs/stylistic.mjs +5 -4
  19. package/dist/configs/tailwind.mjs +5 -4
  20. package/dist/configs/typescript.mjs +5 -4
  21. package/dist/configs/unicorn.mjs +5 -4
  22. package/dist/configs/vitest.mjs +4 -3
  23. package/dist/configs/vue.mjs +5 -4
  24. package/dist/configs/zod.mjs +5 -4
  25. package/dist/helpers/options/enableDetectedConfigs.mjs +1 -1
  26. package/dist/helpers/options/mergeWithDefaults.mjs +1 -1
  27. package/dist/index.mjs +19 -18
  28. package/dist/rules/baseline.mjs +1 -1
  29. package/dist/rules/css.mjs +1 -1
  30. package/dist/rules/html.mjs +1 -1
  31. package/dist/rules/markdown.mjs +1 -1
  32. package/dist/rules/perfectionist.mjs +8 -13
  33. package/dist/rules/react.mjs +1 -1
  34. package/dist/rules/stylistic.mjs +4 -2
  35. package/dist/rules/tailwind.mjs +1 -1
  36. package/dist/rules/typescript.mjs +2 -2
  37. package/dist/rules/unicorn.mjs +1 -1
  38. package/dist/rules/vue.mjs +4 -3
  39. package/dist/rules/zod.mjs +1 -1
  40. package/dist/types/eslint-schema.d.mts +603 -430
  41. package/dist/types/index.d.mts +8 -6
  42. package/package.json +19 -17
@@ -1,16 +1,16 @@
1
1
  import { globs } from "../helpers/globs.mjs";
2
- import { isEnabled } from "../utils/isEnabled.mjs";
3
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
4
  import { getAstroRules } from "../rules/astro.mjs";
5
+ import * as eslintParserAstro from "astro-eslint-parser";
5
6
  import { mergeConfigs } from "eslint-flat-config-utils";
6
- import { parser } from "typescript-eslint";
7
7
  import eslintPluginAstro from "eslint-plugin-astro";
8
- import * as eslintParserAstro from "astro-eslint-parser";
8
+ import { parser } from "typescript-eslint";
9
9
  //#region src/configs/astro.ts
10
10
  function getAstroConfig(options) {
11
11
  const { astro } = options.configs;
12
12
  const { overrides } = isEnabled(astro) ? astro : defaultOptions.configs.astro;
13
- return mergeConfigs({
13
+ const astroConfig = {
14
14
  name: "shayanthenerd/astro",
15
15
  files: [globs.astro],
16
16
  plugins: { astro: eslintPluginAstro },
@@ -26,7 +26,8 @@ function getAstroConfig(options) {
26
26
  }
27
27
  },
28
28
  rules: getAstroRules(options)
29
- }, overrides);
29
+ };
30
+ return mergeConfigs(astroConfig, overrides);
30
31
  }
31
32
  //#endregion
32
33
  export { getAstroConfig };
@@ -1,7 +1,7 @@
1
- import { isTruthy } from "../utils/isTruthy.mjs";
2
1
  import { globs } from "../helpers/globs.mjs";
3
2
  import { isEnabled } from "../utils/isEnabled.mjs";
4
3
  import { getBaselineRules } from "../rules/baseline.mjs";
4
+ import { isTruthy } from "../utils/isTruthy.mjs";
5
5
  import eslintPluginBaselineJs from "eslint-plugin-baseline-js";
6
6
  //#region src/configs/baseline.ts
7
7
  function getBaselineConfig(options) {
@@ -1,17 +1,17 @@
1
1
  import { globs } from "../helpers/globs.mjs";
2
- import { isEnabled } from "../utils/isEnabled.mjs";
3
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
4
  import { getCssRules } from "../rules/css.mjs";
5
- import eslintPluginCss from "@eslint/css";
6
5
  import { mergeConfigs } from "eslint-flat-config-utils";
7
6
  import eslintPluginUnicorn from "eslint-plugin-unicorn";
7
+ import eslintPluginCss from "@eslint/css";
8
8
  import { tailwind3, tailwind4 } from "tailwind-csstree";
9
9
  //#region src/configs/css.ts
10
10
  function getCssConfig(options) {
11
11
  const { css, unicorn, tailwind } = options.configs;
12
12
  const { overrides } = isEnabled(css) ? css : defaultOptions.configs.css;
13
13
  const tailwindSyntax = isEnabled(tailwind) && tailwind.entryPoint ? tailwind4 : tailwind3;
14
- return mergeConfigs({
14
+ const cssConfig = {
15
15
  name: "shayanthenerd/css",
16
16
  files: [globs.css],
17
17
  plugins: {
@@ -24,7 +24,8 @@ function getCssConfig(options) {
24
24
  customSyntax: isEnabled(tailwind) ? tailwindSyntax : void 0
25
25
  },
26
26
  rules: getCssRules(options)
27
- }, overrides);
27
+ };
28
+ return mergeConfigs(cssConfig, overrides);
28
29
  }
29
30
  //#endregion
30
31
  export { getCssConfig };
@@ -1,6 +1,6 @@
1
1
  import { globs } from "../helpers/globs.mjs";
2
- import { isEnabled } from "../utils/isEnabled.mjs";
3
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
4
  import { getCypressRules } from "../rules/cypress.mjs";
5
5
  import { mergeConfigs } from "eslint-flat-config-utils";
6
6
  import eslintPluginCypress from "eslint-plugin-cypress";
@@ -8,13 +8,14 @@ import eslintPluginCypress from "eslint-plugin-cypress";
8
8
  function getCypressConfig(options) {
9
9
  const { cypress } = options.configs.test;
10
10
  const { overrides } = isEnabled(cypress) ? cypress : defaultOptions.configs.test.cypress;
11
- return mergeConfigs({
11
+ const cypressConfig = {
12
12
  name: "shayanthenerd/cypress",
13
13
  files: [globs.test],
14
14
  plugins: { cypress: eslintPluginCypress },
15
15
  languageOptions: { globals: eslintPluginCypress.configs.recommended.languageOptions?.globals },
16
16
  rules: getCypressRules()
17
- }, overrides);
17
+ };
18
+ return mergeConfigs(cypressConfig, overrides);
18
19
  }
19
20
  //#endregion
20
21
  export { getCypressConfig };
@@ -1,6 +1,6 @@
1
1
  import { globs } from "../helpers/globs.mjs";
2
- import { isEnabled } from "../utils/isEnabled.mjs";
3
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
4
  import { getHtmlRules } from "../rules/html.mjs";
5
5
  import { mergeConfigs } from "eslint-flat-config-utils";
6
6
  import eslintPluginUnicorn from "eslint-plugin-unicorn";
@@ -9,7 +9,7 @@ import eslintPluginHtml from "@html-eslint/eslint-plugin";
9
9
  function getHtmlConfig(options) {
10
10
  const { html, unicorn } = options.configs;
11
11
  const { overrides } = isEnabled(html) ? html : defaultOptions.configs.html;
12
- return mergeConfigs({
12
+ const htmlConfig = {
13
13
  name: "shayanthenerd/html",
14
14
  files: [globs.html],
15
15
  plugins: {
@@ -18,7 +18,8 @@ function getHtmlConfig(options) {
18
18
  },
19
19
  languageOptions: { parser: eslintPluginHtml.configs["flat/recommended"].languageOptions.parser },
20
20
  rules: getHtmlRules(options)
21
- }, overrides);
21
+ };
22
+ return mergeConfigs(htmlConfig, overrides);
22
23
  }
23
24
  //#endregion
24
25
  export { getHtmlConfig };
@@ -1,7 +1,7 @@
1
- import { isTruthy } from "../utils/isTruthy.mjs";
2
1
  import { globs } from "../helpers/globs.mjs";
3
- import { isEnabled } from "../utils/isEnabled.mjs";
4
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
+ import { isTruthy } from "../utils/isTruthy.mjs";
5
5
  import { getImportXRules } from "../rules/importX.mjs";
6
6
  import { mergeConfigs } from "eslint-flat-config-utils";
7
7
  import eslintPluginImportX from "eslint-plugin-import-x";
@@ -9,7 +9,7 @@ import eslintPluginImportX from "eslint-plugin-import-x";
9
9
  function getImportXConfig(options) {
10
10
  const { vue, astro, importX, typescript } = options.configs;
11
11
  const { overrides } = isEnabled(importX) ? importX : defaultOptions.configs.importX;
12
- return mergeConfigs({
12
+ const importXConfig = {
13
13
  name: "shayanthenerd/import-x",
14
14
  files: [
15
15
  globs.src,
@@ -20,7 +20,8 @@ function getImportXConfig(options) {
20
20
  plugins: { "import-x": eslintPluginImportX },
21
21
  settings: isEnabled(typescript) ? eslintPluginImportX.flatConfigs.typescript.settings : {},
22
22
  rules: getImportXRules(options)
23
- }, overrides);
23
+ };
24
+ return mergeConfigs(importXConfig, overrides);
24
25
  }
25
26
  //#endregion
26
27
  export { getImportXConfig };
@@ -1,6 +1,6 @@
1
- import { isTruthy } from "../utils/isTruthy.mjs";
2
1
  import { globs } from "../helpers/globs.mjs";
3
2
  import { isEnabled } from "../utils/isEnabled.mjs";
3
+ import { isTruthy } from "../utils/isTruthy.mjs";
4
4
  import { getJavaScriptRules } from "../rules/javascript.mjs";
5
5
  import { mergeConfigs } from "eslint-flat-config-utils";
6
6
  import { parser } from "typescript-eslint";
@@ -8,7 +8,7 @@ import globals from "globals";
8
8
  //#region src/configs/javascript.ts
9
9
  function getJavascriptConfig(options) {
10
10
  const { env, configs: { vue, astro, javascript: { overrides } }, project: { globals: { bun, node, deno, vitest, worker, browser, commonjs, nodeBuiltin, audioWorklet, webextension, sharedWorker, serviceworker, vue: vueGlobals, astro: astroGlobals, custom: userGlobals } } } = options;
11
- return mergeConfigs({
11
+ const baseConfig = {
12
12
  name: "shayanthenerd/base",
13
13
  files: [
14
14
  globs.src,
@@ -46,7 +46,8 @@ function getJavascriptConfig(options) {
46
46
  }
47
47
  },
48
48
  rules: getJavaScriptRules(options)
49
- }, overrides);
49
+ };
50
+ return mergeConfigs(baseConfig, overrides);
50
51
  }
51
52
  //#endregion
52
53
  export { getJavascriptConfig };
@@ -1,6 +1,6 @@
1
1
  import { globs } from "../helpers/globs.mjs";
2
- import { isEnabled } from "../utils/isEnabled.mjs";
3
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
4
  import { getMarkdownRules } from "../rules/markdown.mjs";
5
5
  import { mergeConfigs } from "eslint-flat-config-utils";
6
6
  import eslintPluginUnicorn from "eslint-plugin-unicorn";
@@ -9,7 +9,7 @@ import eslintPluginMarkdown from "@eslint/markdown";
9
9
  function getMarkdownConfig(options) {
10
10
  const { unicorn, markdown } = options.configs;
11
11
  const { language, frontmatter, overrides } = isEnabled(markdown) ? markdown : defaultOptions.configs.markdown;
12
- return mergeConfigs({
12
+ const markdownConfig = {
13
13
  name: "shayanthenerd/markdown",
14
14
  files: [globs.markdown],
15
15
  plugins: {
@@ -22,7 +22,8 @@ function getMarkdownConfig(options) {
22
22
  frontmatter
23
23
  },
24
24
  rules: getMarkdownRules(options)
25
- }, overrides);
25
+ };
26
+ return mergeConfigs(markdownConfig, overrides);
26
27
  }
27
28
  //#endregion
28
29
  export { getMarkdownConfig };
@@ -1,6 +1,6 @@
1
1
  import { globs } from "../helpers/globs.mjs";
2
- import { isEnabled } from "../utils/isEnabled.mjs";
3
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
4
  import { getNextRules } from "../rules/next.mjs";
5
5
  import { mergeConfigs } from "eslint-flat-config-utils";
6
6
  import eslintPluginNext from "@next/eslint-plugin-next";
@@ -8,13 +8,14 @@ import eslintPluginNext from "@next/eslint-plugin-next";
8
8
  function getNextConfig(options) {
9
9
  const { packageDir, configs: { next } } = options;
10
10
  const { overrides } = isEnabled(next) ? next : defaultOptions.configs.next;
11
- return mergeConfigs({
11
+ const nextConfig = {
12
12
  name: "shayanthenerd/next",
13
13
  files: [globs.src, globs.jsxTsx],
14
14
  plugins: { next: eslintPluginNext },
15
15
  settings: { next: { rootDir: packageDir } },
16
16
  rules: getNextRules()
17
- }, overrides);
17
+ };
18
+ return mergeConfigs(nextConfig, overrides);
18
19
  }
19
20
  //#endregion
20
21
  export { getNextConfig };
@@ -1,17 +1,17 @@
1
- import { isTruthy } from "../utils/isTruthy.mjs";
2
1
  import { globs } from "../helpers/globs.mjs";
3
- import { isEnabled } from "../utils/isEnabled.mjs";
4
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
+ import { isTruthy } from "../utils/isTruthy.mjs";
5
5
  import { getNodeRules } from "../rules/node.mjs";
6
6
  import { mergeConfigs } from "eslint-flat-config-utils";
7
- import eslintPluginNode from "eslint-plugin-n";
8
7
  import path from "node:path";
8
+ import eslintPluginNode from "eslint-plugin-n";
9
9
  //#region src/configs/node.ts
10
10
  function getNodeConfig(options) {
11
11
  const { tsConfig, configs: { vue, node, astro } } = options;
12
12
  const { overrides } = isEnabled(node) ? node : defaultOptions.configs.node;
13
13
  const tsconfigPath = tsConfig ? path.resolve(tsConfig.rootDir, tsConfig.filename) : void 0;
14
- return mergeConfigs({
14
+ const nodeConfig = {
15
15
  name: "shayanthenerd/node",
16
16
  files: [
17
17
  globs.src,
@@ -22,7 +22,8 @@ function getNodeConfig(options) {
22
22
  plugins: { n: eslintPluginNode },
23
23
  settings: { n: tsconfigPath ? { tsconfigPath } : void 0 },
24
24
  rules: getNodeRules(options)
25
- }, overrides);
25
+ };
26
+ return mergeConfigs(nodeConfig, overrides);
26
27
  }
27
28
  //#endregion
28
29
  export { getNodeConfig };
@@ -1,12 +1,12 @@
1
1
  import { globs } from "../helpers/globs.mjs";
2
- import { isEnabled } from "../utils/isEnabled.mjs";
3
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
4
  import { getNuxtRules } from "../rules/nuxt.mjs";
5
5
  import { mergeConfigs } from "eslint-flat-config-utils";
6
- import eslintPluginVue from "eslint-plugin-vue";
7
6
  import { parser } from "typescript-eslint";
8
- import eslintPluginNuxt from "@nuxt/eslint-plugin";
7
+ import eslintPluginVue from "eslint-plugin-vue";
9
8
  import eslintPluginNuxtLinkChecker from "nuxt-link-checker/eslint";
9
+ import eslintPluginNuxt from "@nuxt/eslint-plugin";
10
10
  //#region src/configs/nuxt.ts
11
11
  const baseVueConfig = eslintPluginVue.configs["flat/base"].find((config) => config.languageOptions?.parser);
12
12
  const middlewaresConfig = {
@@ -35,26 +35,27 @@ const serverComponentsConfig = {
35
35
  function getNuxtConfigs(options) {
36
36
  const { nuxt } = options.configs;
37
37
  const { overrides } = isEnabled(nuxt) ? nuxt : defaultOptions.configs.nuxt;
38
+ const config = {
39
+ name: "shayanthenerd/nuxt",
40
+ files: [globs.vue],
41
+ plugins: {
42
+ "vue": eslintPluginVue,
43
+ "nuxt": eslintPluginNuxt,
44
+ "link-checker": eslintPluginNuxtLinkChecker
45
+ },
46
+ processor: "vue/vue",
47
+ languageOptions: {
48
+ parser: baseVueConfig?.languageOptions?.parser,
49
+ parserOptions: {
50
+ parser,
51
+ extraFileExtensions: [".vue"],
52
+ vueFeatures: { filter: false }
53
+ }
54
+ },
55
+ rules: getNuxtRules()
56
+ };
38
57
  return [
39
- mergeConfigs({
40
- name: "shayanthenerd/nuxt",
41
- files: [globs.vue],
42
- plugins: {
43
- "vue": eslintPluginVue,
44
- "nuxt": eslintPluginNuxt,
45
- "link-checker": eslintPluginNuxtLinkChecker
46
- },
47
- processor: "vue/vue",
48
- languageOptions: {
49
- parser: baseVueConfig?.languageOptions?.parser,
50
- parserOptions: {
51
- parser,
52
- extraFileExtensions: [".vue"],
53
- vueFeatures: { filter: false }
54
- }
55
- },
56
- rules: getNuxtRules()
57
- }, overrides),
58
+ mergeConfigs(config, overrides),
58
59
  middlewaresConfig,
59
60
  componentNamesConfig,
60
61
  serverComponentsConfig
@@ -1,6 +1,6 @@
1
1
  import { globs } from "../helpers/globs.mjs";
2
- import { isEnabled } from "../utils/isEnabled.mjs";
3
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
4
  import { getPackageJsonRules } from "../rules/packageJson.mjs";
5
5
  import { mergeConfigs } from "eslint-flat-config-utils";
6
6
  import eslintPluginPackageJson from "eslint-plugin-package-json";
@@ -8,13 +8,14 @@ import eslintPluginPackageJson from "eslint-plugin-package-json";
8
8
  function getPackageJsonConfig(options) {
9
9
  const { packageJson } = options.configs;
10
10
  const { overrides } = isEnabled(packageJson) ? packageJson : defaultOptions.configs.packageJson;
11
- return mergeConfigs({
11
+ const packageJsonConfig = {
12
12
  name: "shayanthenerd/package-json",
13
13
  files: [globs.packageJson],
14
14
  plugins: { "package-json": eslintPluginPackageJson },
15
15
  languageOptions: { parser: eslintPluginPackageJson.configs.recommended.languageOptions.parser },
16
16
  rules: getPackageJsonRules()
17
- }, overrides);
17
+ };
18
+ return mergeConfigs(packageJsonConfig, overrides);
18
19
  }
19
20
  //#endregion
20
21
  export { getPackageJsonConfig };
@@ -1,7 +1,7 @@
1
- import { isTruthy } from "../utils/isTruthy.mjs";
2
1
  import { globs } from "../helpers/globs.mjs";
3
- import { isEnabled } from "../utils/isEnabled.mjs";
4
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
+ import { isTruthy } from "../utils/isTruthy.mjs";
5
5
  import { getPerfectionistRules } from "../rules/perfectionist.mjs";
6
6
  import { mergeConfigs } from "eslint-flat-config-utils";
7
7
  import eslintPluginPerfectionist from "eslint-plugin-perfectionist";
@@ -9,7 +9,7 @@ import eslintPluginPerfectionist from "eslint-plugin-perfectionist";
9
9
  function getPerfectionistConfig(options) {
10
10
  const { vue, astro, perfectionist } = options.configs;
11
11
  const { sortType, overrides } = isEnabled(perfectionist) ? perfectionist : defaultOptions.configs.perfectionist;
12
- return mergeConfigs({
12
+ const perfectionistConfig = {
13
13
  name: "shayanthenerd/perfectionist",
14
14
  files: [
15
15
  globs.src,
@@ -27,7 +27,8 @@ function getPerfectionistConfig(options) {
27
27
  }
28
28
  } },
29
29
  rules: getPerfectionistRules(options)
30
- }, overrides);
30
+ };
31
+ return mergeConfigs(perfectionistConfig, overrides);
31
32
  }
32
33
  //#endregion
33
34
  export { getPerfectionistConfig };
@@ -1,6 +1,6 @@
1
1
  import { globs } from "../helpers/globs.mjs";
2
- import { isEnabled } from "../utils/isEnabled.mjs";
3
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
4
  import { getPlaywrightRules } from "../rules/playwright.mjs";
5
5
  import { mergeConfigs } from "eslint-flat-config-utils";
6
6
  import eslintPluginPlaywright from "eslint-plugin-playwright";
@@ -8,13 +8,14 @@ import eslintPluginPlaywright from "eslint-plugin-playwright";
8
8
  function getPlaywrightConfig(options) {
9
9
  const { playwright } = options.configs.test;
10
10
  const { overrides } = isEnabled(playwright) ? playwright : defaultOptions.configs.test.playwright;
11
- return mergeConfigs({
11
+ const playwrightConfig = {
12
12
  name: "shayanthenerd/playwright",
13
13
  files: [globs.test],
14
14
  plugins: { playwright: eslintPluginPlaywright },
15
15
  languageOptions: { globals: eslintPluginPlaywright.configs["flat/recommended"].languageOptions?.globals },
16
16
  rules: getPlaywrightRules(options)
17
- }, overrides);
17
+ };
18
+ return mergeConfigs(playwrightConfig, overrides);
18
19
  }
19
20
  //#endregion
20
21
  export { getPlaywrightConfig };
@@ -1,7 +1,7 @@
1
- import { isTruthy } from "../utils/isTruthy.mjs";
2
1
  import { globs } from "../helpers/globs.mjs";
3
- import { isEnabled } from "../utils/isEnabled.mjs";
4
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
+ import { isTruthy } from "../utils/isTruthy.mjs";
5
5
  import { getPromiseRules } from "../rules/promise.mjs";
6
6
  import { mergeConfigs } from "eslint-flat-config-utils";
7
7
  import eslintPluginPromise from "eslint-plugin-promise";
@@ -9,7 +9,7 @@ import eslintPluginPromise from "eslint-plugin-promise";
9
9
  function getPromiseConfig(options) {
10
10
  const { vue, astro, promise } = options.configs;
11
11
  const { overrides } = isEnabled(promise) ? promise : defaultOptions.configs.promise;
12
- return mergeConfigs({
12
+ const promiseConfig = {
13
13
  name: "shayanthenerd/promise",
14
14
  files: [
15
15
  globs.src,
@@ -19,7 +19,8 @@ function getPromiseConfig(options) {
19
19
  ].filter(isTruthy),
20
20
  plugins: { promise: eslintPluginPromise },
21
21
  rules: getPromiseRules()
22
- }, overrides);
22
+ };
23
+ return mergeConfigs(promiseConfig, overrides);
23
24
  }
24
25
  //#endregion
25
26
  export { getPromiseConfig };
@@ -1,6 +1,6 @@
1
1
  import { globs } from "../helpers/globs.mjs";
2
- import { isEnabled } from "../utils/isEnabled.mjs";
3
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
4
  import { getReactRules } from "../rules/react.mjs";
5
5
  import { mergeConfigs } from "eslint-flat-config-utils";
6
6
  import eslintPluginUnicorn from "eslint-plugin-unicorn";
@@ -11,7 +11,7 @@ import eslintPluginHtmlReact from "@html-eslint/eslint-plugin-react";
11
11
  function getReactConfig(options) {
12
12
  const { react, unicorn } = options.configs;
13
13
  const { overrides, accessibility } = isEnabled(react) ? react : defaultOptions.configs.react;
14
- return mergeConfigs({
14
+ const reactConfig = {
15
15
  name: "shayanthenerd/react",
16
16
  files: [globs.src, globs.jsxTsx],
17
17
  plugins: {
@@ -21,7 +21,8 @@ function getReactConfig(options) {
21
21
  ...isEnabled(accessibility) && { "jsx-a11y": eslintPluginJsxA11y }
22
22
  },
23
23
  rules: getReactRules(options)
24
- }, overrides);
24
+ };
25
+ return mergeConfigs(reactConfig, overrides);
25
26
  }
26
27
  //#endregion
27
28
  export { getReactConfig };
@@ -1,6 +1,6 @@
1
1
  import { globs } from "../helpers/globs.mjs";
2
- import { isEnabled } from "../utils/isEnabled.mjs";
3
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
4
  import { getStorybookRules } from "../rules/storybook.mjs";
5
5
  import { mergeConfigs } from "eslint-flat-config-utils";
6
6
  import eslintPluginStorybook from "eslint-plugin-storybook";
@@ -8,12 +8,13 @@ import eslintPluginStorybook from "eslint-plugin-storybook";
8
8
  function getStorybookConfig(options) {
9
9
  const { storybook } = options.configs.test;
10
10
  const { overrides } = isEnabled(storybook) ? storybook : defaultOptions.configs.test.storybook;
11
- return mergeConfigs({
11
+ const storybookConfig = {
12
12
  name: "shayanthenerd/storybook",
13
13
  files: [globs.storybook],
14
14
  plugins: { storybook: eslintPluginStorybook },
15
15
  rules: getStorybookRules(options)
16
- }, overrides);
16
+ };
17
+ return mergeConfigs(storybookConfig, overrides);
17
18
  }
18
19
  //#endregion
19
20
  export { getStorybookConfig };
@@ -1,7 +1,7 @@
1
- import { isTruthy } from "../utils/isTruthy.mjs";
2
1
  import { globs } from "../helpers/globs.mjs";
3
- import { isEnabled } from "../utils/isEnabled.mjs";
4
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
+ import { isTruthy } from "../utils/isTruthy.mjs";
5
5
  import { getStylisticRules } from "../rules/stylistic.mjs";
6
6
  import { mergeConfigs } from "eslint-flat-config-utils";
7
7
  import eslintPluginStylistic from "@stylistic/eslint-plugin";
@@ -9,7 +9,7 @@ import eslintPluginStylistic from "@stylistic/eslint-plugin";
9
9
  function getStylisticConfig(options) {
10
10
  const { vue, astro, stylistic } = options.configs;
11
11
  const { overrides } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
12
- return mergeConfigs({
12
+ const stylisticConfig = {
13
13
  name: "shayanthenerd/stylistic",
14
14
  files: [
15
15
  globs.src,
@@ -19,7 +19,8 @@ function getStylisticConfig(options) {
19
19
  ].filter(isTruthy),
20
20
  plugins: { "@stylistic": eslintPluginStylistic },
21
21
  rules: getStylisticRules(options)
22
- }, overrides);
22
+ };
23
+ return mergeConfigs(stylisticConfig, overrides);
23
24
  }
24
25
  //#endregion
25
26
  export { getStylisticConfig };
@@ -1,7 +1,7 @@
1
- import { isTruthy } from "../utils/isTruthy.mjs";
2
1
  import { globs } from "../helpers/globs.mjs";
3
- import { isEnabled } from "../utils/isEnabled.mjs";
4
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
+ import { isTruthy } from "../utils/isTruthy.mjs";
5
5
  import { getTailwindRules } from "../rules/tailwind.mjs";
6
6
  import { mergeConfigs } from "eslint-flat-config-utils";
7
7
  import path from "node:path";
@@ -54,7 +54,7 @@ function getTailwindConfig(options) {
54
54
  isNuxtUiEnabled ? nuxtUiAttributes : void 0,
55
55
  isNuxtUiEnabled ? nuxtUiAppConfigUiFields : void 0
56
56
  ].filter(isTruthy);
57
- return mergeConfigs({
57
+ const tailwindConfig = {
58
58
  name: "shayanthenerd/tailwind",
59
59
  files: [
60
60
  globs.src,
@@ -73,7 +73,8 @@ function getTailwindConfig(options) {
73
73
  detectComponentClasses: true
74
74
  } },
75
75
  rules: getTailwindRules(options)
76
- }, overrides);
76
+ };
77
+ return mergeConfigs(tailwindConfig, overrides);
77
78
  }
78
79
  //#endregion
79
80
  export { getTailwindConfig };
@@ -1,7 +1,7 @@
1
- import { isTruthy } from "../utils/isTruthy.mjs";
2
1
  import { globs } from "../helpers/globs.mjs";
3
- import { isEnabled } from "../utils/isEnabled.mjs";
4
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
+ import { isTruthy } from "../utils/isTruthy.mjs";
5
5
  import { getTypescriptRules } from "../rules/typescript.mjs";
6
6
  import { mergeConfigs } from "eslint-flat-config-utils";
7
7
  import { parser, plugin } from "typescript-eslint";
@@ -11,7 +11,7 @@ function getTypescriptConfig(options) {
11
11
  const { tsConfig, configs: { vue, astro, typescript } } = options;
12
12
  const { allowedDefaultProjects } = isEnabled(typescript) ? typescript : defaultOptions.configs.typescript;
13
13
  const { overrides } = isEnabled(typescript) ? typescript : defaultOptions.configs.typescript;
14
- return mergeConfigs({
14
+ const typescriptConfig = {
15
15
  name: "shayanthenerd/typescript",
16
16
  files: [
17
17
  globs.src,
@@ -32,7 +32,8 @@ function getTypescriptConfig(options) {
32
32
  }
33
33
  },
34
34
  rules: getTypescriptRules(options)
35
- }, overrides);
35
+ };
36
+ return mergeConfigs(typescriptConfig, overrides);
36
37
  }
37
38
  //#endregion
38
39
  export { getTypescriptConfig };
@@ -1,7 +1,7 @@
1
- import { isTruthy } from "../utils/isTruthy.mjs";
2
1
  import { globs } from "../helpers/globs.mjs";
3
- import { isEnabled } from "../utils/isEnabled.mjs";
4
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
+ import { isTruthy } from "../utils/isTruthy.mjs";
5
5
  import { getUnicornRules } from "../rules/unicorn.mjs";
6
6
  import { mergeConfigs } from "eslint-flat-config-utils";
7
7
  import eslintPluginUnicorn from "eslint-plugin-unicorn";
@@ -9,7 +9,7 @@ import eslintPluginUnicorn from "eslint-plugin-unicorn";
9
9
  function getUnicornConfig(options) {
10
10
  const { vue, astro, unicorn } = options.configs;
11
11
  const { overrides } = isEnabled(unicorn) ? unicorn : defaultOptions.configs.unicorn;
12
- return mergeConfigs({
12
+ const astroConfig = {
13
13
  name: "shayanthenerd/unicorn",
14
14
  files: [
15
15
  globs.src,
@@ -19,7 +19,8 @@ function getUnicornConfig(options) {
19
19
  ].filter(isTruthy),
20
20
  plugins: { unicorn: eslintPluginUnicorn },
21
21
  rules: getUnicornRules(options)
22
- }, overrides);
22
+ };
23
+ return mergeConfigs(astroConfig, overrides);
23
24
  }
24
25
  //#endregion
25
26
  export { getUnicornConfig };
@@ -1,6 +1,6 @@
1
1
  import { globs } from "../helpers/globs.mjs";
2
- import { isEnabled } from "../utils/isEnabled.mjs";
3
2
  import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
+ import { isEnabled } from "../utils/isEnabled.mjs";
4
4
  import { getVitestRules } from "../rules/vitest.mjs";
5
5
  import { mergeConfigs } from "eslint-flat-config-utils";
6
6
  import eslintPluginVitest from "@vitest/eslint-plugin";
@@ -8,12 +8,13 @@ import eslintPluginVitest from "@vitest/eslint-plugin";
8
8
  function getVitestConfig(options) {
9
9
  const { vitest } = options.configs.test;
10
10
  const { overrides } = isEnabled(vitest) ? vitest : defaultOptions.configs.test.vitest;
11
- return mergeConfigs({
11
+ const vitestConfig = {
12
12
  name: "shayanthenerd/vitest",
13
13
  files: [globs.test],
14
14
  plugins: { vitest: eslintPluginVitest },
15
15
  rules: getVitestRules(options)
16
- }, overrides);
16
+ };
17
+ return mergeConfigs(vitestConfig, overrides);
17
18
  }
18
19
  //#endregion
19
20
  export { getVitestConfig };