@workleap/eslint-configs 1.0.0 → 1.1.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 (66) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/by-project-type/defineMonorepoWorkspaceConfig.d.ts +2 -2
  3. package/dist/by-project-type/defineMonorepoWorkspaceConfig.js +10 -10
  4. package/dist/by-project-type/defineMonorepoWorkspaceConfig.js.map +1 -1
  5. package/dist/by-project-type/defineReactLibraryConfig.d.ts +3 -2
  6. package/dist/by-project-type/defineReactLibraryConfig.js +29 -24
  7. package/dist/by-project-type/defineReactLibraryConfig.js.map +1 -1
  8. package/dist/by-project-type/defineTypescriptLibraryConfig.d.ts +3 -2
  9. package/dist/by-project-type/defineTypescriptLibraryConfig.js +21 -16
  10. package/dist/by-project-type/defineTypescriptLibraryConfig.js.map +1 -1
  11. package/dist/by-project-type/defineWebApplicationConfig.d.ts +3 -2
  12. package/dist/by-project-type/defineWebApplicationConfig.js +29 -24
  13. package/dist/by-project-type/defineWebApplicationConfig.js.map +1 -1
  14. package/dist/core.d.ts +1 -1
  15. package/dist/core.js +2 -2
  16. package/dist/core.js.map +1 -1
  17. package/dist/index.d.ts +10 -10
  18. package/dist/index.js +41 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/jest.d.ts +2 -1
  21. package/dist/jest.js +7 -3
  22. package/dist/jest.js.map +1 -1
  23. package/dist/json.d.ts +1 -1
  24. package/dist/json.js +2 -2
  25. package/dist/json.js.map +1 -1
  26. package/dist/jsxAlly.d.ts +1 -1
  27. package/dist/jsxAlly.js +2 -2
  28. package/dist/jsxAlly.js.map +1 -1
  29. package/dist/packageJson.d.ts +1 -1
  30. package/dist/packageJson.js +2 -2
  31. package/dist/packageJson.js.map +1 -1
  32. package/dist/react.d.ts +1 -1
  33. package/dist/react.js +2 -2
  34. package/dist/react.js.map +1 -1
  35. package/dist/storybook.d.ts +1 -1
  36. package/dist/storybook.js +2 -2
  37. package/dist/storybook.js.map +1 -1
  38. package/dist/testingLibrary.d.ts +1 -1
  39. package/dist/testingLibrary.js +2 -2
  40. package/dist/testingLibrary.js.map +1 -1
  41. package/dist/typescript.d.ts +2 -2
  42. package/dist/typescript.js +2 -2
  43. package/dist/typescript.js.map +1 -1
  44. package/dist/vitest.d.ts +2 -1
  45. package/dist/vitest.js +6 -3
  46. package/dist/vitest.js.map +1 -1
  47. package/dist/yaml.d.ts +1 -1
  48. package/dist/yaml.js +2 -2
  49. package/dist/yaml.js.map +1 -1
  50. package/package.json +1 -1
  51. package/src/by-project-type/defineMonorepoWorkspaceConfig.ts +11 -11
  52. package/src/by-project-type/defineReactLibraryConfig.ts +31 -23
  53. package/src/by-project-type/defineTypescriptLibraryConfig.ts +23 -15
  54. package/src/by-project-type/defineWebApplicationConfig.ts +31 -90
  55. package/src/core.ts +1 -1
  56. package/src/index.ts +10 -10
  57. package/src/jest.ts +8 -1
  58. package/src/json.ts +1 -1
  59. package/src/jsxAlly.ts +1 -1
  60. package/src/packageJson.ts +1 -1
  61. package/src/react.ts +1 -1
  62. package/src/storybook.ts +1 -1
  63. package/src/testingLibrary.ts +1 -1
  64. package/src/typescript.ts +2 -2
  65. package/src/vitest.ts +7 -1
  66. package/src/yaml.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @workleap/eslint-configs
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#322](https://github.com/workleap/wl-web-configs/pull/322) [`9a6f6ed`](https://github.com/workleap/wl-web-configs/commit/9a6f6ed3f180d459c8bb04358b5b8be2d51d4d20) Thanks [@patricklafrance](https://github.com/patricklafrance)! - The package is now exporting all the granular configs, like "core", "react", "vitest", etc..
8
+
9
+ ## 1.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#319](https://github.com/workleap/wl-web-configs/pull/319) [`544890b`](https://github.com/workleap/wl-web-configs/commit/544890be5ec24b2d9ac010e84c510559822a7447) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Disable Jest tests by default.
14
+
3
15
  ## 1.0.0
4
16
 
5
17
  ### Major Changes
@@ -1,13 +1,13 @@
1
1
  import { type CoreConfigOptions } from "../core.ts";
2
2
  import { JsonConfigOptions } from "../json.ts";
3
3
  import { type PackageJsonConfigOptions } from "../packageJson.ts";
4
- import { type TypescriptConfigOptions } from "../typescript.ts";
4
+ import { type TypeScriptConfigOptions } from "../typescript.ts";
5
5
  import { type YamlConfigOptions } from "../yaml.ts";
6
6
  export interface DefineMonorepoWorkspaceConfigOptions {
7
7
  core?: CoreConfigOptions;
8
8
  json?: JsonConfigOptions;
9
9
  packageJson?: PackageJsonConfigOptions;
10
- typescript?: TypescriptConfigOptions;
10
+ typescript?: TypeScriptConfigOptions;
11
11
  yaml?: YamlConfigOptions;
12
12
  }
