@workleap/eslint-configs 1.1.1 → 1.1.3

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,17 @@
1
1
  # @workleap/eslint-configs
2
2
 
3
+ ## 1.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#329](https://github.com/workleap/wl-web-configs/pull/329) [`b05864c`](https://github.com/workleap/wl-web-configs/commit/b05864ce3583f7b31e04b86c5d67465a4ddd28b2) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Added testing-library rules to TypeScript Library config.
8
+
9
+ ## 1.1.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#327](https://github.com/workleap/wl-web-configs/pull/327) [`0853ee5`](https://github.com/workleap/wl-web-configs/commit/0853ee5fc10d33c4b209a4981947f0c52a759444) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Fine tuning ESLint rules.
14
+
3
15
  ## 1.1.1
4
16
 
5
17
  ### Patch Changes
@@ -33,6 +33,7 @@ import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
33
33
  // node_modules folder is ignored by default.
34
34
  globalIgnores([
35
35
  "dist",
36
+ ".playwright",
36
37
  ".turbo",
37
38
  ...coreGlobalIgnores,
38
39
  ...jsonGlobalIgnores,
@@ -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 { 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"}
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 \".playwright\",\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;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"}
@@ -62,6 +62,7 @@ import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
62
62
  globalIgnores([
63
63
  "dist",
64
64
  "**/__snapshots__/*",
65
+ ".playwright",
65
66
  ".turbo",
66
67
  ...coreGlobalIgnores,
67
68
  ...jestGlobalIgnores,
@@ -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 { 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"}
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 \".playwright\",\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;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,17 +2,19 @@ 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 TestingLibraryConfigOptions } from "../testingLibrary.ts";
5
6
  import { type TypeScriptConfigOptions } from "../typescript.ts";
6
7
  import { type VitestConfigOptions } from "../vitest.ts";
7
8
  import { type YamlConfigOptions } from "../yaml.ts";
8
9
  export interface DefineTypeScriptLibraryConfigOptions {
9
10
  testFramework?: "vitest" | "jest";
10
11
  core?: CoreConfigOptions;
11
- typescript?: TypeScriptConfigOptions;
12
12
  jest?: JestConfigOptions;
13
13
  json?: JsonConfigOptions;
14
- vitest?: VitestConfigOptions;
15
14
  packageJson?: PackageJsonConfigOptions;
15
+ testingLibrary?: TestingLibraryConfigOptions;
16
+ typescript?: TypeScriptConfigOptions;
17
+ vitest?: VitestConfigOptions;
16
18
  yaml?: YamlConfigOptions;
17
19
  }
18
20
  /**
@@ -4,6 +4,7 @@ import { defineJestConfig, jestGlobalIgnores } from "../jest.js";
4
4
  import { defineJsonConfig, jsonGlobalIgnores } from "../json.js";
5
5
  import { definePackageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
6
6
  import { WorkleapPlugin } from "../plugins/workleapPlugin.js";
7
+ import { defineTestingLibraryConfig, testingLibraryGlobalIgnores } from "../testingLibrary.js";
7
8
  import { defineTypeScriptConfig, typescriptGlobalIgnores } from "../typescript.js";
8
9
  import { defineVitestConfig, vitestGlobalIgnores } from "../vitest.js";
9
10
  import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
@@ -20,6 +21,8 @@ import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
20
21
 
21
22
  ;// CONCATENATED MODULE: external "../plugins/workleapPlugin.js"
22
23
 
24
+ ;// CONCATENATED MODULE: external "../testingLibrary.js"
25
+
23
26
  ;// CONCATENATED MODULE: external "../typescript.js"
24
27
 
25
28
  ;// CONCATENATED MODULE: external "../vitest.js"
@@ -36,21 +39,24 @@ import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
36
39
 
37
40
 
38
41
 
42
+
39
43
  /**
40
44
  * @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
45
  * @param options An optional object of options for the ESlint core and plugins rules.
42
46
  */ function defineTypeScriptLibraryConfig(tsconfigRootDir, options = {}) {
43
- const { testFramework = "vitest", core, jest, json, packageJson, typescript, vitest, yaml } = options;
47
+ const { testFramework = "vitest", core, jest, json, packageJson, testingLibrary, typescript, vitest, yaml } = options;
44
48
  return defineConfig([
45
49
  // node_modules folder is ignored by default.
46
50
  globalIgnores([
47
51
  "dist",
48
52
  "**/__snapshots__/*",
53
+ ".playwright",
49
54
  ".turbo",
50
55
  ...coreGlobalIgnores,
51
56
  ...jestGlobalIgnores,
52
57
  ...jsonGlobalIgnores,
53
58
  ...packageJsonGlobalIgnores,
59
+ ...testingLibraryGlobalIgnores,
54
60
  ...typescriptGlobalIgnores,
55
61
  ...vitestGlobalIgnores,
56
62
  ...yamlGlobalIgnores
@@ -62,6 +68,7 @@ import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
62
68
  }),
63
69
  ...defineJsonConfig(json),
64
70
  ...definePackageJsonConfig(packageJson),
71
+ ...defineTestingLibraryConfig(testingLibrary),
65
72
  ...defineTypeScriptConfig(tsconfigRootDir, typescript),
66
73
  // Temporary fix until the vitest plugin support defineConfig and the types are fixed.
67
74
  ...defineVitestConfig({
@@ -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 { 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"}
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 { 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 DefineTypeScriptLibraryConfigOptions {\n testFramework?: \"vitest\" | \"jest\";\n core?: CoreConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n packageJson?: PackageJsonConfigOptions;\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 defineTypeScriptLibraryConfig(tsconfigRootDir: string, options: DefineTypeScriptLibraryConfigOptions = {}) {\n const {\n testFramework = \"vitest\",\n core,\n jest,\n json,\n packageJson,\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 \".playwright\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...packageJsonGlobalIgnores,\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 ...definePackageJsonConfig(packageJson),\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","definePackageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","defineTestingLibraryConfig","testingLibraryGlobalIgnores","defineTypeScriptConfig","typescriptGlobalIgnores","defineVitestConfig","vitestGlobalIgnores","defineYamlConfig","yamlGlobalIgnores","defineTypeScriptLibraryConfig","tsconfigRootDir","options","testFramework","core","jest","json","packageJson","testingLibrary","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AAC6B;AACA;AACL;AACiC;AACvD;AACmE;AAChB;AAChB;AACR;AAczF;;;CAGC,GACM,SAASmB,8BAA8BC,eAAuB,EAAEC,UAAgD,CAAC,CAAC;IACrH,MAAM,EACFC,gBAAgB,QAAQ,EACxBC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,WAAW,EACXC,cAAc,EACdC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGT;IAEJ,OAAOrB,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;YACA;YACA;eACGC,iBAAiBA;eACjBG,iBAAiBA;eACjBE,iBAAiBA;eACjBE,wBAAwBA;eACxBG,2BAA2BA;eAC3BE,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACEf,gBAAgBA,CAACoB;WACjBnB,gBAAgBA,CAAC;YAChB,GAAGoB,IAAI;YACP,SAASA,MAAM,WAAWF,kBAAkB;QAChD;WACGhB,gBAAgBA,CAACmB;WACjBjB,uBAAuBA,CAACkB;WACxBf,0BAA0BA,CAACgB;WAC3Bd,sBAAsBA,CAACO,iBAAiBQ;QAC3C,sFAAsF;WAClFb,kBAAkBA,CAAC;YACnB,GAAGc,MAAM;YACT,SAASA,QAAQ,WAAWP,kBAAkB;QAElD;WACGL,gBAAgBA,CAACa;QACpB;YACI,SAAS;gBACL,aAAapB,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL"}
@@ -62,6 +62,7 @@ import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
62
62
  globalIgnores([
63
63
  "dist",
64
64
  "**/__snapshots__/*",
65
+ ".playwright",
65
66
  ".turbo",
66
67
  ...coreGlobalIgnores,
67
68
  ...jestGlobalIgnores,
@@ -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 { 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"}
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 \".playwright\",\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;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"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugins/strictCssModulesNames.js","sources":["webpack://@workleap/eslint-configs/./src/plugins/strictCssModulesNames.ts"],"sourcesContent":["import type { Rule } from \"eslint\";\nimport type ESTree from \"estree\";\nimport { basename, parse, sep } from \"path\";\n\nexport const sanitizePath = (filePath: string) => {\n return filePath.replace(/\\//g, sep).trim();\n};\n\nexport const splitPath = (filePath: string) => {\n return sanitizePath(filePath).split(sep);\n};\n\nexport function getFilePath(context: Rule.RuleContext) {\n return sanitizePath(context.getFilename());\n}\n\nexport function getFileName(context: Rule.RuleContext) {\n return basename(getFilePath(context));\n}\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"CSS Modules should have the same name as a component and located in the same folder\",\n category: \"Strict\",\n recommended: false,\n url: \"https://github.com/workleap/wl-web-configs/blob/main/packages/eslint-plugin/docs/rules/strict-css-modules-names.md\"\n }\n },\n create: function (context) {\n const parsedPath = parse(getFileName(context));\n\n const getNodeSource = (node: ESTree.ImportDeclaration) => {\n return sanitizePath(node.source != null ? node.source.value as string : \"\");\n };\n\n const isCssModule = (source: string) => {\n return source.endsWith(\".module.css\");\n };\n\n const isStylesheetInSameFolder = (source: string) => {\n return splitPath(source).length <= 2; // ./myImage.svg\n };\n\n return {\n ImportDeclaration: function (node) {\n const importSource = getNodeSource(node);\n\n if (isCssModule(importSource)) {\n const validCssFilename = `${parsedPath.name}.module.css`;\n\n if (!isStylesheetInSameFolder(importSource)) {\n // ./myImage.svg\n context.report({\n node,\n message: `CSS Modules should be associated to one component and located in the same folder ./${validCssFilename}. If the module is already used by another component, create a new one.`\n });\n } else {\n const validCssPath = `.${sep}${validCssFilename}`;\n const isNamingValid = importSource === validCssPath;\n if (!isNamingValid) {\n context.report({\n node,\n message: `CSS Modules should be associated to one component and should be named ./${validCssFilename}. If the module is already used by another component, create a new one.`\n });\n }\n }\n }\n }\n };\n }\n};\n\nexport { rule as strictCssModulesNamesRule };\n"],"names":["basename","parse","sep","sanitizePath","filePath","splitPath","getFilePath","context","getFileName","rule","parsedPath","getNodeSource","node","isCssModule","source","isStylesheetInSameFolder","importSource","validCssFilename","validCssPath","isNamingValid","strictCssModulesNamesRule"],"mappings":";;;;;AAE4C;AAErC,MAAMG,eAAe,CAACC;IACzB,OAAOA,SAAS,OAAO,CAAC,OAAOF,GAAGA,EAAE,IAAI;AAC5C,EAAE;AAEK,MAAMG,YAAY,CAACD;IACtB,OAAOD,aAAaC,UAAU,KAAK,CAACF,GAAGA;AAC3C,EAAE;AAEK,SAASI,YAAYC,OAAyB;IACjD,OAAOJ,aAAaI,QAAQ,WAAW;AAC3C;AAEO,SAASC,YAAYD,OAAyB;IACjD,OAAOP,QAAQA,CAACM,YAAYC;AAChC;AAEA,MAAME,OAAwB;IAC1B,MAAM;QACF,MAAM;QACN,MAAM;YACF,aAAa;YACb,UAAU;YACV,aAAa;YACb,KAAK;QACT;IACJ;IACA,QAAQ,SAAUF,OAAO;QACrB,MAAMG,aAAaT,KAAKA,CAACO,YAAYD;QAErC,MAAMI,gBAAgB,CAACC;YACnB,OAAOT,aAAaS,KAAK,MAAM,IAAI,OAAOA,KAAK,MAAM,CAAC,KAAK,GAAa;QAC5E;QAEA,MAAMC,cAAc,CAACC;YACjB,OAAOA,OAAO,QAAQ,CAAC;QAC3B;QAEA,MAAMC,2BAA2B,CAACD;YAC9B,OAAOT,UAAUS,QAAQ,MAAM,IAAI,GAAG,gBAAgB;QAC1D;QAEA,OAAO;YACH,mBAAmB,SAAUF,IAAI;gBAC7B,MAAMI,eAAeL,cAAcC;gBAEnC,IAAIC,YAAYG,eAAe;oBAC3B,MAAMC,mBAAmB,GAAGP,WAAW,IAAI,CAAC,WAAW,CAAC;oBAExD,IAAI,CAACK,yBAAyBC,eAAe;wBACzC,gBAAgB;wBAChBT,QAAQ,MAAM,CAAC;4BACXK;4BACA,SAAS,CAAC,mFAAmF,EAAEK,iBAAiB,uEAAuE,CAAC;wBAC5L;oBACJ,OAAO;wBACH,MAAMC,eAAe,CAAC,CAAC,EAAEhB,GAAGA,GAAGe,kBAAkB;wBACjD,MAAME,gBAAgBH,iBAAiBE;wBACvC,IAAI,CAACC,eAAe;4BAChBZ,QAAQ,MAAM,CAAC;gCACXK;gCACA,SAAS,CAAC,wEAAwE,EAAEK,iBAAiB,uEAAuE,CAAC;4BACjL;wBACJ;oBACJ;gBACJ;YACJ;QACJ;IACJ;AACJ;AAE6C"}
1
+ {"version":3,"file":"plugins/strictCssModulesNames.js","sources":["webpack://@workleap/eslint-configs/./src/plugins/strictCssModulesNames.ts"],"sourcesContent":["import type { Rule } from \"eslint\";\nimport type ESTree from \"estree\";\nimport { basename, parse, sep } from \"path\";\n\nexport const sanitizePath = (filePath: string) => {\n return filePath.replace(/\\//g, sep).trim();\n};\n\nexport const splitPath = (filePath: string) => {\n return sanitizePath(filePath).split(sep);\n};\n\nexport function getFilePath(context: Rule.RuleContext) {\n return sanitizePath(context.getFilename());\n}\n\nexport function getFileName(context: Rule.RuleContext) {\n return basename(getFilePath(context));\n}\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"CSS Modules should have the same name as a component and located in the same folder\",\n category: \"Strict\",\n recommended: false,\n url: \"https://github.com/workleap/wl-web-configs/blob/main/packages/eslint-plugin/docs/rules/strict-css-modules-names.md\"\n }\n },\n create: function(context) {\n const parsedPath = parse(getFileName(context));\n\n const getNodeSource = (node: ESTree.ImportDeclaration) => {\n return sanitizePath(node.source != null ? node.source.value as string : \"\");\n };\n\n const isCssModule = (source: string) => {\n return source.endsWith(\".module.css\");\n };\n\n const isStylesheetInSameFolder = (source: string) => {\n return splitPath(source).length <= 2; // ./myImage.svg\n };\n\n return {\n ImportDeclaration: function(node) {\n const importSource = getNodeSource(node);\n\n if (isCssModule(importSource)) {\n const validCssFilename = `${parsedPath.name}.module.css`;\n\n if (!isStylesheetInSameFolder(importSource)) {\n // ./myImage.svg\n context.report({\n node,\n message: `CSS Modules should be associated to one component and located in the same folder ./${validCssFilename}. If the module is already used by another component, create a new one.`\n });\n } else {\n const validCssPath = `.${sep}${validCssFilename}`;\n const isNamingValid = importSource === validCssPath;\n if (!isNamingValid) {\n context.report({\n node,\n message: `CSS Modules should be associated to one component and should be named ./${validCssFilename}. If the module is already used by another component, create a new one.`\n });\n }\n }\n }\n }\n };\n }\n};\n\nexport { rule as strictCssModulesNamesRule };\n"],"names":["basename","parse","sep","sanitizePath","filePath","splitPath","getFilePath","context","getFileName","rule","parsedPath","getNodeSource","node","isCssModule","source","isStylesheetInSameFolder","importSource","validCssFilename","validCssPath","isNamingValid","strictCssModulesNamesRule"],"mappings":";;;;;AAE4C;AAErC,MAAMG,eAAe,CAACC;IACzB,OAAOA,SAAS,OAAO,CAAC,OAAOF,GAAGA,EAAE,IAAI;AAC5C,EAAE;AAEK,MAAMG,YAAY,CAACD;IACtB,OAAOD,aAAaC,UAAU,KAAK,CAACF,GAAGA;AAC3C,EAAE;AAEK,SAASI,YAAYC,OAAyB;IACjD,OAAOJ,aAAaI,QAAQ,WAAW;AAC3C;AAEO,SAASC,YAAYD,OAAyB;IACjD,OAAOP,QAAQA,CAACM,YAAYC;AAChC;AAEA,MAAME,OAAwB;IAC1B,MAAM;QACF,MAAM;QACN,MAAM;YACF,aAAa;YACb,UAAU;YACV,aAAa;YACb,KAAK;QACT;IACJ;IACA,QAAQ,SAASF,OAAO;QACpB,MAAMG,aAAaT,KAAKA,CAACO,YAAYD;QAErC,MAAMI,gBAAgB,CAACC;YACnB,OAAOT,aAAaS,KAAK,MAAM,IAAI,OAAOA,KAAK,MAAM,CAAC,KAAK,GAAa;QAC5E;QAEA,MAAMC,cAAc,CAACC;YACjB,OAAOA,OAAO,QAAQ,CAAC;QAC3B;QAEA,MAAMC,2BAA2B,CAACD;YAC9B,OAAOT,UAAUS,QAAQ,MAAM,IAAI,GAAG,gBAAgB;QAC1D;QAEA,OAAO;YACH,mBAAmB,SAASF,IAAI;gBAC5B,MAAMI,eAAeL,cAAcC;gBAEnC,IAAIC,YAAYG,eAAe;oBAC3B,MAAMC,mBAAmB,GAAGP,WAAW,IAAI,CAAC,WAAW,CAAC;oBAExD,IAAI,CAACK,yBAAyBC,eAAe;wBACzC,gBAAgB;wBAChBT,QAAQ,MAAM,CAAC;4BACXK;4BACA,SAAS,CAAC,mFAAmF,EAAEK,iBAAiB,uEAAuE,CAAC;wBAC5L;oBACJ,OAAO;wBACH,MAAMC,eAAe,CAAC,CAAC,EAAEhB,GAAGA,GAAGe,kBAAkB;wBACjD,MAAME,gBAAgBH,iBAAiBE;wBACvC,IAAI,CAACC,eAAe;4BAChBZ,QAAQ,MAAM,CAAC;gCACXK;gCACA,SAAS,CAAC,wEAAwE,EAAEK,iBAAiB,uEAAuE,CAAC;4BACjL;wBACJ;oBACJ;gBACJ;YACJ;QACJ;IACJ;AACJ;AAE6C"}
@@ -169,7 +169,7 @@ function defineTypeScriptConfig(tsconfigRootDir, options = {}) {
169
169
  "@stylistic/space-before-function-paren": [
170
170
  "warn",
171
171
  {
172
- anonymous: "always",
172
+ anonymous: "never",
173
173
  named: "never",
174
174
  asyncArrow: "always",
175
175
  catch: "never"
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.js","sources":["webpack://@workleap/eslint-configs/./src/typescript.ts"],"sourcesContent":["import js from \"@eslint/js\";\nimport stylisticPlugin from \"@stylistic/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport tseslint from \"typescript-eslint\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface TypeScriptConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const typescriptGlobalIgnores = [];\n\nexport function defineTypeScriptConfig(tsconfigRootDir: string, options: TypeScriptConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/typescript\",\n files: [\n \"**/*.{ts,tsx}\"\n ],\n plugins: {\n \"@stylistic\": stylisticPlugin\n },\n extends: [\n js.configs.recommended,\n tseslint.configs.recommendedTypeChecked,\n tseslint.configs.stylisticTypeCheckedOnly,\n stylisticPlugin.configs.customize({\n braceStyle: \"1tbs\",\n commaDangle: \"never\",\n jsx: false,\n quotes: \"double\",\n semi: true,\n severity: \"warn\"\n })\n ],\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n // Rely on TypeScript's project service to automatically discover the \"tsconfig.json\" file\n // within the boundaries of \"tsconfigRootDir\".\n projectService: true,\n tsconfigRootDir\n }\n },\n rules: {\n // ESLint core rules overrides\n \"dot-notation\": \"off\",\n \"indent\": \"off\",\n \"no-dupe-class-members\": \"off\",\n \"no-empty-function\": \"off\",\n \"no-loop-func\": \"off\",\n \"no-shadow\": \"off\",\n \"no-unused-expressions\": \"off\",\n \"no-use-before-define\": \"off\",\n \"no-useless-constructor\": \"off\",\n \"object-curly-spacing\": \"off\",\n \"quotes\": \"off\",\n \"semi\": \"off\",\n\n // ESlint deprecated core rules\n \"arrow-parens\": \"off\",\n \"comma-dangle\": \"off\",\n\n // @typescript-eslint recommended rules overrides\n \"@typescript-eslint/dot-notation\": \"off\",\n \"@typescript-eslint/no-base-to-string\": \"off\",\n \"@typescript-eslint/no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\"\n }\n ],\n \"@typescript-eslint/no-floating-promises\": \"off\",\n // This rule should be enabled but has several options that need to be investigated.\n \"@typescript-eslint/no-misused-promises\": \"off\",\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\n \"@typescript-eslint/no-unsafe-argument\": \"off\",\n \"@typescript-eslint/no-unsafe-assignment\": \"off\",\n \"@typescript-eslint/no-unsafe-call\": \"off\",\n \"@typescript-eslint/no-unsafe-member-access\": \"off\",\n \"@typescript-eslint/no-unsafe-return\": \"off\",\n \"@typescript-eslint/only-throw-error\": \"off\",\n \"@typescript-eslint/prefer-nullish-coalescing\": \"off\",\n \"@typescript-eslint/restrict-template-expressions\": \"off\",\n // This rule should be enabled but it's strangely causing issues with common React Aria patterns\n // when destructuring an object literal returned by a hook like \"useFilter\".\n \"@typescript-eslint/unbound-method\": \"off\",\n\n // @stylistic recommend rules overrides\n \"@stylistic/arrow-parens\": [\n \"warn\",\n \"as-needed\",\n {\n requireForBlockBody: false\n }\n ],\n \"@stylistic/indent\": [\n \"warn\",\n 4,\n {\n SwitchCase: 1,\n CallExpression: { arguments: \"first\" }\n }\n ],\n \"@stylistic/indent-binary-ops\": [\"warn\", 4],\n \"@stylistic/member-delimiter-style\": [\n \"warn\",\n {\n multiline: {\n delimiter: \"semi\"\n },\n singleline: {\n delimiter: \"semi\"\n }\n }\n ],\n \"@stylistic/multiline-ternary\": \"off\",\n \"@stylistic/no-mixed-operators\": [\n \"warn\",\n {\n groups: [\n [\"&\", \"|\", \"^\", \"~\", \"<<\", \">>\", \">>>\"],\n [\"==\", \"!=\", \"===\", \"!==\", \">\", \">=\", \"<\", \"<=\"],\n [\"&&\", \"||\"],\n [\"in\", \"instanceof\"]\n ],\n allowSamePrecedence: false\n }\n ],\n \"@stylistic/no-multiple-empty-lines\": [\n \"warn\",\n {\n // View https://eslint.style/rules/eol-last.\n max: 1\n }\n ],\n \"@stylistic/operator-linebreak\": \"off\",\n \"@stylistic/space-before-function-paren\": [\n \"warn\",\n {\n anonymous: \"always\",\n named: \"never\",\n asyncArrow: \"always\",\n catch: \"never\"\n }\n ],\n \"@stylistic/spaced-comment\": \"off\",\n // Should be the default but somehow it's not enforced if it's not explicitly specified.\n \"@stylistic/quote-props\": \"off\",\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["js","stylisticPlugin","tseslint","typescriptGlobalIgnores","defineTypeScriptConfig","tsconfigRootDir","options","rules","config"],"mappings":";;;;;;;;;;;AAA4B;AAC2B;AAEd;AAOlC,MAAMG,0BAA0B,EAAE,CAAC;AAEnC,SAASC,uBAAuBC,eAAuB,EAAEC,UAAmC,CAAC,CAAC;IACjG,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACL,cAAcP,aAAeA;YACjC;YACA,SAAS;gBACLD,sBAAsB;gBACtBE,gDAAuC;gBACvCA,kDAAyC;gBACzCD,+BAAiC,CAAC;oBAC9B,YAAY;oBACZ,aAAa;oBACb,KAAK;oBACL,QAAQ;oBACR,MAAM;oBACN,UAAU;gBACd;aACH;YACD,iBAAiB;gBACb,QAAQC,wBAAe;gBACvB,eAAe;oBACX,0FAA0F;oBAC1F,8CAA8C;oBAC9C,gBAAgB;oBAChBG;gBACJ;YACJ;YACA,OAAO;gBACH,8BAA8B;gBAC9B,gBAAgB;gBAChB,UAAU;gBACV,yBAAyB;gBACzB,qBAAqB;gBACrB,gBAAgB;gBAChB,aAAa;gBACb,yBAAyB;gBACzB,wBAAwB;gBACxB,0BAA0B;gBAC1B,wBAAwB;gBACxB,UAAU;gBACV,QAAQ;gBAER,+BAA+B;gBAC/B,gBAAgB;gBAChB,gBAAgB;gBAEhB,iDAAiD;gBACjD,mCAAmC;gBACnC,wCAAwC;gBACxC,wCAAwC;gBACxC,2CAA2C;oBACvC;oBACA;wBACI,iBAAiB;wBACjB,kBAAkB;oBACtB;iBACH;gBACD,2CAA2C;gBAC3C,oFAAoF;gBACpF,0CAA0C;gBAC1C,4CAA4C;gBAC5C,yCAAyC;gBACzC,2CAA2C;gBAC3C,qCAAqC;gBACrC,8CAA8C;gBAC9C,uCAAuC;gBACvC,uCAAuC;gBACvC,gDAAgD;gBAChD,oDAAoD;gBACpD,gGAAgG;gBAChG,4EAA4E;gBAC5E,qCAAqC;gBAErC,uCAAuC;gBACvC,2BAA2B;oBACvB;oBACA;oBACA;wBACI,qBAAqB;oBACzB;iBACH;gBACD,qBAAqB;oBACjB;oBACA;oBACA;wBACI,YAAY;wBACZ,gBAAgB;4BAAE,WAAW;wBAAQ;oBACzC;iBACH;gBACD,gCAAgC;oBAAC;oBAAQ;iBAAE;gBAC3C,qCAAqC;oBACjC;oBACA;wBACI,WAAW;4BACP,WAAW;wBACf;wBACA,YAAY;4BACR,WAAW;wBACf;oBACJ;iBACH;gBACD,gCAAgC;gBAChC,iCAAiC;oBAC7B;oBACA;wBACI,QAAQ;4BACJ;gCAAC;gCAAK;gCAAK;gCAAK;gCAAK;gCAAM;gCAAM;6BAAM;4BACvC;gCAAC;gCAAM;gCAAM;gCAAO;gCAAO;gCAAK;gCAAM;gCAAK;6BAAK;4BAChD;gCAAC;gCAAM;6BAAK;4BACZ;gCAAC;gCAAM;6BAAa;yBACvB;wBACD,qBAAqB;oBACzB;iBACH;gBACD,sCAAsC;oBAClC;oBACA;wBACI,4CAA4C;wBAC5C,KAAK;oBACT;iBACH;gBACD,iCAAiC;gBACjC,0CAA0C;oBACtC;oBACA;wBACI,WAAW;wBACX,OAAO;wBACP,YAAY;wBACZ,OAAO;oBACX;iBACH;gBACD,6BAA6B;gBAC7B,wFAAwF;gBACxF,0BAA0B;gBAE1B,+DAA+D;gBAC/D,GAAGE,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
1
+ {"version":3,"file":"typescript.js","sources":["webpack://@workleap/eslint-configs/./src/typescript.ts"],"sourcesContent":["import js from \"@eslint/js\";\nimport stylisticPlugin from \"@stylistic/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport tseslint from \"typescript-eslint\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface TypeScriptConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const typescriptGlobalIgnores = [];\n\nexport function defineTypeScriptConfig(tsconfigRootDir: string, options: TypeScriptConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/typescript\",\n files: [\n \"**/*.{ts,tsx}\"\n ],\n plugins: {\n \"@stylistic\": stylisticPlugin\n },\n extends: [\n js.configs.recommended,\n tseslint.configs.recommendedTypeChecked,\n tseslint.configs.stylisticTypeCheckedOnly,\n stylisticPlugin.configs.customize({\n braceStyle: \"1tbs\",\n commaDangle: \"never\",\n jsx: false,\n quotes: \"double\",\n semi: true,\n severity: \"warn\"\n })\n ],\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n // Rely on TypeScript's project service to automatically discover the \"tsconfig.json\" file\n // within the boundaries of \"tsconfigRootDir\".\n projectService: true,\n tsconfigRootDir\n }\n },\n rules: {\n // ESLint core rules overrides\n \"dot-notation\": \"off\",\n \"indent\": \"off\",\n \"no-dupe-class-members\": \"off\",\n \"no-empty-function\": \"off\",\n \"no-loop-func\": \"off\",\n \"no-shadow\": \"off\",\n \"no-unused-expressions\": \"off\",\n \"no-use-before-define\": \"off\",\n \"no-useless-constructor\": \"off\",\n \"object-curly-spacing\": \"off\",\n \"quotes\": \"off\",\n \"semi\": \"off\",\n\n // ESlint deprecated core rules\n \"arrow-parens\": \"off\",\n \"comma-dangle\": \"off\",\n\n // @typescript-eslint recommended rules overrides\n \"@typescript-eslint/dot-notation\": \"off\",\n \"@typescript-eslint/no-base-to-string\": \"off\",\n \"@typescript-eslint/no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\"\n }\n ],\n \"@typescript-eslint/no-floating-promises\": \"off\",\n // This rule should be enabled but has several options that need to be investigated.\n \"@typescript-eslint/no-misused-promises\": \"off\",\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\n \"@typescript-eslint/no-unsafe-argument\": \"off\",\n \"@typescript-eslint/no-unsafe-assignment\": \"off\",\n \"@typescript-eslint/no-unsafe-call\": \"off\",\n \"@typescript-eslint/no-unsafe-member-access\": \"off\",\n \"@typescript-eslint/no-unsafe-return\": \"off\",\n \"@typescript-eslint/only-throw-error\": \"off\",\n \"@typescript-eslint/prefer-nullish-coalescing\": \"off\",\n \"@typescript-eslint/restrict-template-expressions\": \"off\",\n // This rule should be enabled but it's strangely causing issues with common React Aria patterns\n // when destructuring an object literal returned by a hook like \"useFilter\".\n \"@typescript-eslint/unbound-method\": \"off\",\n\n // @stylistic recommend rules overrides\n \"@stylistic/arrow-parens\": [\n \"warn\",\n \"as-needed\",\n {\n requireForBlockBody: false\n }\n ],\n \"@stylistic/indent\": [\n \"warn\",\n 4,\n {\n SwitchCase: 1,\n CallExpression: { arguments: \"first\" }\n }\n ],\n \"@stylistic/indent-binary-ops\": [\"warn\", 4],\n \"@stylistic/member-delimiter-style\": [\n \"warn\",\n {\n multiline: {\n delimiter: \"semi\"\n },\n singleline: {\n delimiter: \"semi\"\n }\n }\n ],\n \"@stylistic/multiline-ternary\": \"off\",\n \"@stylistic/no-mixed-operators\": [\n \"warn\",\n {\n groups: [\n [\"&\", \"|\", \"^\", \"~\", \"<<\", \">>\", \">>>\"],\n [\"==\", \"!=\", \"===\", \"!==\", \">\", \">=\", \"<\", \"<=\"],\n [\"&&\", \"||\"],\n [\"in\", \"instanceof\"]\n ],\n allowSamePrecedence: false\n }\n ],\n \"@stylistic/no-multiple-empty-lines\": [\n \"warn\",\n {\n // View https://eslint.style/rules/eol-last.\n max: 1\n }\n ],\n \"@stylistic/operator-linebreak\": \"off\",\n \"@stylistic/space-before-function-paren\": [\n \"warn\",\n {\n anonymous: \"never\",\n named: \"never\",\n asyncArrow: \"always\",\n catch: \"never\"\n }\n ],\n \"@stylistic/spaced-comment\": \"off\",\n // Should be the default but somehow it's not enforced if it's not explicitly specified.\n \"@stylistic/quote-props\": \"off\",\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["js","stylisticPlugin","tseslint","typescriptGlobalIgnores","defineTypeScriptConfig","tsconfigRootDir","options","rules","config"],"mappings":";;;;;;;;;;;AAA4B;AAC2B;AAEd;AAOlC,MAAMG,0BAA0B,EAAE,CAAC;AAEnC,SAASC,uBAAuBC,eAAuB,EAAEC,UAAmC,CAAC,CAAC;IACjG,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACL,cAAcP,aAAeA;YACjC;YACA,SAAS;gBACLD,sBAAsB;gBACtBE,gDAAuC;gBACvCA,kDAAyC;gBACzCD,+BAAiC,CAAC;oBAC9B,YAAY;oBACZ,aAAa;oBACb,KAAK;oBACL,QAAQ;oBACR,MAAM;oBACN,UAAU;gBACd;aACH;YACD,iBAAiB;gBACb,QAAQC,wBAAe;gBACvB,eAAe;oBACX,0FAA0F;oBAC1F,8CAA8C;oBAC9C,gBAAgB;oBAChBG;gBACJ;YACJ;YACA,OAAO;gBACH,8BAA8B;gBAC9B,gBAAgB;gBAChB,UAAU;gBACV,yBAAyB;gBACzB,qBAAqB;gBACrB,gBAAgB;gBAChB,aAAa;gBACb,yBAAyB;gBACzB,wBAAwB;gBACxB,0BAA0B;gBAC1B,wBAAwB;gBACxB,UAAU;gBACV,QAAQ;gBAER,+BAA+B;gBAC/B,gBAAgB;gBAChB,gBAAgB;gBAEhB,iDAAiD;gBACjD,mCAAmC;gBACnC,wCAAwC;gBACxC,wCAAwC;gBACxC,2CAA2C;oBACvC;oBACA;wBACI,iBAAiB;wBACjB,kBAAkB;oBACtB;iBACH;gBACD,2CAA2C;gBAC3C,oFAAoF;gBACpF,0CAA0C;gBAC1C,4CAA4C;gBAC5C,yCAAyC;gBACzC,2CAA2C;gBAC3C,qCAAqC;gBACrC,8CAA8C;gBAC9C,uCAAuC;gBACvC,uCAAuC;gBACvC,gDAAgD;gBAChD,oDAAoD;gBACpD,gGAAgG;gBAChG,4EAA4E;gBAC5E,qCAAqC;gBAErC,uCAAuC;gBACvC,2BAA2B;oBACvB;oBACA;oBACA;wBACI,qBAAqB;oBACzB;iBACH;gBACD,qBAAqB;oBACjB;oBACA;oBACA;wBACI,YAAY;wBACZ,gBAAgB;4BAAE,WAAW;wBAAQ;oBACzC;iBACH;gBACD,gCAAgC;oBAAC;oBAAQ;iBAAE;gBAC3C,qCAAqC;oBACjC;oBACA;wBACI,WAAW;4BACP,WAAW;wBACf;wBACA,YAAY;4BACR,WAAW;wBACf;oBACJ;iBACH;gBACD,gCAAgC;gBAChC,iCAAiC;oBAC7B;oBACA;wBACI,QAAQ;4BACJ;gCAAC;gCAAK;gCAAK;gCAAK;gCAAK;gCAAM;gCAAM;6BAAM;4BACvC;gCAAC;gCAAM;gCAAM;gCAAO;gCAAO;gCAAK;gCAAM;gCAAK;6BAAK;4BAChD;gCAAC;gCAAM;6BAAK;4BACZ;gCAAC;gCAAM;6BAAa;yBACvB;wBACD,qBAAqB;oBACzB;iBACH;gBACD,sCAAsC;oBAClC;oBACA;wBACI,4CAA4C;wBAC5C,KAAK;oBACT;iBACH;gBACD,iCAAiC;gBACjC,0CAA0C;oBACtC;oBACA;wBACI,WAAW;wBACX,OAAO;wBACP,YAAY;wBACZ,OAAO;oBACX;iBACH;gBACD,6BAA6B;gBAC7B,wFAAwF;gBACxF,0BAA0B;gBAE1B,+DAA+D;gBAC/D,GAAGE,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.1.1",
5
+ "version": "1.1.3",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
@@ -30,6 +30,7 @@ export function defineMonorepoWorkspaceConfig(tsconfigRootDir: string, options:
30
30
  // node_modules folder is ignored by default.
31
31
  globalIgnores([
32
32
  "dist",
33
+ ".playwright",
33
34
  ".turbo",
34
35
  ...coreGlobalIgnores,
35
36
  ...jsonGlobalIgnores,
@@ -52,6 +52,7 @@ export function defineReactLibraryConfig(tsconfigRootDir: string, options: Defin
52
52
  globalIgnores([
53
53
  "dist",
54
54
  "**/__snapshots__/*",
55
+ ".playwright",
55
56
  ".turbo",
56
57
  ...coreGlobalIgnores,
57
58
  ...jestGlobalIgnores,
@@ -4,6 +4,7 @@ import { defineJestConfig, type JestConfigOptions, jestGlobalIgnores } from "../
4
4
  import { defineJsonConfig, JsonConfigOptions, jsonGlobalIgnores } from "../json.ts";
5
5
  import { definePackageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from "../packageJson.ts";
6
6
  import { WorkleapPlugin } from "../plugins/workleapPlugin.ts";
7
+ import { defineTestingLibraryConfig, type TestingLibraryConfigOptions, testingLibraryGlobalIgnores } from "../testingLibrary.ts";
7
8
  import { defineTypeScriptConfig, type TypeScriptConfigOptions, typescriptGlobalIgnores } from "../typescript.ts";
8
9
  import { defineVitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from "../vitest.ts";
9
10
  import { defineYamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from "../yaml.ts";
@@ -11,11 +12,12 @@ import { defineYamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from "../
11
12
  export interface DefineTypeScriptLibraryConfigOptions {
12
13
  testFramework?: "vitest" | "jest";
13
14
  core?: CoreConfigOptions;
14
- typescript?: TypeScriptConfigOptions;
15
15
  jest?: JestConfigOptions;
16
16
  json?: JsonConfigOptions;
17
- vitest?: VitestConfigOptions;
18
17
  packageJson?: PackageJsonConfigOptions;
18
+ testingLibrary?: TestingLibraryConfigOptions;
19
+ typescript?: TypeScriptConfigOptions;
20
+ vitest?: VitestConfigOptions;
19
21
  yaml?: YamlConfigOptions;
20
22
  }
21
23
 
@@ -30,6 +32,7 @@ export function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options:
30
32
  jest,
31
33
  json,
32
34
  packageJson,
35
+ testingLibrary,
33
36
  typescript,
34
37
  vitest,
35
38
  yaml
@@ -40,11 +43,13 @@ export function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options:
40
43
  globalIgnores([
41
44
  "dist",
42
45
  "**/__snapshots__/*",
46
+ ".playwright",
43
47
  ".turbo",
44
48
  ...coreGlobalIgnores,
45
49
  ...jestGlobalIgnores,
46
50
  ...jsonGlobalIgnores,
47
51
  ...packageJsonGlobalIgnores,
52
+ ...testingLibraryGlobalIgnores,
48
53
  ...typescriptGlobalIgnores,
49
54
  ...vitestGlobalIgnores,
50
55
  ...yamlGlobalIgnores
@@ -56,6 +61,7 @@ export function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options:
56
61
  }),
57
62
  ...defineJsonConfig(json),
58
63
  ...definePackageJsonConfig(packageJson),
64
+ ...defineTestingLibraryConfig(testingLibrary),
59
65
  ...defineTypeScriptConfig(tsconfigRootDir, typescript),
60
66
  // Temporary fix until the vitest plugin support defineConfig and the types are fixed.
61
67
  ...(defineVitestConfig({
@@ -52,6 +52,7 @@ export const defineWebApplicationConfig = (tsconfigRootDir: string, options: Def
52
52
  globalIgnores([
53
53
  "dist",
54
54
  "**/__snapshots__/*",
55
+ ".playwright",
55
56
  ".turbo",
56
57
  ...coreGlobalIgnores,
57
58
  ...jestGlobalIgnores,
@@ -28,7 +28,7 @@ const rule: Rule.RuleModule = {
28
28
  url: "https://github.com/workleap/wl-web-configs/blob/main/packages/eslint-plugin/docs/rules/strict-css-modules-names.md"
29
29
  }
30
30
  },
31
- create: function (context) {
31
+ create: function(context) {
32
32
  const parsedPath = parse(getFileName(context));
33
33
 
34
34
  const getNodeSource = (node: ESTree.ImportDeclaration) => {
@@ -44,7 +44,7 @@ const rule: Rule.RuleModule = {
44
44
  };
45
45
 
46
46
  return {
47
- ImportDeclaration: function (node) {
47
+ ImportDeclaration: function(node) {
48
48
  const importSource = getNodeSource(node);
49
49
 
50
50
  if (isCssModule(importSource)) {
package/src/typescript.ts CHANGED
@@ -143,7 +143,7 @@ export function defineTypeScriptConfig(tsconfigRootDir: string, options: TypeScr
143
143
  "@stylistic/space-before-function-paren": [
144
144
  "warn",
145
145
  {
146
- anonymous: "always",
146
+ anonymous: "never",
147
147
  named: "never",
148
148
  asyncArrow: "always",
149
149
  catch: "never"