@workleap/eslint-configs 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @workleap/eslint-configs
2
2
 
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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.
8
+
3
9
  ## 1.0.0
4
10
 
5
11
  ### Major Changes
@@ -10,6 +10,7 @@ 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;
@@ -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([
@@ -76,7 +76,10 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
76
76
  ...yamlGlobalIgnores
77
77
  ]),
78
78
  ...coreConfig(core),
79
- ...jestConfig(jest),
79
+ ...jestConfig({
80
+ ...jest,
81
+ enabled: jest?.enabled ?? testFramework === "jest"
82
+ }),
80
83
  ...jsonConfig(json),
81
84
  ...jsxAllyConfig(jsxAlly),
82
85
  ...packageJsonConfig(packageJson),
@@ -85,8 +88,10 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
85
88
  ...testingLibraryConfig(testingLibrary),
86
89
  ...typescriptConfig(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),
91
+ ...vitestConfig({
92
+ ...vitest,
93
+ enabled: vitest?.enabled ?? testFramework === "vitest"
94
+ }),
90
95
  ...yamlConfig(yaml),
91
96
  {
92
97
  plugins: {
@@ -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 { 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 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 ...coreConfig(core),\n ...jestConfig({\n ...jest,\n enabled: jest?.enabled ?? testFramework === \"jest\"\n }),\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 ...(vitestConfig({\n ...vitest,\n enabled: vitest?.enabled ?? testFramework === \"vitest\"\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) 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","testFramework","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;AAiBnF;;;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;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,CAAC2B;WACXzB,UAAUA,CAAC;YACV,GAAG0B,IAAI;YACP,SAASA,MAAM,WAAWF,kBAAkB;QAChD;WACGtB,UAAUA,CAACyB;WACXvB,aAAaA,CAACwB;WACdtB,iBAAiBA,CAACuB;WAClBpB,WAAWA,CAACqB;WACZnB,eAAeA,CAACoB;WAChBlB,oBAAoBA,CAACmB;WACrBjB,gBAAgBA,CAACO,iBAAiBW;QACrC,sFAAsF;WAClFhB,YAAYA,CAAC;YACb,GAAGiB,MAAM;YACT,SAASA,QAAQ,WAAWV,kBAAkB;QAElD;WACGL,UAAUA,CAACgB;QACd;YACI,SAAS;gBACL,aAAa3B,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL"}
@@ -6,6 +6,7 @@ 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
11
  typescript?: TypescriptConfigOptions;
11
12
  jest?: JestConfigOptions;
@@ -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([
@@ -56,13 +56,18 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
56
56
  ...yamlGlobalIgnores
57
57
  ]),
58
58
  ...coreConfig(core),
59
- ...jestConfig(jest),
59
+ ...jestConfig({
60
+ ...jest,
61
+ enabled: jest?.enabled ?? testFramework === "jest"
62
+ }),
60
63
  ...jsonConfig(json),
61
64
  ...packageJsonConfig(packageJson),
62
65
  ...typescriptConfig(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),
67
+ ...vitestConfig({
68
+ ...vitest,
69
+ enabled: vitest?.enabled ?? testFramework === "vitest"
70
+ }),
66
71
  ...yamlConfig(yaml),
67
72
  {
68
73
  plugins: {
@@ -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 { 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 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 ...coreConfig(core),\n ...jestConfig({\n ...jest,\n enabled: jest?.enabled ?? testFramework === \"jest\"\n }),\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 ...(vitestConfig({\n ...vitest,\n enabled: vitest?.enabled ?? testFramework === \"vitest\"\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) 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","testFramework","core","jest","json","packageJson","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AACuB;AACA;AACL;AACiC;AACjD;AAC6C;AAChB;AACR;AAanF;;;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;eACGE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,wBAAwBA;eACxBG,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACEd,UAAUA,CAACmB;WACXjB,UAAUA,CAAC;YACV,GAAGkB,IAAI;YACP,SAASA,MAAM,WAAWF,kBAAkB;QAChD;WACGd,UAAUA,CAACiB;WACXf,iBAAiBA,CAACgB;WAClBb,gBAAgBA,CAACO,iBAAiBO;QACrC,sFAAsF;WAClFZ,YAAYA,CAAC;YACb,GAAGa,MAAM;YACT,SAASA,QAAQ,WAAWN,kBAAkB;QAElD;WACGL,UAAUA,CAACY;QACd;YACI,SAAS;gBACL,aAAajB,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL"}
@@ -10,6 +10,7 @@ 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;
@@ -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([
@@ -76,7 +76,10 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
76
76
  ...yamlGlobalIgnores
77
77
  ]),
78
78
  ...coreConfig(core),
79
- ...jestConfig(jest),
79
+ ...jestConfig({
80
+ ...jest,
81
+ enabled: jest?.enabled ?? testFramework === "jest"
82
+ }),
80
83
  ...jsonConfig(json),
81
84
  ...jsxAllyConfig(jsxAlly),
82
85
  ...packageJsonConfig(packageJson),
@@ -85,8 +88,10 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
85
88
  ...testingLibraryConfig(testingLibrary),
86
89
  ...typescriptConfig(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),
91
+ ...vitestConfig({
92
+ ...vitest,
93
+ enabled: vitest?.enabled ?? testFramework === "vitest"
94
+ }),
90
95
  ...yamlConfig(yaml),
91
96
  {
92
97
  plugins: {
@@ -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 { 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\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\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 ...coreConfig(core),\n ...jestConfig({\n ...jest,\n enabled: jest?.enabled ?? testFramework === \"jest\"\n }),\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 ...(vitestConfig({\n ...vitest,\n enabled: vitest?.enabled ?? testFramework === \"vitest\"\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) 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","testFramework","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;AAgDnF;;;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;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,CAAC2B;WACXzB,UAAUA,CAAC;YACV,GAAG0B,IAAI;YACP,SAASA,MAAM,WAAWF,kBAAkB;QAChD;WACGtB,UAAUA,CAACyB;WACXvB,aAAaA,CAACwB;WACdtB,iBAAiBA,CAACuB;WAClBpB,WAAWA,CAACqB;WACZnB,eAAeA,CAACoB;WAChBlB,oBAAoBA,CAACmB;WACrBjB,gBAAgBA,CAACO,iBAAiBW;QACrC,sFAAsF;WAClFhB,YAAYA,CAAC;YACb,GAAGiB,MAAM;YACT,SAASA,QAAQ,WAAWV,kBAAkB;QAElD;WACGL,UAAUA,CAACgB;QACd;YACI,SAAS;gBACL,aAAa3B,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL,EAAE"}
package/dist/jest.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { Linter } from "eslint";
2
2
  import type { ConfigWithExtends } from "./types.ts";
3
3
  export interface JestConfigOptions {
4
+ enabled?: boolean;
4
5
  rules?: Partial<Linter.RulesRecord>;
5
6
  }
6
7
  export declare const jestGlobalIgnores: never[];
package/dist/jest.js CHANGED
@@ -10,7 +10,10 @@ import globals from "globals";
10
10
 
11
11
  const jestGlobalIgnores = [];
12
12
  function jestConfig(options = {}) {
13
- const { rules = {} } = options;
13
+ const { enabled = false, rules = {} } = options;
14
+ if (!enabled) {
15
+ return [];
16
+ }
14
17
  const config = [
15
18
  {
16
19
  name: "@workleap/eslint-configs/jest",
@@ -38,6 +41,7 @@ function jestConfig(options = {}) {
38
41
  }
39
42
  },
40
43
  rules: {
44
+ "jest/no-commented-out-tests": "off",
41
45
  // Gives better failure messages for array checks.
42
46
  "jest/prefer-to-contain": "error",
43
47
  // Prefer spies to allow for automatic restoration.
package/dist/jest.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"jest.js","sources":["webpack://@workleap/eslint-configs/./src/jest.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport jestPlugin from \"eslint-plugin-jest\";\nimport globals from \"globals\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface JestConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jestGlobalIgnores = [];\n\nexport function jestConfig(options: JestConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/jest\",\n files: [\n \"**/*.test.{js,jsx,ts,tsx}\",\n \"**/*-test.{js,jsx,ts,tsx}\",\n \"**/__tests__/*.{js,jsx,ts,tsx}\",\n \"**/test.{js,jsx,ts,tsx}\"\n ],\n extends: [\n jestPlugin.configs[\"flat/recommended\"]\n ],\n languageOptions: {\n globals: {\n ...globals.browser,\n ...globals.es2024,\n ...globals.node,\n ...globals.commonjs,\n ...globals.jest\n }\n },\n settings: {\n jest: {\n version: \"detect\"\n }\n },\n rules: {\n // Gives better failure messages for array checks.\n \"jest/prefer-to-contain\": \"error\",\n // Prefer spies to allow for automatic restoration.\n \"jest/prefer-spy-on\": \"error\",\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["jestPlugin","globals","jestGlobalIgnores","jestConfig","options","rules","config"],"mappings":";;;;;;;;AAC4C;AACd;AAOvB,MAAME,oBAAoB,EAAE,CAAC;AAE7B,SAASC,WAAWC,UAA6B,CAAC,CAAC;IACtD,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;gBACA;gBACA;gBACA;aACH;YACD,SAAS;gBACLN,8CAAsC;aACzC;YACD,iBAAiB;gBACb,SAAS;oBACL,GAAGC,eAAe;oBAClB,GAAGA,cAAc;oBACjB,GAAGA,YAAY;oBACf,GAAGA,gBAAgB;oBACnB,GAAGA,YAAY;gBACnB;YACJ;YACA,UAAU;gBACN,MAAM;oBACF,SAAS;gBACb;YACJ;YACA,OAAO;gBACH,kDAAkD;gBAClD,0BAA0B;gBAC1B,mDAAmD;gBACnD,sBAAsB;gBACtB,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
1
+ {"version":3,"file":"jest.js","sources":["webpack://@workleap/eslint-configs/./src/jest.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport jestPlugin from \"eslint-plugin-jest\";\nimport globals from \"globals\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface JestConfigOptions {\n enabled?: boolean;\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jestGlobalIgnores = [];\n\nexport function jestConfig(options: JestConfigOptions = {}) {\n const {\n enabled = false,\n rules = {}\n } = options;\n\n if (!enabled) {\n return [];\n }\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/jest\",\n files: [\n \"**/*.test.{js,jsx,ts,tsx}\",\n \"**/*-test.{js,jsx,ts,tsx}\",\n \"**/__tests__/*.{js,jsx,ts,tsx}\",\n \"**/test.{js,jsx,ts,tsx}\"\n ],\n extends: [\n jestPlugin.configs[\"flat/recommended\"]\n ],\n languageOptions: {\n globals: {\n ...globals.browser,\n ...globals.es2024,\n ...globals.node,\n ...globals.commonjs,\n ...globals.jest\n }\n },\n settings: {\n jest: {\n version: \"detect\"\n }\n },\n rules: {\n \"jest/no-commented-out-tests\": \"off\",\n // Gives better failure messages for array checks.\n \"jest/prefer-to-contain\": \"error\",\n // Prefer spies to allow for automatic restoration.\n \"jest/prefer-spy-on\": \"error\",\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["jestPlugin","globals","jestGlobalIgnores","jestConfig","options","enabled","rules","config"],"mappings":";;;;;;;;AAC4C;AACd;AAQvB,MAAME,oBAAoB,EAAE,CAAC;AAE7B,SAASC,WAAWC,UAA6B,CAAC,CAAC;IACtD,MAAM,EACFC,UAAU,KAAK,EACfC,QAAQ,CAAC,CAAC,EACb,GAAGF;IAEJ,IAAI,CAACC,SAAS;QACV,OAAO,EAAE;IACb;IAEA,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;gBACA;gBACA;gBACA;aACH;YACD,SAAS;gBACLP,8CAAsC;aACzC;YACD,iBAAiB;gBACb,SAAS;oBACL,GAAGC,eAAe;oBAClB,GAAGA,cAAc;oBACjB,GAAGA,YAAY;oBACf,GAAGA,gBAAgB;oBACnB,GAAGA,YAAY;gBACnB;YACJ;YACA,UAAU;gBACN,MAAM;oBACF,SAAS;gBACb;YACJ;YACA,OAAO;gBACH,+BAA+B;gBAC/B,kDAAkD;gBAClD,0BAA0B;gBAC1B,mDAAmD;gBACnD,sBAAsB;gBACtB,+DAA+D;gBAC/D,GAAGK,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
package/dist/vitest.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { Linter } from "eslint";
2
2
  import type { ConfigWithExtends } from "./types.ts";
3
3
  export interface VitestConfigOptions {
4
+ enabled?: boolean;
4
5
  rules?: Partial<Linter.RulesRecord>;
5
6
  }
6
7
  export declare const vitestGlobalIgnores: never[];
package/dist/vitest.js CHANGED
@@ -6,7 +6,10 @@ import eslint_plugin from "@vitest/eslint-plugin";
6
6
 
7
7
  const vitestGlobalIgnores = [];
8
8
  function vitestConfig(options = {}) {
9
- const { rules = {} } = options;
9
+ const { enabled = true, rules = {} } = options;
10
+ if (!enabled) {
11
+ return [];
12
+ }
10
13
  const config = [
11
14
  {
12
15
  name: "@workleap/eslint-configs/vitest",
@@ -1 +1 @@
1
- {"version":3,"file":"vitest.js","sources":["webpack://@workleap/eslint-configs/./src/vitest.ts"],"sourcesContent":["import vitestPlugin from \"@vitest/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface VitestConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const vitestGlobalIgnores = [];\n\nexport function vitestConfig(options: VitestConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/vitest\",\n files: [\n \"**/*.test.{js,jsx,ts,tsx}\",\n \"**/*-test.{js,jsx,ts,tsx}\",\n \"**/__tests__/*.{js,jsx,ts,tsx}\",\n \"**/test.{js,jsx,ts,tsx}\"\n ],\n plugins: {\n // @ts-expect-error temporary code until defineConfig is supported.\n vitest: vitestPlugin\n },\n // Waiting for defineConfig support: https://github.com/vitest-dev/eslint-plugin-vitest/issues/771\n // extends: [\n // vitestPlugin.configs.recommended\n // ],\n rules: {\n ...vitestPlugin.configs.recommended.rules,\n \"vitest/no-commented-out-tests\": \"off\",\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["vitestPlugin","vitestGlobalIgnores","vitestConfig","options","rules","config"],"mappings":";;;;;AAAiD;AAQ1C,MAAMC,sBAAsB,EAAE,CAAC;AAE/B,SAASC,aAAaC,UAA+B,CAAC,CAAC;IAC1D,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;gBACA;gBACA;gBACA;aACH;YACD,SAAS;gBACL,mEAAmE;gBACnE,QAAQL,aAAYA;YACxB;YACA,kGAAkG;YAClG,aAAa;YACb,uCAAuC;YACvC,KAAK;YACL,OAAO;gBACH,GAAGA,uCAAsC;gBACzC,iCAAiC;gBACjC,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
1
+ {"version":3,"file":"vitest.js","sources":["webpack://@workleap/eslint-configs/./src/vitest.ts"],"sourcesContent":["import vitestPlugin from \"@vitest/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface VitestConfigOptions {\n enabled?: boolean;\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const vitestGlobalIgnores = [];\n\nexport function vitestConfig(options: VitestConfigOptions = {}) {\n const {\n enabled = true,\n rules = {}\n } = options;\n\n if (!enabled) {\n return [];\n }\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/vitest\",\n files: [\n \"**/*.test.{js,jsx,ts,tsx}\",\n \"**/*-test.{js,jsx,ts,tsx}\",\n \"**/__tests__/*.{js,jsx,ts,tsx}\",\n \"**/test.{js,jsx,ts,tsx}\"\n ],\n plugins: {\n // @ts-expect-error temporary code until defineConfig is supported.\n vitest: vitestPlugin\n },\n // Waiting for defineConfig support: https://github.com/vitest-dev/eslint-plugin-vitest/issues/771\n // extends: [\n // vitestPlugin.configs.recommended\n // ],\n rules: {\n ...vitestPlugin.configs.recommended.rules,\n \"vitest/no-commented-out-tests\": \"off\",\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["vitestPlugin","vitestGlobalIgnores","vitestConfig","options","enabled","rules","config"],"mappings":";;;;;AAAiD;AAS1C,MAAMC,sBAAsB,EAAE,CAAC;AAE/B,SAASC,aAAaC,UAA+B,CAAC,CAAC;IAC1D,MAAM,EACFC,UAAU,IAAI,EACdC,QAAQ,CAAC,CAAC,EACb,GAAGF;IAEJ,IAAI,CAACC,SAAS;QACV,OAAO,EAAE;IACb;IAEA,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;gBACA;gBACA;gBACA;aACH;YACD,SAAS;gBACL,mEAAmE;gBACnE,QAAQN,aAAYA;YACxB;YACA,kGAAkG;YAClG,aAAa;YACb,uCAAuC;YACvC,KAAK;YACL,OAAO;gBACH,GAAGA,uCAAsC;gBACzC,iCAAiC;gBACjC,+DAA+D;gBAC/D,GAAGK,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@workleap/eslint-configs",
3
3
  "author": "Workleap",
4
4
  "description": "Workleap recommended ESLint configurations.",
5
- "version": "1.0.0",
5
+ "version": "1.0.1",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
@@ -13,6 +13,7 @@ import { vitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from "../
13
13
  import { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from "../yaml.ts";
14
14
 
15
15
  export interface DefineReactLibraryConfigOptions {
16
+ testFramework?: "vitest" | "jest";
16
17
  core?: CoreConfigOptions;
17
18
  jest?: JestConfigOptions;
18
19
  json?: JsonConfigOptions;
@@ -32,6 +33,7 @@ export interface DefineReactLibraryConfigOptions {
32
33
  */
33
34
  export function defineReactLibraryConfig(tsconfigRootDir: string, options: DefineReactLibraryConfigOptions = {}) {
34
35
  const {
36
+ testFramework = "vitest",
35
37
  core,
36
38
  jest,
37
39
  json,
@@ -64,7 +66,10 @@ export function defineReactLibraryConfig(tsconfigRootDir: string, options: Defin
64
66
  ...yamlGlobalIgnores
65
67
  ]),
66
68
  ...coreConfig(core),
67
- ...jestConfig(jest),
69
+ ...jestConfig({
70
+ ...jest,
71
+ enabled: jest?.enabled ?? testFramework === "jest"
72
+ }),
68
73
  ...jsonConfig(json),
69
74
  ...jsxAllyConfig(jsxAlly),
70
75
  ...packageJsonConfig(packageJson),
@@ -73,8 +78,11 @@ export function defineReactLibraryConfig(tsconfigRootDir: string, options: Defin
73
78
  ...testingLibraryConfig(testingLibrary),
74
79
  ...typescriptConfig(tsconfigRootDir, typescript),
75
80
  // Temporary fix until the vitest plugin support defineConfig and the types are fixed.
81
+ ...(vitestConfig({
82
+ ...vitest,
83
+ enabled: vitest?.enabled ?? testFramework === "vitest"
76
84
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
77
- ...(vitestConfig(vitest) as any),
85
+ }) as any),
78
86
  ...yamlConfig(yaml),
79
87
  {
80
88
  plugins: {
@@ -9,6 +9,7 @@ import { vitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from "../
9
9
  import { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from "../yaml.ts";
10
10
 
11
11
  export interface DefineTypeScriptLibraryConfigOptions {
12
+ testFramework?: "vitest" | "jest";
12
13
  core?: CoreConfigOptions;
13
14
  typescript?: TypescriptConfigOptions;
14
15
  jest?: JestConfigOptions;
@@ -24,6 +25,7 @@ export interface DefineTypeScriptLibraryConfigOptions {
24
25
  */
25
26
  export function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options: DefineTypeScriptLibraryConfigOptions = {}) {
26
27
  const {
28
+ testFramework = "vitest",
27
29
  core,
28
30
  jest,
29
31
  json,
@@ -48,13 +50,19 @@ export function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options:
48
50
  ...yamlGlobalIgnores
49
51
  ]),
50
52
  ...coreConfig(core),
51
- ...jestConfig(jest),
53
+ ...jestConfig({
54
+ ...jest,
55
+ enabled: jest?.enabled ?? testFramework === "jest"
56
+ }),
52
57
  ...jsonConfig(json),
53
58
  ...packageJsonConfig(packageJson),
54
59
  ...typescriptConfig(tsconfigRootDir, typescript),
55
60
  // Temporary fix until the vitest plugin support defineConfig and the types are fixed.
61
+ ...(vitestConfig({
62
+ ...vitest,
63
+ enabled: vitest?.enabled ?? testFramework === "vitest"
56
64
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
- ...(vitestConfig(vitest) as any),
65
+ }) as any),
58
66
  ...yamlConfig(yaml),
59
67
  {
60
68
  plugins: {
@@ -14,30 +14,6 @@ import { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from "../yaml.t
14
14
 
15
15
  /*
16
16
 
17
- The WHY for the interface instead of using nested "extends".
18
-
19
- 1- ESlint flat config doesn't support nested "extends":
20
-
21
- Each configuration object may have an extends key, but only at the top level — not inside another config that already came from an extends.
22
-
23
- Flat config was designed to be explicitly ordered and fully expanded:
24
-
25
- - "extends" in flat config is syntactic sugar for concatenating multiple config objects.
26
- - Allowing recursion would make config evaluation order ambiguous and slow.
27
-
28
- So ESLint enforces a one-level-deep rule:
29
-
30
- - only a top-level config object can have extends.
31
-
32
- 2- Each object in the array is evaluated independently. "plugins" declared in one object are not inherited by the next object.
33
- So 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.
34
-
35
- 3- Trying to redefine a plugin that as already been define in a configuration object will throw: Cannot redefine plugin "xyz".
36
-
37
- */
38
-
39
- /*
40
-
41
17
  error 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
42
18
 
43
19
  -> It usually means that the project tsconfig.json file cannot find the specified file
@@ -67,19 +43,8 @@ file itself for optimal performance, rather than relying on CLI flags (--ignore-
67
43
 
68
44
  */
69
45
 
70
- /*
71
-
72
- Document the React compiler setting
73
-
74
- */
75
-
76
- /*
77
-
78
- - Document how to extend the rules
79
-
80
- */
81
-
82
46
  export interface DefineWebApplicationConfigOptions {
47
+ testFramework?: "vitest" | "jest";
83
48
  core?: CoreConfigOptions;
84
49
  jest?: JestConfigOptions;
85
50
  json?: JsonConfigOptions;
@@ -99,6 +64,7 @@ export interface DefineWebApplicationConfigOptions {
99
64
  */
100
65
  export const defineWebApplicationConfig = (tsconfigRootDir: string, options: DefineWebApplicationConfigOptions = {}) => {
101
66
  const {
67
+ testFramework = "vitest",
102
68
  core,
103
69
  jest,
104
70
  json,
@@ -131,7 +97,10 @@ export const defineWebApplicationConfig = (tsconfigRootDir: string, options: Def
131
97
  ...yamlGlobalIgnores
132
98
  ]),
133
99
  ...coreConfig(core),
134
- ...jestConfig(jest),
100
+ ...jestConfig({
101
+ ...jest,
102
+ enabled: jest?.enabled ?? testFramework === "jest"
103
+ }),
135
104
  ...jsonConfig(json),
136
105
  ...jsxAllyConfig(jsxAlly),
137
106
  ...packageJsonConfig(packageJson),
@@ -140,8 +109,11 @@ export const defineWebApplicationConfig = (tsconfigRootDir: string, options: Def
140
109
  ...testingLibraryConfig(testingLibrary),
141
110
  ...typescriptConfig(tsconfigRootDir, typescript),
142
111
  // Temporary fix until the vitest plugin support defineConfig and the types are fixed.
112
+ ...(vitestConfig({
113
+ ...vitest,
114
+ enabled: vitest?.enabled ?? testFramework === "vitest"
143
115
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
144
- ...(vitestConfig(vitest) as any),
116
+ }) as any),
145
117
  ...yamlConfig(yaml),
146
118
  {
147
119
  plugins: {
package/src/jest.ts CHANGED
@@ -4,6 +4,7 @@ import globals from "globals";
4
4
  import type { ConfigWithExtends } from "./types.ts";
5
5
 
6
6
  export interface JestConfigOptions {
7
+ enabled?: boolean;
7
8
  rules?: Partial<Linter.RulesRecord>;
8
9
  }
9
10
 
@@ -11,9 +12,14 @@ export const jestGlobalIgnores = [];
11
12
 
12
13
  export function jestConfig(options: JestConfigOptions = {}) {
13
14
  const {
15
+ enabled = false,
14
16
  rules = {}
15
17
  } = options;
16
18
 
19
+ if (!enabled) {
20
+ return [];
21
+ }
22
+
17
23
  const config: ConfigWithExtends[] = [{
18
24
  name: "@workleap/eslint-configs/jest",
19
25
  files: [
@@ -40,6 +46,7 @@ export function jestConfig(options: JestConfigOptions = {}) {
40
46
  }
41
47
  },
42
48
  rules: {
49
+ "jest/no-commented-out-tests": "off",
43
50
  // Gives better failure messages for array checks.
44
51
  "jest/prefer-to-contain": "error",
45
52
  // Prefer spies to allow for automatic restoration.
package/src/vitest.ts CHANGED
@@ -3,6 +3,7 @@ import type { Linter } from "eslint";
3
3
  import type { ConfigWithExtends } from "./types.ts";
4
4
 
5
5
  export interface VitestConfigOptions {
6
+ enabled?: boolean;
6
7
  rules?: Partial<Linter.RulesRecord>;
7
8
  }
8
9
 
@@ -10,9 +11,14 @@ export const vitestGlobalIgnores = [];
10
11
 
11
12
  export function vitestConfig(options: VitestConfigOptions = {}) {
12
13
  const {
14
+ enabled = true,
13
15
  rules = {}
14
16
  } = options;
15
17
 
18
+ if (!enabled) {
19
+ return [];
20
+ }
21
+
16
22
  const config: ConfigWithExtends[] = [{
17
23
  name: "@workleap/eslint-configs/vitest",
18
24
  files: [