13
13
  /**
@@ -1,9 +1,9 @@
1
1
  import { defineConfig, globalIgnores } from "eslint/config";
2
- import { coreConfig, coreGlobalIgnores } from "../core.js";
3
- import { jsonConfig, jsonGlobalIgnores } from "../json.js";
4
- import { packageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
5
- import { typescriptConfig, typescriptGlobalIgnores } from "../typescript.js";
6
- import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
2
+ import { coreGlobalIgnores, defineCoreConfig } from "../core.js";
3
+ import { defineJsonConfig, jsonGlobalIgnores } from "../json.js";
4
+ import { definePackageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
5
+ import { defineTypeScriptConfig, typescriptGlobalIgnores } from "../typescript.js";
6
+ import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
7
7
 
8
8
  ;// CONCATENATED MODULE: external "eslint/config"
9
9
 
@@ -40,11 +40,11 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
40
40
  ...typescriptGlobalIgnores,
41
41
  ...yamlGlobalIgnores
42
42
  ]),
43
- ...coreConfig(core),
44
- ...jsonConfig(json),
45
- ...packageJsonConfig(packageJson),
46
- ...typescriptConfig(tsconfigRootDir, typescript),
47
- ...yamlConfig(yaml),
43
+ ...defineCoreConfig(core),
44
+ ...defineJsonConfig(json),
45
+ ...definePackageJsonConfig(packageJson),
46
+ ...defineTypeScriptConfig(tsconfigRootDir, typescript),
47
+ ...defineYamlConfig(yaml),
48
48
  {
49
49
  rules: {
50
50
  "package-json/valid-version": "off"
@@ -1 +1 @@
1
- {"version":3,"file":"by-project-type/defineMonorepoWorkspaceConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineMonorepoWorkspaceConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from \"../core.ts\";\nimport { jsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineMonorepoWorkspaceConfigOptions {\n core?: CoreConfigOptions;\n json?: JsonConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n typescript?: TypescriptConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineMonorepoWorkspaceConfig(tsconfigRootDir: string, options: DefineMonorepoWorkspaceConfigOptions = {}) {\n const {\n core,\n json,\n packageJson,\n typescript,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jsonGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...coreConfig(core),\n ...jsonConfig(json),\n ...packageJsonConfig(packageJson),\n ...typescriptConfig(tsconfigRootDir, typescript),\n ...yamlConfig(yaml),\n {\n rules: {\n \"package-json/valid-version\": \"off\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreConfig","coreGlobalIgnores","jsonConfig","jsonGlobalIgnores","packageJsonConfig","packageJsonGlobalIgnores","typescriptConfig","typescriptGlobalIgnores","yamlConfig","yamlGlobalIgnores","defineMonorepoWorkspaceConfig","tsconfigRootDir","options","core","json","packageJson","typescript","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;AAA4D;AACuB;AACL;AACiC;AACJ;AACxB;AAUnF;;;CAGC,GACM,SAASY,8BAA8BC,eAAuB,EAAEC,UAAgD,CAAC,CAAC;IACrH,MAAM,EACFC,IAAI,EACJC,IAAI,EACJC,WAAW,EACXC,UAAU,EACVC,IAAI,EACP,GAAGL;IAEJ,OAAOd,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;eACGE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,wBAAwBA;eACxBE,uBAAuBA;eACvBE,iBAAiBA;SACvB;WACET,UAAUA,CAACa;WACXX,UAAUA,CAACY;WACXV,iBAAiBA,CAACW;WAClBT,gBAAgBA,CAACK,iBAAiBK;WAClCR,UAAUA,CAACS;QACd;YACI,OAAO;gBACH,8BAA8B;YAClC;QACJ;KACH;AACL"}
1
+ {"version":3,"file":"by-project-type/defineMonorepoWorkspaceConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineMonorepoWorkspaceConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { type CoreConfigOptions, coreGlobalIgnores, defineCoreConfig } from \"../core.ts\";\nimport { defineJsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { definePackageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { defineTypeScriptConfig, type TypeScriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { defineYamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineMonorepoWorkspaceConfigOptions {\n core?: CoreConfigOptions;\n json?: JsonConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n typescript?: TypeScriptConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineMonorepoWorkspaceConfig(tsconfigRootDir: string, options: DefineMonorepoWorkspaceConfigOptions = {}) {\n const {\n core,\n json,\n packageJson,\n typescript,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jsonGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...defineCoreConfig(core),\n ...defineJsonConfig(json),\n ...definePackageJsonConfig(packageJson),\n ...defineTypeScriptConfig(tsconfigRootDir, typescript),\n ...defineYamlConfig(yaml),\n {\n rules: {\n \"package-json/valid-version\": \"off\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreGlobalIgnores","defineCoreConfig","defineJsonConfig","jsonGlobalIgnores","definePackageJsonConfig","packageJsonGlobalIgnores","defineTypeScriptConfig","typescriptGlobalIgnores","defineYamlConfig","yamlGlobalIgnores","defineMonorepoWorkspaceConfig","tsconfigRootDir","options","core","json","packageJson","typescript","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;AAA4D;AAC6B;AACL;AACiC;AACJ;AACxB;AAUzF;;;CAGC,GACM,SAASY,8BAA8BC,eAAuB,EAAEC,UAAgD,CAAC,CAAC;IACrH,MAAM,EACFC,IAAI,EACJC,IAAI,EACJC,WAAW,EACXC,UAAU,EACVC,IAAI,EACP,GAAGL;IAEJ,OAAOd,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;eACGC,iBAAiBA;eACjBG,iBAAiBA;eACjBE,wBAAwBA;eACxBE,uBAAuBA;eACvBE,iBAAiBA;SACvB;WACER,gBAAgBA,CAACY;WACjBX,gBAAgBA,CAACY;WACjBV,uBAAuBA,CAACW;WACxBT,sBAAsBA,CAACK,iBAAiBK;WACxCR,gBAAgBA,CAACS;QACpB;YACI,OAAO;gBACH,8BAA8B;YAClC;QACJ;KACH;AACL"}
@@ -6,10 +6,11 @@ import { type PackageJsonConfigOptions } from "../packageJson.ts";
6
6
  import { type ReactConfigOptions } from "../react.ts";
7
7
  import { type StorybookConfigOptions } from "../storybook.ts";
8
8
  import { type TestingLibraryConfigOptions } from "../testingLibrary.ts";
9
- import { type TypescriptConfigOptions } from "../typescript.ts";
9
+ import { type TypeScriptConfigOptions } from "../typescript.ts";
10
10
  import { type VitestConfigOptions } from "../vitest.ts";
11
11
  import { type YamlConfigOptions } from "../yaml.ts";
12
12
  export interface DefineReactLibraryConfigOptions {
13
+ testFramework?: "vitest" | "jest";
13
14
  core?: CoreConfigOptions;
14
15
  jest?: JestConfigOptions;
15
16
  json?: JsonConfigOptions;
@@ -18,7 +19,7 @@ export interface DefineReactLibraryConfigOptions {
18
19
  react?: ReactConfigOptions;
19
20
  storybook?: StorybookConfigOptions;
20
21
  testingLibrary?: TestingLibraryConfigOptions;
21
- typescript?: TypescriptConfigOptions;
22
+ typescript?: TypeScriptConfigOptions;
22
23
  vitest?: VitestConfigOptions;
23
24
  yaml?: YamlConfigOptions;
24
25
  }
@@ -1,16 +1,16 @@
1
1
  import { defineConfig, globalIgnores } from "eslint/config";
2
- import { coreConfig, coreGlobalIgnores } from "../core.js";
3
- import { jestConfig, jestGlobalIgnores } from "../jest.js";
4
- import { jsonConfig, jsonGlobalIgnores } from "../json.js";
5
- import { jsxAllyConfig, jsxAllyGlobalIgnores } from "../jsxAlly.js";
6
- import { packageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
2
+ import { coreGlobalIgnores, defineCoreConfig } from "../core.js";
3
+ import { defineJestConfig, jestGlobalIgnores } from "../jest.js";
4
+ import { defineJsonConfig, jsonGlobalIgnores } from "../json.js";
5
+ import { defineJsxAllyConfig, jsxAllyGlobalIgnores } from "../jsxAlly.js";
6
+ import { definePackageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
7
7
  import { WorkleapPlugin } from "../plugins/workleapPlugin.js";
8
- import { reactConfig, reactGlobalIgnores } from "../react.js";
9
- import { storybookConfig, storybookGlobalIgnores } from "../storybook.js";
10
- import { testingLibraryConfig, testingLibraryGlobalIgnores } from "../testingLibrary.js";
11
- import { typescriptConfig, typescriptGlobalIgnores } from "../typescript.js";
12
- import { vitestConfig, vitestGlobalIgnores } from "../vitest.js";
13
- import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
8
+ import { defineReactConfig, reactGlobalIgnores } from "../react.js";
9
+ import { defineStorybookConfig, storybookGlobalIgnores } from "../storybook.js";
10
+ import { defineTestingLibraryConfig, testingLibraryGlobalIgnores } from "../testingLibrary.js";
11
+ import { defineTypeScriptConfig, typescriptGlobalIgnores } from "../typescript.js";
12
+ import { defineVitestConfig, vitestGlobalIgnores } from "../vitest.js";
13
+ import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
14
14
 
15
15
  ;// CONCATENATED MODULE: external "eslint/config"
16
16
 
@@ -56,7 +56,7 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
56
56
  * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.
57
57
  * @param options An optional object of options for the ESlint core and plugins rules.
58
58
  */ function defineReactLibraryConfig(tsconfigRootDir, options = {}) {
59
- const { core, jest, json, jsxAlly, packageJson, react, storybook, testingLibrary, typescript, vitest, yaml } = options;
59
+ const { testFramework = "vitest", core, jest, json, jsxAlly, packageJson, react, storybook, testingLibrary, typescript, vitest, yaml } = options;
60
60
  return defineConfig([
61
61
  // node_modules folder is ignored by default.
62
62
  globalIgnores([
@@ -75,19 +75,24 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
75
75
  ...vitestGlobalIgnores,
76
76
  ...yamlGlobalIgnores
77
77
  ]),
78
- ...coreConfig(core),
79
- ...jestConfig(jest),
80
- ...jsonConfig(json),
81
- ...jsxAllyConfig(jsxAlly),
82
- ...packageJsonConfig(packageJson),
83
- ...reactConfig(react),
84
- ...storybookConfig(storybook),
85
- ...testingLibraryConfig(testingLibrary),
86
- ...typescriptConfig(tsconfigRootDir, typescript),
78
+ ...defineCoreConfig(core),
79
+ ...defineJestConfig({
80
+ ...jest,
81
+ enabled: jest?.enabled ?? testFramework === "jest"
82
+ }),
83
+ ...defineJsonConfig(json),
84
+ ...defineJsxAllyConfig(jsxAlly),
85
+ ...definePackageJsonConfig(packageJson),
86
+ ...defineReactConfig(react),
87
+ ...defineStorybookConfig(storybook),
88
+ ...defineTestingLibraryConfig(testingLibrary),
89
+ ...defineTypeScriptConfig(tsconfigRootDir, typescript),
87
90
  // Temporary fix until the vitest plugin support defineConfig and the types are fixed.
88
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
89
- ...vitestConfig(vitest),
90
- ...yamlConfig(yaml),
91
+ ...defineVitestConfig({
92
+ ...vitest,
93
+ enabled: vitest?.enabled ?? testFramework === "vitest"
94
+ }),
95
+ ...defineYamlConfig(yaml),
91
96
  {
92
97
  plugins: {
93
98
  "@workleap": WorkleapPlugin
@@ -1 +1 @@
1
- {"version":3,"file":"by-project-type/defineReactLibraryConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineReactLibraryConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from \"../core.ts\";\nimport { jestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { jsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { jsxAllyConfig, type JsxAllyConfigOptions, jsxAllyGlobalIgnores } from \"../jsxAlly.ts\";\nimport { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { reactConfig, type ReactConfigOptions, reactGlobalIgnores } from \"../react.ts\";\nimport { storybookConfig, type StorybookConfigOptions, storybookGlobalIgnores } from \"../storybook.ts\";\nimport { testingLibraryConfig, type TestingLibraryConfigOptions, testingLibraryGlobalIgnores } from \"../testingLibrary.ts\";\nimport { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { vitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineReactLibraryConfigOptions {\n core?: CoreConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n jsxAlly?: JsxAllyConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n react?: ReactConfigOptions;\n storybook?: StorybookConfigOptions;\n testingLibrary?: TestingLibraryConfigOptions;\n typescript?: TypescriptConfigOptions;\n vitest?: VitestConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineReactLibraryConfig(tsconfigRootDir: string, options: DefineReactLibraryConfigOptions = {}) {\n const {\n core,\n jest,\n json,\n jsxAlly,\n packageJson,\n react,\n storybook,\n testingLibrary,\n typescript,\n vitest,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \"**/__snapshots__/*\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...jsxAllyGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...reactGlobalIgnores,\n ...storybookGlobalIgnores,\n ...testingLibraryGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...coreConfig(core),\n ...jestConfig(jest),\n ...jsonConfig(json),\n ...jsxAllyConfig(jsxAlly),\n ...packageJsonConfig(packageJson),\n ...reactConfig(react),\n ...storybookConfig(storybook),\n ...testingLibraryConfig(testingLibrary),\n ...typescriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(vitestConfig(vitest) as any),\n ...yamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreConfig","coreGlobalIgnores","jestConfig","jestGlobalIgnores","jsonConfig","jsonGlobalIgnores","jsxAllyConfig","jsxAllyGlobalIgnores","packageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","reactConfig","reactGlobalIgnores","storybookConfig","storybookGlobalIgnores","testingLibraryConfig","testingLibraryGlobalIgnores","typescriptConfig","typescriptGlobalIgnores","vitestConfig","vitestGlobalIgnores","yamlConfig","yamlGlobalIgnores","defineReactLibraryConfig","tsconfigRootDir","options","core","jest","json","jsxAlly","packageJson","react","storybook","testingLibrary","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AACuB;AACA;AACL;AACiB;AACgB;AACjD;AACyB;AACgB;AACoB;AAChB;AAChB;AACR;AAgBnF;;;CAGC,GACM,SAASyB,yBAAyBC,eAAuB,EAAEC,UAA2C,CAAC,CAAC;IAC3G,MAAM,EACFC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,KAAK,EACLC,SAAS,EACTC,cAAc,EACdC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGX;IAEJ,OAAO3B,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;YACA;eACGE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,oBAAoBA;eACpBE,wBAAwBA;eACxBG,kBAAkBA;eAClBE,sBAAsBA;eACtBE,2BAA2BA;eAC3BE,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACEtB,UAAUA,CAAC0B;WACXxB,UAAUA,CAACyB;WACXvB,UAAUA,CAACwB;WACXtB,aAAaA,CAACuB;WACdrB,iBAAiBA,CAACsB;WAClBnB,WAAWA,CAACoB;WACZlB,eAAeA,CAACmB;WAChBjB,oBAAoBA,CAACkB;WACrBhB,gBAAgBA,CAACO,iBAAiBU;QACrC,sFAAsF;QACtF,8DAA8D;WAC1Df,YAAYA,CAACgB;WACdd,UAAUA,CAACe;QACd;YACI,SAAS;gBACL,aAAa1B,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL"}
1
+ {"version":3,"file":"by-project-type/defineReactLibraryConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineReactLibraryConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { type CoreConfigOptions, coreGlobalIgnores, defineCoreConfig } from \"../core.ts\";\nimport { defineJestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { defineJsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { defineJsxAllyConfig, type JsxAllyConfigOptions, jsxAllyGlobalIgnores } from \"../jsxAlly.ts\";\nimport { definePackageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { defineReactConfig, type ReactConfigOptions, reactGlobalIgnores } from \"../react.ts\";\nimport { defineStorybookConfig, type StorybookConfigOptions, storybookGlobalIgnores } from \"../storybook.ts\";\nimport { defineTestingLibraryConfig, type TestingLibraryConfigOptions, testingLibraryGlobalIgnores } from \"../testingLibrary.ts\";\nimport { defineTypeScriptConfig, type TypeScriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { defineVitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { defineYamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineReactLibraryConfigOptions {\n testFramework?: \"vitest\" | \"jest\";\n core?: CoreConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n jsxAlly?: JsxAllyConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n react?: ReactConfigOptions;\n storybook?: StorybookConfigOptions;\n testingLibrary?: TestingLibraryConfigOptions;\n typescript?: TypeScriptConfigOptions;\n vitest?: VitestConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineReactLibraryConfig(tsconfigRootDir: string, options: DefineReactLibraryConfigOptions = {}) {\n const {\n testFramework = \"vitest\",\n core,\n jest,\n json,\n jsxAlly,\n packageJson,\n react,\n storybook,\n testingLibrary,\n typescript,\n vitest,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \"**/__snapshots__/*\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...jsxAllyGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...reactGlobalIgnores,\n ...storybookGlobalIgnores,\n ...testingLibraryGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...defineCoreConfig(core),\n ...defineJestConfig({\n ...jest,\n enabled: jest?.enabled ?? testFramework === \"jest\"\n }),\n ...defineJsonConfig(json),\n ...defineJsxAllyConfig(jsxAlly),\n ...definePackageJsonConfig(packageJson),\n ...defineReactConfig(react),\n ...defineStorybookConfig(storybook),\n ...defineTestingLibraryConfig(testingLibrary),\n ...defineTypeScriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n ...(defineVitestConfig({\n ...vitest,\n enabled: vitest?.enabled ?? testFramework === \"vitest\"\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) as any),\n ...defineYamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreGlobalIgnores","defineCoreConfig","defineJestConfig","jestGlobalIgnores","defineJsonConfig","jsonGlobalIgnores","defineJsxAllyConfig","jsxAllyGlobalIgnores","definePackageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","defineReactConfig","reactGlobalIgnores","defineStorybookConfig","storybookGlobalIgnores","defineTestingLibraryConfig","testingLibraryGlobalIgnores","defineTypeScriptConfig","typescriptGlobalIgnores","defineVitestConfig","vitestGlobalIgnores","defineYamlConfig","yamlGlobalIgnores","defineReactLibraryConfig","tsconfigRootDir","options","testFramework","core","jest","json","jsxAlly","packageJson","react","storybook","testingLibrary","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AAC6B;AACA;AACL;AACiB;AACgB;AACvD;AAC+B;AACgB;AACoB;AAChB;AAChB;AACR;AAiBzF;;;CAGC,GACM,SAASyB,yBAAyBC,eAAuB,EAAEC,UAA2C,CAAC,CAAC;IAC3G,MAAM,EACFC,gBAAgB,QAAQ,EACxBC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,KAAK,EACLC,SAAS,EACTC,cAAc,EACdC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGZ;IAEJ,OAAO3B,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;YACA;eACGC,iBAAiBA;eACjBG,iBAAiBA;eACjBE,iBAAiBA;eACjBE,oBAAoBA;eACpBE,wBAAwBA;eACxBG,kBAAkBA;eAClBE,sBAAsBA;eACtBE,2BAA2BA;eAC3BE,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACErB,gBAAgBA,CAAC0B;WACjBzB,gBAAgBA,CAAC;YAChB,GAAG0B,IAAI;YACP,SAASA,MAAM,WAAWF,kBAAkB;QAChD;WACGtB,gBAAgBA,CAACyB;WACjBvB,mBAAmBA,CAACwB;WACpBtB,uBAAuBA,CAACuB;WACxBpB,iBAAiBA,CAACqB;WAClBnB,qBAAqBA,CAACoB;WACtBlB,0BAA0BA,CAACmB;WAC3BjB,sBAAsBA,CAACO,iBAAiBW;QAC3C,sFAAsF;WAClFhB,kBAAkBA,CAAC;YACnB,GAAGiB,MAAM;YACT,SAASA,QAAQ,WAAWV,kBAAkB;QAElD;WACGL,gBAAgBA,CAACgB;QACpB;YACI,SAAS;gBACL,aAAa3B,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL"}
@@ -2,12 +2,13 @@ import { type CoreConfigOptions } from "../core.ts";
2
2
  import { type JestConfigOptions } from "../jest.ts";
3
3
  import { JsonConfigOptions } from "../json.ts";
4
4
  import { type PackageJsonConfigOptions } from "../packageJson.ts";
5
- import { type TypescriptConfigOptions } from "../typescript.ts";
5
+ import { type TypeScriptConfigOptions } from "../typescript.ts";
6
6
  import { type VitestConfigOptions } from "../vitest.ts";
7
7
  import { type YamlConfigOptions } from "../yaml.ts";
8
8
  export interface DefineTypeScriptLibraryConfigOptions {
9
+ testFramework?: "vitest" | "jest";
9
10
  core?: CoreConfigOptions;
10
- typescript?: TypescriptConfigOptions;
11
+ typescript?: TypeScriptConfigOptions;
11
12
  jest?: JestConfigOptions;
12
13
  json?: JsonConfigOptions;
13
14
  vitest?: VitestConfigOptions;
@@ -1,12 +1,12 @@
1
1
  import { defineConfig, globalIgnores } from "eslint/config";
2
- import { coreConfig, coreGlobalIgnores } from "../core.js";
3
- import { jestConfig, jestGlobalIgnores } from "../jest.js";
4
- import { jsonConfig, jsonGlobalIgnores } from "../json.js";
5
- import { packageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
2
+ import { coreGlobalIgnores, defineCoreConfig } from "../core.js";
3
+ import { defineJestConfig, jestGlobalIgnores } from "../jest.js";
4
+ import { defineJsonConfig, jsonGlobalIgnores } from "../json.js";
5
+ import { definePackageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
6
6
  import { WorkleapPlugin } from "../plugins/workleapPlugin.js";
7
- import { typescriptConfig, typescriptGlobalIgnores } from "../typescript.js";
8
- import { vitestConfig, vitestGlobalIgnores } from "../vitest.js";
9
- import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
7
+ import { defineTypeScriptConfig, typescriptGlobalIgnores } from "../typescript.js";
8
+ import { defineVitestConfig, vitestGlobalIgnores } from "../vitest.js";
9
+ import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
10
10
 
11
11
  ;// CONCATENATED MODULE: external "eslint/config"
12
12
 
@@ -40,7 +40,7 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
40
40
  * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.
41
41
  * @param options An optional object of options for the ESlint core and plugins rules.
42
42
  */ function defineTypeScriptLibraryConfig(tsconfigRootDir, options = {}) {
43
- const { core, jest, json, packageJson, typescript, vitest, yaml } = options;
43
+ const { testFramework = "vitest", core, jest, json, packageJson, typescript, vitest, yaml } = options;
44
44
  return defineConfig([
45
45
  // node_modules folder is ignored by default.
46
46
  globalIgnores([
@@ -55,15 +55,20 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
55
55
  ...vitestGlobalIgnores,
56
56
  ...yamlGlobalIgnores
57
57
  ]),
58
- ...coreConfig(core),
59
- ...jestConfig(jest),
60
- ...jsonConfig(json),
61
- ...packageJsonConfig(packageJson),
62
- ...typescriptConfig(tsconfigRootDir, typescript),
58
+ ...defineCoreConfig(core),
59
+ ...defineJestConfig({
60
+ ...jest,
61
+ enabled: jest?.enabled ?? testFramework === "jest"
62
+ }),
63
+ ...defineJsonConfig(json),
64
+ ...definePackageJsonConfig(packageJson),
65
+ ...defineTypeScriptConfig(tsconfigRootDir, typescript),
63
66
  // Temporary fix until the vitest plugin support defineConfig and the types are fixed.
64
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
65
- ...vitestConfig(vitest),
66
- ...yamlConfig(yaml),
67
+ ...defineVitestConfig({
68
+ ...vitest,
69
+ enabled: vitest?.enabled ?? testFramework === "vitest"
70
+ }),
71
+ ...defineYamlConfig(yaml),
67
72
  {
68
73
  plugins: {
69
74
  "@workleap": WorkleapPlugin
@@ -1 +1 @@
1
- {"version":3,"file":"by-project-type/defineTypescriptLibraryConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineTypescriptLibraryConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from \"../core.ts\";\nimport { jestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { jsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { vitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineTypeScriptLibraryConfigOptions {\n core?: CoreConfigOptions;\n typescript?: TypescriptConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n vitest?: VitestConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options: DefineTypeScriptLibraryConfigOptions = {}) {\n const {\n core,\n jest,\n json,\n packageJson,\n typescript,\n vitest,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \"**/__snapshots__/*\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...coreConfig(core),\n ...jestConfig(jest),\n ...jsonConfig(json),\n ...packageJsonConfig(packageJson),\n ...typescriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(vitestConfig(vitest) as any),\n ...yamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreConfig","coreGlobalIgnores","jestConfig","jestGlobalIgnores","jsonConfig","jsonGlobalIgnores","packageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","typescriptConfig","typescriptGlobalIgnores","vitestConfig","vitestGlobalIgnores","yamlConfig","yamlGlobalIgnores","defineTypeScriptLibraryConfig","tsconfigRootDir","options","core","jest","json","packageJson","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AACuB;AACA;AACL;AACiC;AACjD;AAC6C;AAChB;AACR;AAYnF;;;CAGC,GACM,SAASiB,8BAA8BC,eAAuB,EAAEC,UAAgD,CAAC,CAAC;IACrH,MAAM,EACFC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,WAAW,EACXC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGP;IAEJ,OAAOnB,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;YACA;eACGE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,wBAAwBA;eACxBG,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACEd,UAAUA,CAACkB;WACXhB,UAAUA,CAACiB;WACXf,UAAUA,CAACgB;WACXd,iBAAiBA,CAACe;WAClBZ,gBAAgBA,CAACO,iBAAiBM;QACrC,sFAAsF;QACtF,8DAA8D;WAC1DX,YAAYA,CAACY;WACdV,UAAUA,CAACW;QACd;YACI,SAAS;gBACL,aAAahB,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL"}
1
+ {"version":3,"file":"by-project-type/defineTypescriptLibraryConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineTypescriptLibraryConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { type CoreConfigOptions, coreGlobalIgnores, defineCoreConfig } from \"../core.ts\";\nimport { defineJestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { defineJsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { definePackageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { defineTypeScriptConfig, type TypeScriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { defineVitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { defineYamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineTypeScriptLibraryConfigOptions {\n testFramework?: \"vitest\" | \"jest\";\n core?: CoreConfigOptions;\n typescript?: TypeScriptConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n vitest?: VitestConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options: DefineTypeScriptLibraryConfigOptions = {}) {\n const {\n testFramework = \"vitest\",\n core,\n jest,\n json,\n packageJson,\n typescript,\n vitest,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \"**/__snapshots__/*\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...defineCoreConfig(core),\n ...defineJestConfig({\n ...jest,\n enabled: jest?.enabled ?? testFramework === \"jest\"\n }),\n ...defineJsonConfig(json),\n ...definePackageJsonConfig(packageJson),\n ...defineTypeScriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n ...(defineVitestConfig({\n ...vitest,\n enabled: vitest?.enabled ?? testFramework === \"vitest\"\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) as any),\n ...defineYamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreGlobalIgnores","defineCoreConfig","defineJestConfig","jestGlobalIgnores","defineJsonConfig","jsonGlobalIgnores","definePackageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","defineTypeScriptConfig","typescriptGlobalIgnores","defineVitestConfig","vitestGlobalIgnores","defineYamlConfig","yamlGlobalIgnores","defineTypeScriptLibraryConfig","tsconfigRootDir","options","testFramework","core","jest","json","packageJson","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AAC6B;AACA;AACL;AACiC;AACvD;AACmD;AAChB;AACR;AAazF;;;CAGC,GACM,SAASiB,8BAA8BC,eAAuB,EAAEC,UAAgD,CAAC,CAAC;IACrH,MAAM,EACFC,gBAAgB,QAAQ,EACxBC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,WAAW,EACXC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGR;IAEJ,OAAOnB,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;YACA;eACGC,iBAAiBA;eACjBG,iBAAiBA;eACjBE,iBAAiBA;eACjBE,wBAAwBA;eACxBG,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACEb,gBAAgBA,CAACkB;WACjBjB,gBAAgBA,CAAC;YAChB,GAAGkB,IAAI;YACP,SAASA,MAAM,WAAWF,kBAAkB;QAChD;WACGd,gBAAgBA,CAACiB;WACjBf,uBAAuBA,CAACgB;WACxBb,sBAAsBA,CAACO,iBAAiBO;QAC3C,sFAAsF;WAClFZ,kBAAkBA,CAAC;YACnB,GAAGa,MAAM;YACT,SAASA,QAAQ,WAAWN,kBAAkB;QAElD;WACGL,gBAAgBA,CAACY;QACpB;YACI,SAAS;gBACL,aAAajB,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL"}
@@ -6,10 +6,11 @@ import { type PackageJsonConfigOptions } from "../packageJson.ts";
6
6
  import { type ReactConfigOptions } from "../react.ts";
7
7
  import { type StorybookConfigOptions } from "../storybook.ts";
8
8
  import { type TestingLibraryConfigOptions } from "../testingLibrary.ts";
9
- import { type TypescriptConfigOptions } from "../typescript.ts";
9
+ import { type TypeScriptConfigOptions } from "../typescript.ts";
10
10
  import { type VitestConfigOptions } from "../vitest.ts";
11
11
  import { type YamlConfigOptions } from "../yaml.ts";
12
12
  export interface DefineWebApplicationConfigOptions {
13
+ testFramework?: "vitest" | "jest";
13
14
  core?: CoreConfigOptions;
14
15
  jest?: JestConfigOptions;
15
16
  json?: JsonConfigOptions;
@@ -18,7 +19,7 @@ export interface DefineWebApplicationConfigOptions {
18
19
  react?: ReactConfigOptions;
19
20
  storybook?: StorybookConfigOptions;
20
21
  testingLibrary?: TestingLibraryConfigOptions;
21
- typescript?: TypescriptConfigOptions;
22
+ typescript?: TypeScriptConfigOptions;
22
23
  vitest?: VitestConfigOptions;
23
24
  yaml?: YamlConfigOptions;
24
25
  }
@@ -1,16 +1,16 @@
1
1
  import { defineConfig, globalIgnores } from "eslint/config";
2
- import { coreConfig, coreGlobalIgnores } from "../core.js";
3
- import { jestConfig, jestGlobalIgnores } from "../jest.js";
4
- import { jsonConfig, jsonGlobalIgnores } from "../json.js";
5
- import { jsxAllyConfig, jsxAllyGlobalIgnores } from "../jsxAlly.js";
6
- import { packageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
2
+ import { coreGlobalIgnores, defineCoreConfig } from "../core.js";
3
+ import { defineJestConfig, jestGlobalIgnores } from "../jest.js";
4
+ import { defineJsonConfig, jsonGlobalIgnores } from "../json.js";
5
+ import { defineJsxAllyConfig, jsxAllyGlobalIgnores } from "../jsxAlly.js";
6
+ import { definePackageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
7
7
  import { WorkleapPlugin } from "../plugins/workleapPlugin.js";
8
- import { reactConfig, reactGlobalIgnores } from "../react.js";
9
- import { storybookConfig, storybookGlobalIgnores } from "../storybook.js";
10
- import { testingLibraryConfig, testingLibraryGlobalIgnores } from "../testingLibrary.js";
11
- import { typescriptConfig, typescriptGlobalIgnores } from "../typescript.js";
12
- import { vitestConfig, vitestGlobalIgnores } from "../vitest.js";
13
- import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
8
+ import { defineReactConfig, reactGlobalIgnores } from "../react.js";
9
+ import { defineStorybookConfig, storybookGlobalIgnores } from "../storybook.js";
10
+ import { defineTestingLibraryConfig, testingLibraryGlobalIgnores } from "../testingLibrary.js";
11
+ import { defineTypeScriptConfig, typescriptGlobalIgnores } from "../typescript.js";
12
+ import { defineVitestConfig, vitestGlobalIgnores } from "../vitest.js";
13
+ import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
14
14
 
15
15
  ;// CONCATENATED MODULE: external "eslint/config"
16
16
 
@@ -56,7 +56,7 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
56
56
  * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.
57
57
  * @param options An optional object of options for the ESlint core and plugins rules.
58
58
  */ const defineWebApplicationConfig = (tsconfigRootDir, options = {})=>{
59
- const { core, jest, json, jsxAlly, packageJson, react, storybook, testingLibrary, typescript, vitest, yaml } = options;
59
+ const { testFramework = "vitest", core, jest, json, jsxAlly, packageJson, react, storybook, testingLibrary, typescript, vitest, yaml } = options;
60
60
  return defineConfig([
61
61
  // node_modules folder is ignored by default.
62
62
  globalIgnores([
@@ -75,19 +75,24 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
75
75
  ...vitestGlobalIgnores,
76
76
  ...yamlGlobalIgnores
77
77
  ]),
78
- ...coreConfig(core),
79
- ...jestConfig(jest),
80
- ...jsonConfig(json),
81
- ...jsxAllyConfig(jsxAlly),
82
- ...packageJsonConfig(packageJson),
83
- ...reactConfig(react),
84
- ...storybookConfig(storybook),
85
- ...testingLibraryConfig(testingLibrary),
86
- ...typescriptConfig(tsconfigRootDir, typescript),
78
+ ...defineCoreConfig(core),
79
+ ...defineJestConfig({
80
+ ...jest,
81
+ enabled: jest?.enabled ?? testFramework === "jest"
82
+ }),
83
+ ...defineJsonConfig(json),
84
+ ...defineJsxAllyConfig(jsxAlly),
85
+ ...definePackageJsonConfig(packageJson),
86
+ ...defineReactConfig(react),
87
+ ...defineStorybookConfig(storybook),
88
+ ...defineTestingLibraryConfig(testingLibrary),
89
+ ...defineTypeScriptConfig(tsconfigRootDir, typescript),
87
90
  // Temporary fix until the vitest plugin support defineConfig and the types are fixed.
88
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
89
- ...vitestConfig(vitest),
90
- ...yamlConfig(yaml),
91
+ ...defineVitestConfig({
92
+ ...vitest,
93
+ enabled: vitest?.enabled ?? testFramework === "vitest"
94
+ }),
95
+ ...defineYamlConfig(yaml),
91
96
  {
92
97
  plugins: {
93
98
  "@workleap": WorkleapPlugin
@@ -1 +1 @@
1
- {"version":3,"file":"by-project-type/defineWebApplicationConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineWebApplicationConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from \"../core.ts\";\nimport { jestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { jsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { jsxAllyConfig, type JsxAllyConfigOptions, jsxAllyGlobalIgnores } from \"../jsxAlly.ts\";\nimport { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { reactConfig, type ReactConfigOptions, reactGlobalIgnores } from \"../react.ts\";\nimport { storybookConfig, type StorybookConfigOptions, storybookGlobalIgnores } from \"../storybook.ts\";\nimport { testingLibraryConfig, type TestingLibraryConfigOptions, testingLibraryGlobalIgnores } from \"../testingLibrary.ts\";\nimport { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { vitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\n/*\n\nThe WHY for the interface instead of using nested \"extends\".\n\n1- ESlint flat config doesn't support nested \"extends\":\n\nEach configuration object may have an extends key, but only at the top level — not inside another config that already came from an extends.\n\nFlat config was designed to be explicitly ordered and fully expanded:\n\n- \"extends\" in flat config is syntactic sugar for concatenating multiple config objects.\n- Allowing recursion would make config evaluation order ambiguous and slow.\n\nSo ESLint enforces a one-level-deep rule:\n\n- only a top-level config object can have extends.\n\n2- Each object in the array is evaluated independently. \"plugins\" declared in one object are not inherited by the next object.\nSo when a second object sets the rule using a plugin \"xyz\", it doesn’t \"see\" the plugin \"xyz\" that’s defined inside a predefine config, and ESLint throws.\n\n3- Trying to redefine a plugin that as already been define in a configuration object will throw: Cannot redefine plugin \"xyz\".\n\n*/\n\n/*\n\nerror Parsing error: C:\\Dev\\workleap\\wl-web-configs\\samples\\storybook\\rsbuild\\.storybook\\main.ts was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject\n\n-> It usually means that the project tsconfig.json file cannot find the specified file\n-> Make sure to clear the ESLint cache after such an error because update the tsconfig.json file doesn't invalidate the ESLint cache\n\n*/\n\n/*\n\nimport { defineConfig, globalIgnores } from \"eslint/config\";\nimport { defineReactLibraryConfig } from \"@workleap/eslint-configs\";\n\nexport default defineConfig([\n globalIgnores([\n \"/reports/**\"\n ]),\n defineReactLibraryConfig(import.meta.dirname)\n]);\n\n*/\n\n/*\n\nThe key insight was that ESLint 9's flat config system requires ignores to be specified in the configuration\nfile itself for optimal performance, rather than relying on CLI flags (--ignore-pattern). The ignores array at the beginning of the\n config ensures files are filtered out during the file discovery phase, not after.\n\n*/\n\n/*\n\nDocument the React compiler setting\n\n*/\n\n/*\n\n- Document how to extend the rules\n\n*/\n\nexport interface DefineWebApplicationConfigOptions {\n core?: CoreConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n jsxAlly?: JsxAllyConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n react?: ReactConfigOptions;\n storybook?: StorybookConfigOptions;\n testingLibrary?: TestingLibraryConfigOptions;\n typescript?: TypescriptConfigOptions;\n vitest?: VitestConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport const defineWebApplicationConfig = (tsconfigRootDir: string, options: DefineWebApplicationConfigOptions = {}) => {\n const {\n core,\n jest,\n json,\n jsxAlly,\n packageJson,\n react,\n storybook,\n testingLibrary,\n typescript,\n vitest,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \"**/__snapshots__/*\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...jsxAllyGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...reactGlobalIgnores,\n ...storybookGlobalIgnores,\n ...testingLibraryGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...coreConfig(core),\n ...jestConfig(jest),\n ...jsonConfig(json),\n ...jsxAllyConfig(jsxAlly),\n ...packageJsonConfig(packageJson),\n ...reactConfig(react),\n ...storybookConfig(storybook),\n ...testingLibraryConfig(testingLibrary),\n ...typescriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(vitestConfig(vitest) as any),\n ...yamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n};\n"],"names":["defineConfig","globalIgnores","coreConfig","coreGlobalIgnores","jestConfig","jestGlobalIgnores","jsonConfig","jsonGlobalIgnores","jsxAllyConfig","jsxAllyGlobalIgnores","packageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","reactConfig","reactGlobalIgnores","storybookConfig","storybookGlobalIgnores","testingLibraryConfig","testingLibraryGlobalIgnores","typescriptConfig","typescriptGlobalIgnores","vitestConfig","vitestGlobalIgnores","yamlConfig","yamlGlobalIgnores","defineWebApplicationConfig","tsconfigRootDir","options","core","jest","json","jsxAlly","packageJson","react","storybook","testingLibrary","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AACuB;AACA;AACL;AACiB;AACgB;AACjD;AACyB;AACgB;AACoB;AAChB;AAChB;AACR;AAmFnF;;;CAGC,GACM,MAAMyB,6BAA6B,CAACC,iBAAyBC,UAA6C,CAAC,CAAC;IAC/G,MAAM,EACFC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,KAAK,EACLC,SAAS,EACTC,cAAc,EACdC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGX;IAEJ,OAAO3B,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;YACA;eACGE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,oBAAoBA;eACpBE,wBAAwBA;eACxBG,kBAAkBA;eAClBE,sBAAsBA;eACtBE,2BAA2BA;eAC3BE,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACEtB,UAAUA,CAAC0B;WACXxB,UAAUA,CAACyB;WACXvB,UAAUA,CAACwB;WACXtB,aAAaA,CAACuB;WACdrB,iBAAiBA,CAACsB;WAClBnB,WAAWA,CAACoB;WACZlB,eAAeA,CAACmB;WAChBjB,oBAAoBA,CAACkB;WACrBhB,gBAAgBA,CAACO,iBAAiBU;QACrC,sFAAsF;QACtF,8DAA8D;WAC1Df,YAAYA,CAACgB;WACdd,UAAUA,CAACe;QACd;YACI,SAAS;gBACL,aAAa1B,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL,EAAE"}
1
+ {"version":3,"file":"by-project-type/defineWebApplicationConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineWebApplicationConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { type CoreConfigOptions, coreGlobalIgnores, defineCoreConfig } from \"../core.ts\";\nimport { defineJestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { defineJsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { defineJsxAllyConfig, type JsxAllyConfigOptions, jsxAllyGlobalIgnores } from \"../jsxAlly.ts\";\nimport { definePackageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { defineReactConfig, type ReactConfigOptions, reactGlobalIgnores } from \"../react.ts\";\nimport { defineStorybookConfig, type StorybookConfigOptions, storybookGlobalIgnores } from \"../storybook.ts\";\nimport { defineTestingLibraryConfig, type TestingLibraryConfigOptions, testingLibraryGlobalIgnores } from \"../testingLibrary.ts\";\nimport { defineTypeScriptConfig, type TypeScriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { defineVitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { defineYamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineWebApplicationConfigOptions {\n testFramework?: \"vitest\" | \"jest\";\n core?: CoreConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n jsxAlly?: JsxAllyConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n react?: ReactConfigOptions;\n storybook?: StorybookConfigOptions;\n testingLibrary?: TestingLibraryConfigOptions;\n typescript?: TypeScriptConfigOptions;\n vitest?: VitestConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport const defineWebApplicationConfig = (tsconfigRootDir: string, options: DefineWebApplicationConfigOptions = {}) => {\n const {\n testFramework = \"vitest\",\n core,\n jest,\n json,\n jsxAlly,\n packageJson,\n react,\n storybook,\n testingLibrary,\n typescript,\n vitest,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \"**/__snapshots__/*\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...jsxAllyGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...reactGlobalIgnores,\n ...storybookGlobalIgnores,\n ...testingLibraryGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...defineCoreConfig(core),\n ...defineJestConfig({\n ...jest,\n enabled: jest?.enabled ?? testFramework === \"jest\"\n }),\n ...defineJsonConfig(json),\n ...defineJsxAllyConfig(jsxAlly),\n ...definePackageJsonConfig(packageJson),\n ...defineReactConfig(react),\n ...defineStorybookConfig(storybook),\n ...defineTestingLibraryConfig(testingLibrary),\n ...defineTypeScriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n ...(defineVitestConfig({\n ...vitest,\n enabled: vitest?.enabled ?? testFramework === \"vitest\"\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) as any),\n ...defineYamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n};\n"],"names":["defineConfig","globalIgnores","coreGlobalIgnores","defineCoreConfig","defineJestConfig","jestGlobalIgnores","defineJsonConfig","jsonGlobalIgnores","defineJsxAllyConfig","jsxAllyGlobalIgnores","definePackageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","defineReactConfig","reactGlobalIgnores","defineStorybookConfig","storybookGlobalIgnores","defineTestingLibraryConfig","testingLibraryGlobalIgnores","defineTypeScriptConfig","typescriptGlobalIgnores","defineVitestConfig","vitestGlobalIgnores","defineYamlConfig","yamlGlobalIgnores","defineWebApplicationConfig","tsconfigRootDir","options","testFramework","core","jest","json","jsxAlly","packageJson","react","storybook","testingLibrary","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AAC6B;AACA;AACL;AACiB;AACgB;AACvD;AAC+B;AACgB;AACoB;AAChB;AAChB;AACR;AAiBzF;;;CAGC,GACM,MAAMyB,6BAA6B,CAACC,iBAAyBC,UAA6C,CAAC,CAAC;IAC/G,MAAM,EACFC,gBAAgB,QAAQ,EACxBC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,KAAK,EACLC,SAAS,EACTC,cAAc,EACdC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGZ;IAEJ,OAAO3B,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;YACA;eACGC,iBAAiBA;eACjBG,iBAAiBA;eACjBE,iBAAiBA;eACjBE,oBAAoBA;eACpBE,wBAAwBA;eACxBG,kBAAkBA;eAClBE,sBAAsBA;eACtBE,2BAA2BA;eAC3BE,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACErB,gBAAgBA,CAAC0B;WACjBzB,gBAAgBA,CAAC;YAChB,GAAG0B,IAAI;YACP,SAASA,MAAM,WAAWF,kBAAkB;QAChD;WACGtB,gBAAgBA,CAACyB;WACjBvB,mBAAmBA,CAACwB;WACpBtB,uBAAuBA,CAACuB;WACxBpB,iBAAiBA,CAACqB;WAClBnB,qBAAqBA,CAACoB;WACtBlB,0BAA0BA,CAACmB;WAC3BjB,sBAAsBA,CAACO,iBAAiBW;QAC3C,sFAAsF;WAClFhB,kBAAkBA,CAAC;YACnB,GAAGiB,MAAM;YACT,SAASA,QAAQ,WAAWV,kBAAkB;QAElD;WACGL,gBAAgBA,CAACgB;QACpB;YACI,SAAS;gBACL,aAAa3B,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL,EAAE"}
package/dist/core.d.ts CHANGED
@@ -4,4 +4,4 @@ export interface CoreConfigOptions {
4
4
  rules?: Partial<Linter.RulesRecord>;
5
5
  }
6
6
  export declare const coreGlobalIgnores: never[];
7
- export declare function coreConfig(options?: CoreConfigOptions): ConfigWithExtends[];
7
+ export declare function defineCoreConfig(options?: CoreConfigOptions): ConfigWithExtends[];
package/dist/core.js CHANGED
@@ -13,7 +13,7 @@ import globals from "globals";
13
13
 
14
14
 
15
15
  const coreGlobalIgnores = [];
16
- function coreConfig(options = {}) {
16
+ function defineCoreConfig(options = {}) {
17
17
  const { rules } = options;
18
18
  const config = [
19
19
  {
@@ -145,6 +145,6 @@ function coreConfig(options = {}) {
145
145
  return config;
146
146
  }
147
147
 
148
- export { coreConfig, coreGlobalIgnores };
148
+ export { coreGlobalIgnores, defineCoreConfig };
149
149
 
150
150
  //# sourceMappingURL=core.js.map
package/dist/core.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sources":["webpack://@workleap/eslint-configs/./src/core.ts"],"sourcesContent":["import js from \"@eslint/js\";\nimport type { Linter } from \"eslint\";\nimport importPlugin from \"eslint-plugin-import\";\nimport globals from \"globals\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface CoreConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const coreGlobalIgnores = [];\n\nexport function coreConfig(options: CoreConfigOptions = {}) {\n const {\n rules\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/core\",\n files: [\n \"**/*.{js,jsx,ts,tsx,cjs,mjs}\"\n ],\n plugins: {\n js,\n import: importPlugin\n },\n extends: [\n js.configs.recommended\n ],\n languageOptions: {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n globals: {\n ...globals.browser,\n ...globals.es2024,\n ...globals.node,\n ...globals.commonjs\n }\n },\n rules: {\n // Recommended rules overrides\n \"no-cond-assign\": [\"error\", \"except-parens\"],\n \"no-labels\": [\"warn\", { allowLoop: true, allowSwitch: false }],\n \"no-prototype-builtins\": \"off\",\n\n // Possible problems\n \"array-callback-return\": \"error\",\n \"no-self-compare\": \"error\",\n \"no-template-curly-in-string\": \"error\",\n \"no-use-before-define\": [\n \"error\",\n {\n functions: false,\n classes: false,\n variables: false\n }\n ],\n\n // Suggestions\n curly: \"warn\",\n eqeqeq: [\"warn\", \"smart\"],\n \"no-array-constructor\": \"warn\",\n \"no-caller\": \"warn\",\n \"no-eval\": \"warn\",\n \"no-extend-native\": \"warn\",\n \"no-extra-bind\": \"warn\",\n \"no-extra-label\": \"warn\",\n \"no-implied-eval\": \"warn\",\n \"no-iterator\": \"warn\",\n \"no-label-var\": \"warn\",\n \"no-lone-blocks\": \"warn\",\n \"no-loop-func\": \"warn\",\n \"no-multi-str\": \"warn\",\n \"no-new-func\": \"warn\",\n // Deprecated but still no replacement in @stylistic.\n // \"no-new-object\": \"warn\",\n \"no-new-wrappers\": \"warn\",\n \"no-octal-escape\": \"warn\",\n \"no-param-reassign\": \"warn\",\n \"no-restricted-properties\": \"warn\",\n \"no-restricted-globals\": [\"error\"],\n \"no-restricted-syntax\": [\"error\", \"WithStatement\"],\n \"no-script-url\": \"warn\",\n \"no-sequences\": \"warn\",\n \"no-shadow\": \"warn\",\n \"no-throw-literal\": \"warn\",\n \"no-unneeded-ternary\": \"warn\",\n \"no-unused-expressions\": [\n \"error\",\n {\n allowShortCircuit: true,\n allowTernary: true,\n allowTaggedTemplates: true\n }\n ],\n \"no-useless-computed-key\": \"warn\",\n \"no-useless-concat\": \"warn\",\n \"no-useless-constructor\": \"warn\",\n \"no-useless-rename\": [\n \"warn\",\n {\n ignoreDestructuring: false,\n ignoreImport: false,\n ignoreExport: false\n }\n ],\n \"no-var\": \"warn\",\n \"prefer-const\": \"warn\",\n strict: [\"warn\", \"never\"],\n\n // Layout & Formatting\n \"unicode-bom\": [\"warn\", \"never\"],\n\n // https://github.com/import-js/eslint-plugin-import/tree/main/docs/rules\n \"import/newline-after-import\": \"warn\",\n \"import/no-amd\": \"error\",\n \"import/no-duplicates\": \"warn\",\n \"import/no-self-import\": \"error\",\n \"import/no-webpack-loader-syntax\": \"error\",\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["js","importPlugin","globals","coreGlobalIgnores","coreConfig","options","rules","config"],"mappings":";;;;;;;;;;;AAA4B;AAEoB;AAClB;AAOvB,MAAMG,oBAAoB,EAAE,CAAC;AAE7B,SAASC,WAAWC,UAA6B,CAAC,CAAC;IACtD,MAAM,EACFC,KAAK,EACR,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLP,EAAEA,EAAAA,EAAAA;gBACF,QAAQC,oBAAYA;YACxB;YACA,SAAS;gBACLD,sBAAsB;aACzB;YACD,iBAAiB;gBACb,aAAa;gBACb,YAAY;gBACZ,SAAS;oBACL,GAAGE,eAAe;oBAClB,GAAGA,cAAc;oBACjB,GAAGA,YAAY;oBACf,GAAGA,gBAAgB;gBACvB;YACJ;YACA,OAAO;gBACH,8BAA8B;gBAC9B,kBAAkB;oBAAC;oBAAS;iBAAgB;gBAC5C,aAAa;oBAAC;oBAAQ;wBAAE,WAAW;wBAAM,aAAa;oBAAM;iBAAE;gBAC9D,yBAAyB;gBAEzB,oBAAoB;gBACpB,yBAAyB;gBACzB,mBAAmB;gBACnB,+BAA+B;gBAC/B,wBAAwB;oBACpB;oBACA;wBACI,WAAW;wBACX,SAAS;wBACT,WAAW;oBACf;iBACH;gBAED,cAAc;gBACd,OAAO;gBACP,QAAQ;oBAAC;oBAAQ;iBAAQ;gBACzB,wBAAwB;gBACxB,aAAa;gBACb,WAAW;gBACX,oBAAoB;gBACpB,iBAAiB;gBACjB,kBAAkB;gBAClB,mBAAmB;gBACnB,eAAe;gBACf,gBAAgB;gBAChB,kBAAkB;gBAClB,gBAAgB;gBAChB,gBAAgB;gBAChB,eAAe;gBACf,qDAAqD;gBACrD,2BAA2B;gBAC3B,mBAAmB;gBACnB,mBAAmB;gBACnB,qBAAqB;gBACrB,4BAA4B;gBAC5B,yBAAyB;oBAAC;iBAAQ;gBAClC,wBAAwB;oBAAC;oBAAS;iBAAgB;gBAClD,iBAAiB;gBACjB,gBAAgB;gBAChB,aAAa;gBACb,oBAAoB;gBACpB,uBAAuB;gBACvB,yBAAyB;oBACrB;oBACA;wBACI,mBAAmB;wBACnB,cAAc;wBACd,sBAAsB;oBAC1B;iBACH;gBACD,2BAA2B;gBAC3B,qBAAqB;gBACrB,0BAA0B;gBAC1B,qBAAqB;oBACjB;oBACA;wBACI,qBAAqB;wBACrB,cAAc;wBACd,cAAc;oBAClB;iBACH;gBACD,UAAU;gBACV,gBAAgB;gBAChB,QAAQ;oBAAC;oBAAQ;iBAAQ;gBAEzB,sBAAsB;gBACtB,eAAe;oBAAC;oBAAQ;iBAAQ;gBAEhC,yEAAyE;gBACzE,+BAA+B;gBAC/B,iBAAiB;gBACjB,wBAAwB;gBACxB,yBAAyB;gBACzB,mCAAmC;gBAEnC,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
1
+ {"version":3,"file":"core.js","sources":["webpack://@workleap/eslint-configs/./src/core.ts"],"sourcesContent":["import js from \"@eslint/js\";\nimport type { Linter } from \"eslint\";\nimport importPlugin from \"eslint-plugin-import\";\nimport globals from \"globals\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface CoreConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const coreGlobalIgnores = [];\n\nexport function defineCoreConfig(options: CoreConfigOptions = {}) {\n const {\n rules\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/core\",\n files: [\n \"**/*.{js,jsx,ts,tsx,cjs,mjs}\"\n ],\n plugins: {\n js,\n import: importPlugin\n },\n extends: [\n js.configs.recommended\n ],\n languageOptions: {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n globals: {\n ...globals.browser,\n ...globals.es2024,\n ...globals.node,\n ...globals.commonjs\n }\n },\n rules: {\n // Recommended rules overrides\n \"no-cond-assign\": [\"error\", \"except-parens\"],\n \"no-labels\": [\"warn\", { allowLoop: true, allowSwitch: false }],\n \"no-prototype-builtins\": \"off\",\n\n // Possible problems\n \"array-callback-return\": \"error\",\n \"no-self-compare\": \"error\",\n \"no-template-curly-in-string\": \"error\",\n \"no-use-before-define\": [\n \"error\",\n {\n functions: false,\n classes: false,\n variables: false\n }\n ],\n\n // Suggestions\n curly: \"warn\",\n eqeqeq: [\"warn\", \"smart\"],\n \"no-array-constructor\": \"warn\",\n \"no-caller\": \"warn\",\n \"no-eval\": \"warn\",\n \"no-extend-native\": \"warn\",\n \"no-extra-bind\": \"warn\",\n \"no-extra-label\": \"warn\",\n \"no-implied-eval\": \"warn\",\n \"no-iterator\": \"warn\",\n \"no-label-var\": \"warn\",\n \"no-lone-blocks\": \"warn\",\n \"no-loop-func\": \"warn\",\n \"no-multi-str\": \"warn\",\n \"no-new-func\": \"warn\",\n // Deprecated but still no replacement in @stylistic.\n // \"no-new-object\": \"warn\",\n \"no-new-wrappers\": \"warn\",\n \"no-octal-escape\": \"warn\",\n \"no-param-reassign\": \"warn\",\n \"no-restricted-properties\": \"warn\",\n \"no-restricted-globals\": [\"error\"],\n \"no-restricted-syntax\": [\"error\", \"WithStatement\"],\n \"no-script-url\": \"warn\",\n \"no-sequences\": \"warn\",\n \"no-shadow\": \"warn\",\n \"no-throw-literal\": \"warn\",\n \"no-unneeded-ternary\": \"warn\",\n \"no-unused-expressions\": [\n \"error\",\n {\n allowShortCircuit: true,\n allowTernary: true,\n allowTaggedTemplates: true\n }\n ],\n \"no-useless-computed-key\": \"warn\",\n \"no-useless-concat\": \"warn\",\n \"no-useless-constructor\": \"warn\",\n \"no-useless-rename\": [\n \"warn\",\n {\n ignoreDestructuring: false,\n ignoreImport: false,\n ignoreExport: false\n }\n ],\n \"no-var\": \"warn\",\n \"prefer-const\": \"warn\",\n strict: [\"warn\", \"never\"],\n\n // Layout & Formatting\n \"unicode-bom\": [\"warn\", \"never\"],\n\n // https://github.com/import-js/eslint-plugin-import/tree/main/docs/rules\n \"import/newline-after-import\": \"warn\",\n \"import/no-amd\": \"error\",\n \"import/no-duplicates\": \"warn\",\n \"import/no-self-import\": \"error\",\n \"import/no-webpack-loader-syntax\": \"error\",\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["js","importPlugin","globals","coreGlobalIgnores","defineCoreConfig","options","rules","config"],"mappings":";;;;;;;;;;;AAA4B;AAEoB;AAClB;AAOvB,MAAMG,oBAAoB,EAAE,CAAC;AAE7B,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,MAAM,EACFC,KAAK,EACR,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLP,EAAEA,EAAAA,EAAAA;gBACF,QAAQC,oBAAYA;YACxB;YACA,SAAS;gBACLD,sBAAsB;aACzB;YACD,iBAAiB;gBACb,aAAa;gBACb,YAAY;gBACZ,SAAS;oBACL,GAAGE,eAAe;oBAClB,GAAGA,cAAc;oBACjB,GAAGA,YAAY;oBACf,GAAGA,gBAAgB;gBACvB;YACJ;YACA,OAAO;gBACH,8BAA8B;gBAC9B,kBAAkB;oBAAC;oBAAS;iBAAgB;gBAC5C,aAAa;oBAAC;oBAAQ;wBAAE,WAAW;wBAAM,aAAa;oBAAM;iBAAE;gBAC9D,yBAAyB;gBAEzB,oBAAoB;gBACpB,yBAAyB;gBACzB,mBAAmB;gBACnB,+BAA+B;gBAC/B,wBAAwB;oBACpB;oBACA;wBACI,WAAW;wBACX,SAAS;wBACT,WAAW;oBACf;iBACH;gBAED,cAAc;gBACd,OAAO;gBACP,QAAQ;oBAAC;oBAAQ;iBAAQ;gBACzB,wBAAwB;gBACxB,aAAa;gBACb,WAAW;gBACX,oBAAoB;gBACpB,iBAAiB;gBACjB,kBAAkB;gBAClB,mBAAmB;gBACnB,eAAe;gBACf,gBAAgB;gBAChB,kBAAkB;gBAClB,gBAAgB;gBAChB,gBAAgB;gBAChB,eAAe;gBACf,qDAAqD;gBACrD,2BAA2B;gBAC3B,mBAAmB;gBACnB,mBAAmB;gBACnB,qBAAqB;gBACrB,4BAA4B;gBAC5B,yBAAyB;oBAAC;iBAAQ;gBAClC,wBAAwB;oBAAC;oBAAS;iBAAgB;gBAClD,iBAAiB;gBACjB,gBAAgB;gBAChB,aAAa;gBACb,oBAAoB;gBACpB,uBAAuB;gBACvB,yBAAyB;oBACrB;oBACA;wBACI,mBAAmB;wBACnB,cAAc;wBACd,sBAAsB;oBAC1B;iBACH;gBACD,2BAA2B;gBAC3B,qBAAqB;gBACrB,0BAA0B;gBAC1B,qBAAqB;oBACjB;oBACA;wBACI,qBAAqB;wBACrB,cAAc;wBACd,cAAc;oBAClB;iBACH;gBACD,UAAU;gBACV,gBAAgB;gBAChB,QAAQ;oBAAC;oBAAQ;iBAAQ;gBAEzB,sBAAsB;gBACtB,eAAe;oBAAC;oBAAQ;iBAAQ;gBAEhC,yEAAyE;gBACzE,+BAA+B;gBAC/B,iBAAiB;gBACjB,wBAAwB;gBACxB,yBAAyB;gBACzB,mCAAmC;gBAEnC,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
package/dist/index.d.ts CHANGED
@@ -2,14 +2,14 @@ export { defineMonorepoWorkspaceConfig, type DefineMonorepoWorkspaceConfigOption
2
2
  export { defineReactLibraryConfig, type DefineReactLibraryConfigOptions } from "./by-project-type/defineReactLibraryConfig.ts";
3
3
  export { defineTypeScriptLibraryConfig, type DefineTypeScriptLibraryConfigOptions } from "./by-project-type/defineTypescriptLibraryConfig.ts";
4
4
  export { defineWebApplicationConfig, type DefineWebApplicationConfigOptions } from "./by-project-type/defineWebApplicationConfig.ts";
5
- export type { CoreConfigOptions } from "./core.ts";
6
- export type { JestConfigOptions } from "./jest.ts";
7
- export type { JsxAllyConfigOptions } from "./jsxAlly.ts";
8
- export type { PackageJsonConfigOptions } from "./packageJson.ts";
9
- export type { ReactConfigOptions } from "./react.ts";
10
- export type { StorybookConfigOptions } from "./storybook.ts";
11
- export type { TestingLibraryConfigOptions } from "./testingLibrary.ts";
5
+ export { defineCoreConfig, type CoreConfigOptions } from "./core.ts";
6
+ export { defineJestConfig, type JestConfigOptions } from "./jest.ts";
7
+ export { defineJsxAllyConfig, type JsxAllyConfigOptions } from "./jsxAlly.ts";
8
+ export { definePackageJsonConfig, type PackageJsonConfigOptions } from "./packageJson.ts";
9
+ export { defineReactConfig, type ReactConfigOptions } from "./react.ts";
10
+ export { defineStorybookConfig, type StorybookConfigOptions } from "./storybook.ts";
11
+ export { defineTestingLibraryConfig, type TestingLibraryConfigOptions } from "./testingLibrary.ts";
12
12
  export type { ConfigWithExtends, ExtendsElement, InfiniteArray, SimpleExtendsElement } from "./types.ts";
13
- export type { TypescriptConfigOptions } from "./typescript.ts";
14
- export type { VitestConfigOptions } from "./vitest.ts";
15
- export type { YamlConfigOptions } from "./yaml.ts";
13
+ export { defineTypeScriptConfig, type TypeScriptConfigOptions } from "./typescript.ts";
14
+ export { defineVitestConfig, type VitestConfigOptions } from "./vitest.ts";
15
+ export { defineYamlConfig, type YamlConfigOptions } from "./yaml.ts";