@workleap/eslint-configs 1.1.6 → 1.1.8

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.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#341](https://github.com/workleap/wl-web-configs/pull/341) [`af33aef`](https://github.com/workleap/wl-web-configs/commit/af33aefdd46666d3b48fe1f4198dc96ff4002b14) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Do not lint the "mockServiceWorker.js" file in the .storybook folder.
8
+
9
+ ## 1.1.7
10
+
11
+ ### Patch Changes
12
+
13
+ - [#339](https://github.com/workleap/wl-web-configs/pull/339) [`4a85b91`](https://github.com/workleap/wl-web-configs/commit/4a85b9105a02f3fdad19beae1792a5cd096a2e47) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bumped dependency versions.
14
+
3
15
  ## 1.1.6
4
16
 
5
17
  ### Patch Changes
@@ -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 \".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"}
1
+ {"version":3,"file":"by-project-type/defineMonorepoWorkspaceConfig.js","sources":["../../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"}
@@ -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 \".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"}
1
+ {"version":3,"file":"by-project-type/defineReactLibraryConfig.js","sources":["../../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"}
@@ -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 { 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"}
1
+ {"version":3,"file":"by-project-type/defineTypescriptLibraryConfig.js","sources":["../../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"}
@@ -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 \".netlify\",\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;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":["../../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 \".netlify\",\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;YACA;eACGC,iBAAiBA;eACjBG,iBAAiBA;eACjBE,iBAAiBA;eACjBE,oBAAoBA;eACpBE,wBAAwBA;eACxBG,kBAAkBA;eAClBE,sBAAsBA;eACtBE,2BAA2BA;eAC3BE,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACErB,gBAAgBA,CAAC0B;WACjBzB,gBAAgBA,CAAC;YAChB,GAAG0B,IAAI;YACP,SAASA,MAAM,WAAWF,kBAAkB;QAChD;WACGtB,gBAAgBA,CAACyB;WACjBvB,mBAAmBA,CAACwB;WACpBtB,uBAAuBA,CAACuB;WACxBpB,iBAAiBA,CAACqB;WAClBnB,qBAAqBA,CAACoB;WACtBlB,0BAA0BA,CAACmB;WAC3BjB,sBAAsBA,CAACO,iBAAiBW;QAC3C,sFAAsF;WAClFhB,kBAAkBA,CAAC;YACnB,GAAGiB,MAAM;YACT,SAASA,QAAQ,WAAWV,kBAAkB;QAElD;WACGL,gBAAgBA,CAACgB;QACpB;YACI,SAAS;gBACL,aAAa3B,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL,EAAE"}
package/dist/core.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sources":["webpack://@workleap/eslint-configs/./src/core.ts"],"sourcesContent":["import js from \"@eslint/js\";\nimport type { Linter } from \"eslint\";\nimport importPlugin from \"eslint-plugin-import\";\nimport globals from \"globals\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface CoreConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const coreGlobalIgnores = [];\n\nexport function defineCoreConfig(options: CoreConfigOptions = {}) {\n const {\n rules\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/core\",\n files: [\n \"**/*.{js,jsx,ts,tsx,cjs,mjs}\"\n ],\n plugins: {\n js,\n import: importPlugin\n },\n extends: [\n js.configs.recommended\n ],\n languageOptions: {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n globals: {\n ...globals.browser,\n ...globals.es2024,\n ...globals.node,\n ...globals.commonjs\n }\n },\n rules: {\n // Recommended rules overrides\n \"no-cond-assign\": [\"error\", \"except-parens\"],\n \"no-labels\": [\"warn\", { allowLoop: true, allowSwitch: false }],\n \"no-prototype-builtins\": \"off\",\n\n // Possible problems\n \"array-callback-return\": \"error\",\n \"no-self-compare\": \"error\",\n \"no-template-curly-in-string\": \"error\",\n \"no-use-before-define\": [\n \"error\",\n {\n functions: false,\n classes: false,\n variables: false\n }\n ],\n\n // Suggestions\n curly: \"warn\",\n eqeqeq: [\"warn\", \"smart\"],\n \"no-array-constructor\": \"warn\",\n \"no-caller\": \"warn\",\n \"no-eval\": \"warn\",\n \"no-extend-native\": \"warn\",\n \"no-extra-bind\": \"warn\",\n \"no-extra-label\": \"warn\",\n \"no-implied-eval\": \"warn\",\n \"no-iterator\": \"warn\",\n \"no-label-var\": \"warn\",\n \"no-lone-blocks\": \"warn\",\n \"no-loop-func\": \"warn\",\n \"no-multi-str\": \"warn\",\n \"no-new-func\": \"warn\",\n // Deprecated but still no replacement in @stylistic.\n // \"no-new-object\": \"warn\",\n \"no-new-wrappers\": \"warn\",\n \"no-octal-escape\": \"warn\",\n \"no-param-reassign\": \"warn\",\n \"no-restricted-properties\": \"warn\",\n \"no-restricted-globals\": [\"error\"],\n \"no-restricted-syntax\": [\"error\", \"WithStatement\"],\n \"no-script-url\": \"warn\",\n \"no-sequences\": \"warn\",\n \"no-shadow\": \"warn\",\n \"no-throw-literal\": \"warn\",\n \"no-unneeded-ternary\": \"warn\",\n \"no-unused-expressions\": [\n \"error\",\n {\n allowShortCircuit: true,\n allowTernary: true,\n allowTaggedTemplates: true\n }\n ],\n \"no-useless-computed-key\": \"warn\",\n \"no-useless-concat\": \"warn\",\n \"no-useless-constructor\": \"warn\",\n \"no-useless-rename\": [\n \"warn\",\n {\n ignoreDestructuring: false,\n ignoreImport: false,\n ignoreExport: false\n }\n ],\n \"no-var\": \"warn\",\n \"prefer-const\": \"warn\",\n strict: [\"warn\", \"never\"],\n\n // Layout & Formatting\n \"unicode-bom\": [\"warn\", \"never\"],\n\n // https://github.com/import-js/eslint-plugin-import/tree/main/docs/rules\n \"import/newline-after-import\": \"warn\",\n \"import/no-amd\": \"error\",\n \"import/no-duplicates\": \"warn\",\n \"import/no-self-import\": \"error\",\n \"import/no-webpack-loader-syntax\": \"error\",\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["js","importPlugin","globals","coreGlobalIgnores","defineCoreConfig","options","rules","config"],"mappings":";;;;;;;;;;;AAA4B;AAEoB;AAClB;AAOvB,MAAMG,oBAAoB,EAAE,CAAC;AAE7B,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,MAAM,EACFC,KAAK,EACR,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLP,EAAEA,EAAAA,EAAAA;gBACF,QAAQC,oBAAYA;YACxB;YACA,SAAS;gBACLD,sBAAsB;aACzB;YACD,iBAAiB;gBACb,aAAa;gBACb,YAAY;gBACZ,SAAS;oBACL,GAAGE,eAAe;oBAClB,GAAGA,cAAc;oBACjB,GAAGA,YAAY;oBACf,GAAGA,gBAAgB;gBACvB;YACJ;YACA,OAAO;gBACH,8BAA8B;gBAC9B,kBAAkB;oBAAC;oBAAS;iBAAgB;gBAC5C,aAAa;oBAAC;oBAAQ;wBAAE,WAAW;wBAAM,aAAa;oBAAM;iBAAE;gBAC9D,yBAAyB;gBAEzB,oBAAoB;gBACpB,yBAAyB;gBACzB,mBAAmB;gBACnB,+BAA+B;gBAC/B,wBAAwB;oBACpB;oBACA;wBACI,WAAW;wBACX,SAAS;wBACT,WAAW;oBACf;iBACH;gBAED,cAAc;gBACd,OAAO;gBACP,QAAQ;oBAAC;oBAAQ;iBAAQ;gBACzB,wBAAwB;gBACxB,aAAa;gBACb,WAAW;gBACX,oBAAoB;gBACpB,iBAAiB;gBACjB,kBAAkB;gBAClB,mBAAmB;gBACnB,eAAe;gBACf,gBAAgB;gBAChB,kBAAkB;gBAClB,gBAAgB;gBAChB,gBAAgB;gBAChB,eAAe;gBACf,qDAAqD;gBACrD,2BAA2B;gBAC3B,mBAAmB;gBACnB,mBAAmB;gBACnB,qBAAqB;gBACrB,4BAA4B;gBAC5B,yBAAyB;oBAAC;iBAAQ;gBAClC,wBAAwB;oBAAC;oBAAS;iBAAgB;gBAClD,iBAAiB;gBACjB,gBAAgB;gBAChB,aAAa;gBACb,oBAAoB;gBACpB,uBAAuB;gBACvB,yBAAyB;oBACrB;oBACA;wBACI,mBAAmB;wBACnB,cAAc;wBACd,sBAAsB;oBAC1B;iBACH;gBACD,2BAA2B;gBAC3B,qBAAqB;gBACrB,0BAA0B;gBAC1B,qBAAqB;oBACjB;oBACA;wBACI,qBAAqB;wBACrB,cAAc;wBACd,cAAc;oBAClB;iBACH;gBACD,UAAU;gBACV,gBAAgB;gBAChB,QAAQ;oBAAC;oBAAQ;iBAAQ;gBAEzB,sBAAsB;gBACtB,eAAe;oBAAC;oBAAQ;iBAAQ;gBAEhC,yEAAyE;gBACzE,+BAA+B;gBAC/B,iBAAiB;gBACjB,wBAAwB;gBACxB,yBAAyB;gBACzB,mCAAmC;gBAEnC,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
1
+ {"version":3,"file":"core.js","sources":["../src/core.ts"],"sourcesContent":["import js from \"@eslint/js\";\nimport type { Linter } from \"eslint\";\nimport importPlugin from \"eslint-plugin-import\";\nimport globals from \"globals\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface CoreConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const coreGlobalIgnores = [];\n\nexport function defineCoreConfig(options: CoreConfigOptions = {}) {\n const {\n rules\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/core\",\n files: [\n \"**/*.{js,jsx,ts,tsx,cjs,mjs}\"\n ],\n plugins: {\n js,\n import: importPlugin\n },\n extends: [\n js.configs.recommended\n ],\n languageOptions: {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n globals: {\n ...globals.browser,\n ...globals.es2024,\n ...globals.node,\n ...globals.commonjs\n }\n },\n rules: {\n // Recommended rules overrides\n \"no-cond-assign\": [\"error\", \"except-parens\"],\n \"no-labels\": [\"warn\", { allowLoop: true, allowSwitch: false }],\n \"no-prototype-builtins\": \"off\",\n\n // Possible problems\n \"array-callback-return\": \"error\",\n \"no-self-compare\": \"error\",\n \"no-template-curly-in-string\": \"error\",\n \"no-use-before-define\": [\n \"error\",\n {\n functions: false,\n classes: false,\n variables: false\n }\n ],\n\n // Suggestions\n curly: \"warn\",\n eqeqeq: [\"warn\", \"smart\"],\n \"no-array-constructor\": \"warn\",\n \"no-caller\": \"warn\",\n \"no-eval\": \"warn\",\n \"no-extend-native\": \"warn\",\n \"no-extra-bind\": \"warn\",\n \"no-extra-label\": \"warn\",\n \"no-implied-eval\": \"warn\",\n \"no-iterator\": \"warn\",\n \"no-label-var\": \"warn\",\n \"no-lone-blocks\": \"warn\",\n \"no-loop-func\": \"warn\",\n \"no-multi-str\": \"warn\",\n \"no-new-func\": \"warn\",\n // Deprecated but still no replacement in @stylistic.\n // \"no-new-object\": \"warn\",\n \"no-new-wrappers\": \"warn\",\n \"no-octal-escape\": \"warn\",\n \"no-param-reassign\": \"warn\",\n \"no-restricted-properties\": \"warn\",\n \"no-restricted-globals\": [\"error\"],\n \"no-restricted-syntax\": [\"error\", \"WithStatement\"],\n \"no-script-url\": \"warn\",\n \"no-sequences\": \"warn\",\n \"no-shadow\": \"warn\",\n \"no-throw-literal\": \"warn\",\n \"no-unneeded-ternary\": \"warn\",\n \"no-unused-expressions\": [\n \"error\",\n {\n allowShortCircuit: true,\n allowTernary: true,\n allowTaggedTemplates: true\n }\n ],\n \"no-useless-computed-key\": \"warn\",\n \"no-useless-concat\": \"warn\",\n \"no-useless-constructor\": \"warn\",\n \"no-useless-rename\": [\n \"warn\",\n {\n ignoreDestructuring: false,\n ignoreImport: false,\n ignoreExport: false\n }\n ],\n \"no-var\": \"warn\",\n \"prefer-const\": \"warn\",\n strict: [\"warn\", \"never\"],\n\n // Layout & Formatting\n \"unicode-bom\": [\"warn\", \"never\"],\n\n // https://github.com/import-js/eslint-plugin-import/tree/main/docs/rules\n \"import/newline-after-import\": \"warn\",\n \"import/no-amd\": \"error\",\n \"import/no-duplicates\": \"warn\",\n \"import/no-self-import\": \"error\",\n \"import/no-webpack-loader-syntax\": \"error\",\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["js","importPlugin","globals","coreGlobalIgnores","defineCoreConfig","options","rules","config"],"mappings":";;;;;;;;;;;AAA4B;AAEoB;AAClB;AAOvB,MAAMG,oBAAoB,EAAE,CAAC;AAE7B,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,MAAM,EACFC,KAAK,EACR,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLP,EAAEA,EAAAA,EAAAA;gBACF,QAAQC,oBAAYA;YACxB;YACA,SAAS;gBACLD,sBAAsB;aACzB;YACD,iBAAiB;gBACb,aAAa;gBACb,YAAY;gBACZ,SAAS;oBACL,GAAGE,eAAe;oBAClB,GAAGA,cAAc;oBACjB,GAAGA,YAAY;oBACf,GAAGA,gBAAgB;gBACvB;YACJ;YACA,OAAO;gBACH,8BAA8B;gBAC9B,kBAAkB;oBAAC;oBAAS;iBAAgB;gBAC5C,aAAa;oBAAC;oBAAQ;wBAAE,WAAW;wBAAM,aAAa;oBAAM;iBAAE;gBAC9D,yBAAyB;gBAEzB,oBAAoB;gBACpB,yBAAyB;gBACzB,mBAAmB;gBACnB,+BAA+B;gBAC/B,wBAAwB;oBACpB;oBACA;wBACI,WAAW;wBACX,SAAS;wBACT,WAAW;oBACf;iBACH;gBAED,cAAc;gBACd,OAAO;gBACP,QAAQ;oBAAC;oBAAQ;iBAAQ;gBACzB,wBAAwB;gBACxB,aAAa;gBACb,WAAW;gBACX,oBAAoB;gBACpB,iBAAiB;gBACjB,kBAAkB;gBAClB,mBAAmB;gBACnB,eAAe;gBACf,gBAAgB;gBAChB,kBAAkB;gBAClB,gBAAgB;gBAChB,gBAAgB;gBAChB,eAAe;gBACf,qDAAqD;gBACrD,2BAA2B;gBAC3B,mBAAmB;gBACnB,mBAAmB;gBACnB,qBAAqB;gBACrB,4BAA4B;gBAC5B,yBAAyB;oBAAC;iBAAQ;gBAClC,wBAAwB;oBAAC;oBAAS;iBAAgB;gBAClD,iBAAiB;gBACjB,gBAAgB;gBAChB,aAAa;gBACb,oBAAoB;gBACpB,uBAAuB;gBACvB,yBAAyB;oBACrB;oBACA;wBACI,mBAAmB;wBACnB,cAAc;wBACd,sBAAsB;oBAC1B;iBACH;gBACD,2BAA2B;gBAC3B,qBAAqB;gBACrB,0BAA0B;gBAC1B,qBAAqB;oBACjB;oBACA;wBACI,qBAAqB;wBACrB,cAAc;wBACd,cAAc;oBAClB;iBACH;gBACD,UAAU;gBACV,gBAAgB;gBAChB,QAAQ;oBAAC;oBAAQ;iBAAQ;gBAEzB,sBAAsB;gBACtB,eAAe;oBAAC;oBAAQ;iBAAQ;gBAEhC,yEAAyE;gBACzE,+BAA+B;gBAC/B,iBAAiB;gBACjB,wBAAwB;gBACxB,yBAAyB;gBACzB,mCAAmC;gBAEnC,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["webpack://@workleap/eslint-configs/./src/index.ts"],"sourcesContent":["export { defineMonorepoWorkspaceConfig, type DefineMonorepoWorkspaceConfigOptions } from \"./by-project-type/defineMonorepoWorkspaceConfig.ts\";\nexport { defineReactLibraryConfig, type DefineReactLibraryConfigOptions } from \"./by-project-type/defineReactLibraryConfig.ts\";\nexport { defineTypeScriptLibraryConfig, type DefineTypeScriptLibraryConfigOptions } from \"./by-project-type/defineTypescriptLibraryConfig.ts\";\nexport { defineWebApplicationConfig, type DefineWebApplicationConfigOptions } from \"./by-project-type/defineWebApplicationConfig.ts\";\nexport { defineCoreConfig, type CoreConfigOptions } from \"./core.ts\";\nexport { defineJestConfig, type JestConfigOptions } from \"./jest.ts\";\nexport { defineJsxAllyConfig, type JsxAllyConfigOptions } from \"./jsxAlly.ts\";\nexport { definePackageJsonConfig, type PackageJsonConfigOptions } from \"./packageJson.ts\";\nexport { defineReactConfig, type ReactConfigOptions } from \"./react.ts\";\nexport { defineStorybookConfig, type StorybookConfigOptions } from \"./storybook.ts\";\nexport { defineTestingLibraryConfig, type TestingLibraryConfigOptions } from \"./testingLibrary.ts\";\nexport type { ConfigWithExtends, ExtendsElement, InfiniteArray, SimpleExtendsElement } from \"./types.ts\";\nexport { defineTypeScriptConfig, type TypeScriptConfigOptions } from \"./typescript.ts\";\nexport { defineVitestConfig, type VitestConfigOptions } from \"./vitest.ts\";\nexport { defineYamlConfig, type YamlConfigOptions } from \"./yaml.ts\";\n\n"],"names":["defineMonorepoWorkspaceConfig","defineReactLibraryConfig","defineTypeScriptLibraryConfig","defineWebApplicationConfig","defineCoreConfig","defineJestConfig","defineJsxAllyConfig","definePackageJsonConfig","defineReactConfig","defineStorybookConfig","defineTestingLibraryConfig","defineTypeScriptConfig","defineVitestConfig","defineYamlConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA8I;AACf;AACe;AACT;AAChE;AACA;AACS;AACY;AAClB;AACY;AACe;AAEZ;AACZ;AACN"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["export { defineMonorepoWorkspaceConfig, type DefineMonorepoWorkspaceConfigOptions } from \"./by-project-type/defineMonorepoWorkspaceConfig.ts\";\nexport { defineReactLibraryConfig, type DefineReactLibraryConfigOptions } from \"./by-project-type/defineReactLibraryConfig.ts\";\nexport { defineTypeScriptLibraryConfig, type DefineTypeScriptLibraryConfigOptions } from \"./by-project-type/defineTypescriptLibraryConfig.ts\";\nexport { defineWebApplicationConfig, type DefineWebApplicationConfigOptions } from \"./by-project-type/defineWebApplicationConfig.ts\";\nexport { defineCoreConfig, type CoreConfigOptions } from \"./core.ts\";\nexport { defineJestConfig, type JestConfigOptions } from \"./jest.ts\";\nexport { defineJsxAllyConfig, type JsxAllyConfigOptions } from \"./jsxAlly.ts\";\nexport { definePackageJsonConfig, type PackageJsonConfigOptions } from \"./packageJson.ts\";\nexport { defineReactConfig, type ReactConfigOptions } from \"./react.ts\";\nexport { defineStorybookConfig, type StorybookConfigOptions } from \"./storybook.ts\";\nexport { defineTestingLibraryConfig, type TestingLibraryConfigOptions } from \"./testingLibrary.ts\";\nexport type { ConfigWithExtends, ExtendsElement, InfiniteArray, SimpleExtendsElement } from \"./types.ts\";\nexport { defineTypeScriptConfig, type TypeScriptConfigOptions } from \"./typescript.ts\";\nexport { defineVitestConfig, type VitestConfigOptions } from \"./vitest.ts\";\nexport { defineYamlConfig, type YamlConfigOptions } from \"./yaml.ts\";\n\n"],"names":["defineMonorepoWorkspaceConfig","defineReactLibraryConfig","defineTypeScriptLibraryConfig","defineWebApplicationConfig","defineCoreConfig","defineJestConfig","defineJsxAllyConfig","definePackageJsonConfig","defineReactConfig","defineStorybookConfig","defineTestingLibraryConfig","defineTypeScriptConfig","defineVitestConfig","defineYamlConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA8I;AACf;AACe;AACT;AAChE;AACA;AACS;AACY;AAClB;AACY;AACe;AAEZ;AACZ;AACN"}
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 enabled?: boolean;\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jestGlobalIgnores = [];\n\nexport function defineJestConfig(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","defineJestConfig","options","enabled","rules","config"],"mappings":";;;;;;;;AAC4C;AACd;AAQvB,MAAME,oBAAoB,EAAE,CAAC;AAE7B,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,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"}
1
+ {"version":3,"file":"jest.js","sources":["../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 defineJestConfig(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","defineJestConfig","options","enabled","rules","config"],"mappings":";;;;;;;;AAC4C;AACd;AAQvB,MAAME,oBAAoB,EAAE,CAAC;AAE7B,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,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/json.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"json.js","sources":["webpack://@workleap/eslint-configs/./src/json.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport jsoncPlugin from \"eslint-plugin-jsonc\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface JsonConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jsonGlobalIgnores = [];\n\nexport function defineJsonConfig(options: JsonConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/json\",\n files: [\n \"**/*.{json,jsonc}\"\n ],\n extends: [\n jsoncPlugin.configs[\"flat/base\"]\n ],\n rules: {\n \"jsonc/indent\": [\"warn\", 4],\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n}\n"],"names":["jsoncPlugin","jsonGlobalIgnores","defineJsonConfig","options","rules","config"],"mappings":";;;;;AAC8C;AAOvC,MAAMC,oBAAoB,EAAE,CAAC;AAE7B,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLL,wCAAgC;aACnC;YACD,OAAO;gBACH,gBAAgB;oBAAC;oBAAQ;iBAAE;gBAC3B,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
1
+ {"version":3,"file":"json.js","sources":["../src/json.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport jsoncPlugin from \"eslint-plugin-jsonc\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface JsonConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jsonGlobalIgnores = [];\n\nexport function defineJsonConfig(options: JsonConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/json\",\n files: [\n \"**/*.{json,jsonc}\"\n ],\n extends: [\n jsoncPlugin.configs[\"flat/base\"]\n ],\n rules: {\n \"jsonc/indent\": [\"warn\", 4],\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n}\n"],"names":["jsoncPlugin","jsonGlobalIgnores","defineJsonConfig","options","rules","config"],"mappings":";;;;;AAC8C;AAOvC,MAAMC,oBAAoB,EAAE,CAAC;AAE7B,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLL,wCAAgC;aACnC;YACD,OAAO;gBACH,gBAAgB;oBAAC;oBAAQ;iBAAE;gBAC3B,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"jsxAlly.js","sources":["webpack://@workleap/eslint-configs/./src/jsxAlly.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport jsxA11yPlugin from \"eslint-plugin-jsx-a11y\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface JsxAllyConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jsxAllyGlobalIgnores = [];\n\nexport function defineJsxAllyConfig(options: JsxAllyConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/jsx-a11y\",\n files: [\n \"**/*.{js,ts,jsx,tsx,cjs,mjs}\"\n ],\n extends: [\n jsxA11yPlugin.flatConfigs.recommended\n ],\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true\n }\n }\n },\n rules: {\n // This rule ensures that all labels have an associated control that they are labeling.\n // However, this rule causes a lot of false positive, since our current implementation of our company's design system\n // does not use the \"for\" attribute in the label element and automatically add it inside Fields.\n // Therefore, we are disabling this rule.\n \"jsx-a11y/label-has-associated-control:\": \"off\",\n // This rule ensures that all media elements have a <track> for captions.\n // Since we don't use captions, we are disabling this rule.\n \"jsx-a11y/media-has-caption\": \"off\",\n // There is a really good article that describes the issues with autoFocus and why it should be avoided:\n // https://brucelawson.co.uk/2009/the-accessibility-of-html-5-autofocus/\n // However, this issue is with screen readers and not with keyboard navigation.\n // In Workleap, we use autoFocus in a lot of places to improve the user experience.\n // Therefore, we are disabling this rule.\n \"jsx-a11y/no-autofocus\": \"off\",\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["jsxA11yPlugin","jsxAllyGlobalIgnores","defineJsxAllyConfig","options","rules","config"],"mappings":";;;;;AACmD;AAO5C,MAAMC,uBAAuB,EAAE,CAAC;AAEhC,SAASC,oBAAoBC,UAAgC,CAAC,CAAC;IAClE,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLL,8CAAqC;aACxC;YACD,iBAAiB;gBACb,eAAe;oBACX,cAAc;wBACV,KAAK;oBACT;gBACJ;YACJ;YACA,OAAO;gBACH,uFAAuF;gBACvF,qHAAqH;gBACrH,gGAAgG;gBAChG,yCAAyC;gBACzC,0CAA0C;gBAC1C,yEAAyE;gBACzE,2DAA2D;gBAC3D,8BAA8B;gBAC9B,wGAAwG;gBACxG,wEAAwE;gBACxE,+EAA+E;gBAC/E,mFAAmF;gBACnF,yCAAyC;gBACzC,yBAAyB;gBACzB,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
1
+ {"version":3,"file":"jsxAlly.js","sources":["../src/jsxAlly.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport jsxA11yPlugin from \"eslint-plugin-jsx-a11y\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface JsxAllyConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jsxAllyGlobalIgnores = [];\n\nexport function defineJsxAllyConfig(options: JsxAllyConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/jsx-a11y\",\n files: [\n \"**/*.{js,ts,jsx,tsx,cjs,mjs}\"\n ],\n extends: [\n jsxA11yPlugin.flatConfigs.recommended\n ],\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true\n }\n }\n },\n rules: {\n // This rule ensures that all labels have an associated control that they are labeling.\n // However, this rule causes a lot of false positive, since our current implementation of our company's design system\n // does not use the \"for\" attribute in the label element and automatically add it inside Fields.\n // Therefore, we are disabling this rule.\n \"jsx-a11y/label-has-associated-control:\": \"off\",\n // This rule ensures that all media elements have a <track> for captions.\n // Since we don't use captions, we are disabling this rule.\n \"jsx-a11y/media-has-caption\": \"off\",\n // There is a really good article that describes the issues with autoFocus and why it should be avoided:\n // https://brucelawson.co.uk/2009/the-accessibility-of-html-5-autofocus/\n // However, this issue is with screen readers and not with keyboard navigation.\n // In Workleap, we use autoFocus in a lot of places to improve the user experience.\n // Therefore, we are disabling this rule.\n \"jsx-a11y/no-autofocus\": \"off\",\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["jsxA11yPlugin","jsxAllyGlobalIgnores","defineJsxAllyConfig","options","rules","config"],"mappings":";;;;;AACmD;AAO5C,MAAMC,uBAAuB,EAAE,CAAC;AAEhC,SAASC,oBAAoBC,UAAgC,CAAC,CAAC;IAClE,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLL,8CAAqC;aACxC;YACD,iBAAiB;gBACb,eAAe;oBACX,cAAc;wBACV,KAAK;oBACT;gBACJ;YACJ;YACA,OAAO;gBACH,uFAAuF;gBACvF,qHAAqH;gBACrH,gGAAgG;gBAChG,yCAAyC;gBACzC,0CAA0C;gBAC1C,yEAAyE;gBACzE,2DAA2D;gBAC3D,8BAA8B;gBAC9B,wGAAwG;gBACxG,wEAAwE;gBACxE,+EAA+E;gBAC/E,mFAAmF;gBACnF,yCAAyC;gBACzC,yBAAyB;gBACzB,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
@@ -34,8 +34,10 @@ function definePackageJsonConfig(options = {}) {
34
34
  // I am not sure why, this rule is triggering errors for valid paths.
35
35
  "package-json/valid-repository-directory": "off",
36
36
  "package-json/valid-scripts": "off",
37
- // Doesn't make sense for our products
37
+ // Doesn't make sense for our products.
38
38
  "package-json/require-license": "off",
39
+ // Not useful when using PNPM and syncpack.
40
+ "package-json/specify-peers-locally": "off",
39
41
  // Positioned last to allow the consumer to override any rules.
40
42
  ...rules
41
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"packageJson.js","sources":["webpack://@workleap/eslint-configs/./src/packageJson.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport packageJsonPlugin from \"eslint-plugin-package-json\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface PackageJsonConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const packageJsonGlobalIgnores = [];\n\nexport function definePackageJsonConfig(options: PackageJsonConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/package-json\",\n files: [\n \"**/package.json\"\n ],\n extends: [\n packageJsonPlugin.configs.recommended\n ],\n rules: {\n \"package-json/order-properties\": \"off\",\n \"package-json/prefer-repository-shorthand\": \"off\",\n \"package-json/sort-collections\": [\n \"warn\",\n [\n // Do not sort \"scripts\".\n \"devDependencies\",\n \"dependencies\",\n \"peerDependencies\",\n \"config\"\n ]\n ],\n // Doesn't support \"workspace:*\" at the moment.\n \"package-json/valid-package-def\": \"off\",\n // I am not sure why, this rule is triggering errors for valid paths.\n \"package-json/valid-repository-directory\": \"off\",\n \"package-json/valid-scripts\": \"off\",\n // Doesn't make sense for our products\n \"package-json/require-license\": \"off\",\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["packageJsonPlugin","packageJsonGlobalIgnores","definePackageJsonConfig","options","rules","config"],"mappings":";;;;;AAC2D;AAOpD,MAAMC,2BAA2B,EAAE,CAAC;AAEpC,SAASC,wBAAwBC,UAAoC,CAAC,CAAC;IAC1E,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLL,8CAAqC;aACxC;YACD,OAAO;gBACH,iCAAiC;gBACjC,4CAA4C;gBAC5C,iCAAiC;oBAC7B;oBACA;wBACI,yBAAyB;wBACzB;wBACA;wBACA;wBACA;qBACH;iBACJ;gBACD,+CAA+C;gBAC/C,kCAAkC;gBAClC,qEAAqE;gBACrE,2CAA2C;gBAC3C,8BAA8B;gBAC9B,sCAAsC;gBACtC,gCAAgC;gBAChC,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
1
+ {"version":3,"file":"packageJson.js","sources":["../src/packageJson.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport packageJsonPlugin from \"eslint-plugin-package-json\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface PackageJsonConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const packageJsonGlobalIgnores = [];\n\nexport function definePackageJsonConfig(options: PackageJsonConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/package-json\",\n files: [\n \"**/package.json\"\n ],\n extends: [\n packageJsonPlugin.configs.recommended\n ],\n rules: {\n \"package-json/order-properties\": \"off\",\n \"package-json/prefer-repository-shorthand\": \"off\",\n \"package-json/sort-collections\": [\n \"warn\",\n [\n // Do not sort \"scripts\".\n \"devDependencies\",\n \"dependencies\",\n \"peerDependencies\",\n \"config\"\n ]\n ],\n // Doesn't support \"workspace:*\" at the moment.\n \"package-json/valid-package-def\": \"off\",\n // I am not sure why, this rule is triggering errors for valid paths.\n \"package-json/valid-repository-directory\": \"off\",\n \"package-json/valid-scripts\": \"off\",\n // Doesn't make sense for our products.\n \"package-json/require-license\": \"off\",\n // Not useful when using PNPM and syncpack.\n \"package-json/specify-peers-locally\": \"off\",\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["packageJsonPlugin","packageJsonGlobalIgnores","definePackageJsonConfig","options","rules","config"],"mappings":";;;;;AAC2D;AAOpD,MAAMC,2BAA2B,EAAE,CAAC;AAEpC,SAASC,wBAAwBC,UAAoC,CAAC,CAAC;IAC1E,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLL,8CAAqC;aACxC;YACD,OAAO;gBACH,iCAAiC;gBACjC,4CAA4C;gBAC5C,iCAAiC;oBAC7B;oBACA;wBACI,yBAAyB;wBACzB;wBACA;wBACA;wBACA;qBACH;iBACJ;gBACD,+CAA+C;gBAC/C,kCAAkC;gBAClC,qEAAqE;gBACrE,2CAA2C;gBAC3C,8BAA8B;gBAC9B,uCAAuC;gBACvC,gCAAgC;gBAChC,2CAA2C;gBAC3C,sCAAsC;gBACtC,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
@@ -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,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"}
1
+ {"version":3,"file":"plugins/strictCssModulesNames.js","sources":["../../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"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugins/workleapPlugin.js","sources":["webpack://@workleap/eslint-configs/./src/plugins/workleapPlugin.ts"],"sourcesContent":["import { strictCssModulesNamesRule } from \"./strictCssModulesNames.ts\";\n\nexport const WorkleapPlugin = {\n rules: {\n \"strict-css-modules-names\": strictCssModulesNamesRule\n }\n};\n"],"names":["strictCssModulesNamesRule","WorkleapPlugin"],"mappings":";;;;;AAAuE;AAEhE,MAAMC,iBAAiB;IAC1B,OAAO;QACH,4BAA4BD,yBAAyBA;IACzD;AACJ,EAAE"}
1
+ {"version":3,"file":"plugins/workleapPlugin.js","sources":["../../src/plugins/workleapPlugin.ts"],"sourcesContent":["import { strictCssModulesNamesRule } from \"./strictCssModulesNames.ts\";\n\nexport const WorkleapPlugin = {\n rules: {\n \"strict-css-modules-names\": strictCssModulesNamesRule\n }\n};\n"],"names":["strictCssModulesNamesRule","WorkleapPlugin"],"mappings":";;;;;AAAuE;AAEhE,MAAMC,iBAAiB;IAC1B,OAAO;QACH,4BAA4BD,yBAAyBA;IACzD;AACJ,EAAE"}
package/dist/react.js CHANGED
@@ -26,7 +26,6 @@ function defineReactConfig(options = {}) {
26
26
  },
27
27
  extends: [
28
28
  eslint_plugin_react.configs.flat.recommended,
29
- // @ts-expect-error the typings are broken and think there's a ".default" to add.
30
29
  eslint_plugin_react_hooks.configs.flat.recommended
31
30
  ],
32
31
  languageOptions: {
package/dist/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sources":["webpack://@workleap/eslint-configs/./src/react.ts"],"sourcesContent":["import stylisticPlugin from \"@stylistic/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport reactPlugin from \"eslint-plugin-react\";\nimport reactHooksPlugin from \"eslint-plugin-react-hooks\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface ReactConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n compiler?: boolean;\n}\n\nexport const reactGlobalIgnores = [];\n\nexport function defineReactConfig(options: ReactConfigOptions = {}) {\n const {\n rules = {},\n compiler = false\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/react\",\n files: [\n \"**/*.[jt]sx\"\n ],\n plugins: {\n \"@stylistic\": stylisticPlugin\n },\n extends: [\n reactPlugin.configs.flat.recommended,\n // @ts-expect-error the typings are broken and think there's a \".default\" to add.\n reactHooksPlugin.configs.flat.recommended\n ],\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true\n }\n }\n },\n settings: {\n react: {\n version: \"detect\"\n }\n },\n rules: {\n // React recommend rules overrides\n \"react/display-name\": \"off\",\n \"react/jsx-key\": \"off\",\n \"react/jsx-no-duplicate-props\": [\n \"warn\",\n {\n ignoreCase: true\n }\n ],\n \"react/jsx-no-undef\": [\n \"warn\",\n {\n allowGlobals: true\n }\n ],\n \"react/no-unescaped-entities\": \"off\",\n \"react/prop-types\": \"off\",\n \"react/react-in-jsx-scope\": \"off\",\n\n // React extra rules\n \"react/button-has-type\": \"warn\",\n \"react/default-props-match-prop-types\": \"warn\",\n \"react/destructuring-assignment\": [\n \"warn\",\n \"always\",\n { ignoreClassFields: true }\n ],\n \"react/forbid-foreign-prop-types\": [\n \"warn\",\n {\n allowInPropTypes: true\n }\n ],\n \"react/jsx-boolean-value\": [\"warn\", \"never\"],\n \"react/jsx-filename-extension\": [\n \"warn\",\n {\n extensions: [\".jsx\", \".tsx\"]\n }\n ],\n \"react/jsx-pascal-case\": [\n \"warn\",\n {\n allowAllCaps: true,\n ignore: []\n }\n ],\n \"react/no-access-state-in-setstate\": \"warn\",\n \"react/no-array-index-key\": \"warn\",\n \"react/no-typos\": \"error\",\n \"react/no-unused-prop-types\": [\n \"warn\",\n {\n customValidators: [],\n skipShapeProps: true\n }\n ],\n \"react/no-unused-state\": \"warn\",\n \"react/style-prop-object\": \"warn\",\n\n // React rules turned off in favor of @stylistic\n \"react/jsx-closing-bracket-location\": \"off\",\n \"react/jsx-closing-tag-location\": \"off\",\n \"react/jsx-curly-brace-presence\": \"off\",\n \"react/jsx-curly-newline\": \"off\",\n \"react/jsx-curly-spacing\": \"off\",\n \"react/jsx-equals-spacing\": \"off\",\n \"react/jsx-first-prop-new-line\": \"off\",\n \"react/jsx-indent-props\": \"off\",\n \"react/jsx-max-props-per-line\": \"off\",\n \"react/jsx-one-expression-per-line\": \"off\",\n \"react/jsx-tag-spacing\": \"off\",\n \"react/jsx-wrap-multilines\": \"off\",\n\n // React hooks recommend rules overrides\n \"react-hooks/set-state-in-effect\": \"off\",\n\n // React hooks \"compiler\" related rules\n ...compiler === false ? {\n \"react-hooks/gating\": \"off\",\n \"react-hooks/incompatible-library\": \"off\",\n \"react-hooks/preserve-manual-memoization\": \"off\",\n \"react-hooks/unsupported-syntax\": \"off\"\n } : {},\n\n // @stylistic rules (cannot use the recommended config\" because it would conflict with the \"typescript\" config rules)\n \"@stylistic/jsx-closing-bracket-location\": \"warn\",\n \"@stylistic/jsx-closing-tag-location\": \"warn\",\n \"@stylistic/jsx-curly-brace-presence\": [\n \"warn\",\n {\n propElementValues: \"always\"\n }\n ],\n \"@stylistic/jsx-curly-newline\": \"warn\",\n \"@stylistic/jsx-curly-spacing\": [\n \"warn\",\n {\n children: true,\n when: \"never\"\n }\n ],\n \"@stylistic/jsx-equals-spacing\": \"warn\",\n \"@stylistic/jsx-first-prop-new-line\": \"warn\",\n \"@stylistic/jsx-function-call-newline\": [\"warn\", \"multiline\"],\n \"@stylistic/jsx-max-props-per-line\": [\n \"warn\",\n {\n maximum: 1,\n when: \"multiline\"\n }\n ],\n \"@stylistic/jsx-quotes\": [\"warn\", \"prefer-double\"],\n \"@stylistic/jsx-tag-spacing\": [\n \"warn\",\n {\n beforeSelfClosing: \"always\"\n }\n ],\n \"@stylistic/jsx-wrap-multilines\": [\n \"warn\",\n {\n arrow: \"parens-new-line\",\n assignment: \"parens-new-line\",\n condition: \"parens-new-line\",\n declaration: \"parens-new-line\",\n logical: \"parens-new-line\",\n prop: \"parens-new-line\",\n propertyValue: \"parens-new-line\",\n return: \"parens-new-line\"\n }\n ],\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["stylisticPlugin","reactPlugin","reactHooksPlugin","reactGlobalIgnores","defineReactConfig","options","rules","compiler","config"],"mappings":";;;;;;;;;;;AAAuD;AAET;AACW;AAQlD,MAAMG,qBAAqB,EAAE,CAAC;AAE9B,SAASC,kBAAkBC,UAA8B,CAAC,CAAC;IAC9D,MAAM,EACFC,QAAQ,CAAC,CAAC,EACVC,WAAW,KAAK,EACnB,GAAGF;IAEJ,MAAMG,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACL,cAAcR,aAAeA;YACjC;YACA,SAAS;gBACLC,4CAAoC;gBACpC,iFAAiF;gBACjFC,kDAAyC;aAC5C;YACD,iBAAiB;gBACb,eAAe;oBACX,cAAc;wBACV,KAAK;oBACT;gBACJ;YACJ;YACA,UAAU;gBACN,OAAO;oBACH,SAAS;gBACb;YACJ;YACA,OAAO;gBACH,kCAAkC;gBAClC,sBAAsB;gBACtB,iBAAiB;gBACjB,gCAAgC;oBAC5B;oBACA;wBACI,YAAY;oBAChB;iBACH;gBACD,sBAAsB;oBAClB;oBACA;wBACI,cAAc;oBAClB;iBACH;gBACD,+BAA+B;gBAC/B,oBAAoB;gBACpB,4BAA4B;gBAE5B,oBAAoB;gBACpB,yBAAyB;gBACzB,wCAAwC;gBACxC,kCAAkC;oBAC9B;oBACA;oBACA;wBAAE,mBAAmB;oBAAK;iBAC7B;gBACD,mCAAmC;oBAC/B;oBACA;wBACI,kBAAkB;oBACtB;iBACH;gBACD,2BAA2B;oBAAC;oBAAQ;iBAAQ;gBAC5C,gCAAgC;oBAC5B;oBACA;wBACI,YAAY;4BAAC;4BAAQ;yBAAO;oBAChC;iBACH;gBACD,yBAAyB;oBACrB;oBACA;wBACI,cAAc;wBACd,QAAQ,EAAE;oBACd;iBACH;gBACD,qCAAqC;gBACrC,4BAA4B;gBAC5B,kBAAkB;gBAClB,8BAA8B;oBAC1B;oBACA;wBACI,kBAAkB,EAAE;wBACpB,gBAAgB;oBACpB;iBACH;gBACD,yBAAyB;gBACzB,2BAA2B;gBAE3B,gDAAgD;gBAChD,sCAAsC;gBACtC,kCAAkC;gBAClC,kCAAkC;gBAClC,2BAA2B;gBAC3B,2BAA2B;gBAC3B,4BAA4B;gBAC5B,iCAAiC;gBACjC,0BAA0B;gBAC1B,gCAAgC;gBAChC,qCAAqC;gBACrC,yBAAyB;gBACzB,6BAA6B;gBAE7B,wCAAwC;gBACxC,mCAAmC;gBAEnC,uCAAuC;gBACvC,GAAGK,aAAa,QAAQ;oBACpB,sBAAsB;oBACtB,oCAAoC;oBACpC,2CAA2C;oBAC3C,kCAAkC;gBACtC,IAAI,CAAC,CAAC;gBAEN,qHAAqH;gBACrH,2CAA2C;gBAC3C,uCAAuC;gBACvC,uCAAuC;oBACnC;oBACA;wBACI,mBAAmB;oBACvB;iBACH;gBACD,gCAAgC;gBAChC,gCAAgC;oBAC5B;oBACA;wBACI,UAAU;wBACV,MAAM;oBACV;iBACH;gBACD,iCAAiC;gBACjC,sCAAsC;gBACtC,wCAAwC;oBAAC;oBAAQ;iBAAY;gBAC7D,qCAAqC;oBACjC;oBACA;wBACI,SAAS;wBACT,MAAM;oBACV;iBACH;gBACD,yBAAyB;oBAAC;oBAAQ;iBAAgB;gBAClD,8BAA8B;oBAC1B;oBACA;wBACI,mBAAmB;oBACvB;iBACH;gBACD,kCAAkC;oBAC9B;oBACA;wBACI,OAAO;wBACP,YAAY;wBACZ,WAAW;wBACX,aAAa;wBACb,SAAS;wBACT,MAAM;wBACN,eAAe;wBACf,QAAQ;oBACZ;iBACH;gBAED,+DAA+D;gBAC/D,GAAGD,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOE;AACX"}
1
+ {"version":3,"file":"react.js","sources":["../src/react.ts"],"sourcesContent":["import stylisticPlugin from \"@stylistic/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport reactPlugin from \"eslint-plugin-react\";\nimport reactHooksPlugin from \"eslint-plugin-react-hooks\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface ReactConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n compiler?: boolean;\n}\n\nexport const reactGlobalIgnores = [];\n\nexport function defineReactConfig(options: ReactConfigOptions = {}) {\n const {\n rules = {},\n compiler = false\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/react\",\n files: [\n \"**/*.[jt]sx\"\n ],\n plugins: {\n \"@stylistic\": stylisticPlugin\n },\n extends: [\n reactPlugin.configs.flat.recommended,\n reactHooksPlugin.configs.flat.recommended\n ],\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true\n }\n }\n },\n settings: {\n react: {\n version: \"detect\"\n }\n },\n rules: {\n // React recommend rules overrides\n \"react/display-name\": \"off\",\n \"react/jsx-key\": \"off\",\n \"react/jsx-no-duplicate-props\": [\n \"warn\",\n {\n ignoreCase: true\n }\n ],\n \"react/jsx-no-undef\": [\n \"warn\",\n {\n allowGlobals: true\n }\n ],\n \"react/no-unescaped-entities\": \"off\",\n \"react/prop-types\": \"off\",\n \"react/react-in-jsx-scope\": \"off\",\n\n // React extra rules\n \"react/button-has-type\": \"warn\",\n \"react/default-props-match-prop-types\": \"warn\",\n \"react/destructuring-assignment\": [\n \"warn\",\n \"always\",\n { ignoreClassFields: true }\n ],\n \"react/forbid-foreign-prop-types\": [\n \"warn\",\n {\n allowInPropTypes: true\n }\n ],\n \"react/jsx-boolean-value\": [\"warn\", \"never\"],\n \"react/jsx-filename-extension\": [\n \"warn\",\n {\n extensions: [\".jsx\", \".tsx\"]\n }\n ],\n \"react/jsx-pascal-case\": [\n \"warn\",\n {\n allowAllCaps: true,\n ignore: []\n }\n ],\n \"react/no-access-state-in-setstate\": \"warn\",\n \"react/no-array-index-key\": \"warn\",\n \"react/no-typos\": \"error\",\n \"react/no-unused-prop-types\": [\n \"warn\",\n {\n customValidators: [],\n skipShapeProps: true\n }\n ],\n \"react/no-unused-state\": \"warn\",\n \"react/style-prop-object\": \"warn\",\n\n // React rules turned off in favor of @stylistic\n \"react/jsx-closing-bracket-location\": \"off\",\n \"react/jsx-closing-tag-location\": \"off\",\n \"react/jsx-curly-brace-presence\": \"off\",\n \"react/jsx-curly-newline\": \"off\",\n \"react/jsx-curly-spacing\": \"off\",\n \"react/jsx-equals-spacing\": \"off\",\n \"react/jsx-first-prop-new-line\": \"off\",\n \"react/jsx-indent-props\": \"off\",\n \"react/jsx-max-props-per-line\": \"off\",\n \"react/jsx-one-expression-per-line\": \"off\",\n \"react/jsx-tag-spacing\": \"off\",\n \"react/jsx-wrap-multilines\": \"off\",\n\n // React hooks recommend rules overrides\n \"react-hooks/set-state-in-effect\": \"off\",\n\n // React hooks \"compiler\" related rules\n ...compiler === false ? {\n \"react-hooks/gating\": \"off\",\n \"react-hooks/incompatible-library\": \"off\",\n \"react-hooks/preserve-manual-memoization\": \"off\",\n \"react-hooks/unsupported-syntax\": \"off\"\n } : {},\n\n // @stylistic rules (cannot use the recommended config\" because it would conflict with the \"typescript\" config rules)\n \"@stylistic/jsx-closing-bracket-location\": \"warn\",\n \"@stylistic/jsx-closing-tag-location\": \"warn\",\n \"@stylistic/jsx-curly-brace-presence\": [\n \"warn\",\n {\n propElementValues: \"always\"\n }\n ],\n \"@stylistic/jsx-curly-newline\": \"warn\",\n \"@stylistic/jsx-curly-spacing\": [\n \"warn\",\n {\n children: true,\n when: \"never\"\n }\n ],\n \"@stylistic/jsx-equals-spacing\": \"warn\",\n \"@stylistic/jsx-first-prop-new-line\": \"warn\",\n \"@stylistic/jsx-function-call-newline\": [\"warn\", \"multiline\"],\n \"@stylistic/jsx-max-props-per-line\": [\n \"warn\",\n {\n maximum: 1,\n when: \"multiline\"\n }\n ],\n \"@stylistic/jsx-quotes\": [\"warn\", \"prefer-double\"],\n \"@stylistic/jsx-tag-spacing\": [\n \"warn\",\n {\n beforeSelfClosing: \"always\"\n }\n ],\n \"@stylistic/jsx-wrap-multilines\": [\n \"warn\",\n {\n arrow: \"parens-new-line\",\n assignment: \"parens-new-line\",\n condition: \"parens-new-line\",\n declaration: \"parens-new-line\",\n logical: \"parens-new-line\",\n prop: \"parens-new-line\",\n propertyValue: \"parens-new-line\",\n return: \"parens-new-line\"\n }\n ],\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["stylisticPlugin","reactPlugin","reactHooksPlugin","reactGlobalIgnores","defineReactConfig","options","rules","compiler","config"],"mappings":";;;;;;;;;;;AAAuD;AAET;AACW;AAQlD,MAAMG,qBAAqB,EAAE,CAAC;AAE9B,SAASC,kBAAkBC,UAA8B,CAAC,CAAC;IAC9D,MAAM,EACFC,QAAQ,CAAC,CAAC,EACVC,WAAW,KAAK,EACnB,GAAGF;IAEJ,MAAMG,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACL,cAAcR,aAAeA;YACjC;YACA,SAAS;gBACLC,4CAAoC;gBACpCC,kDAAyC;aAC5C;YACD,iBAAiB;gBACb,eAAe;oBACX,cAAc;wBACV,KAAK;oBACT;gBACJ;YACJ;YACA,UAAU;gBACN,OAAO;oBACH,SAAS;gBACb;YACJ;YACA,OAAO;gBACH,kCAAkC;gBAClC,sBAAsB;gBACtB,iBAAiB;gBACjB,gCAAgC;oBAC5B;oBACA;wBACI,YAAY;oBAChB;iBACH;gBACD,sBAAsB;oBAClB;oBACA;wBACI,cAAc;oBAClB;iBACH;gBACD,+BAA+B;gBAC/B,oBAAoB;gBACpB,4BAA4B;gBAE5B,oBAAoB;gBACpB,yBAAyB;gBACzB,wCAAwC;gBACxC,kCAAkC;oBAC9B;oBACA;oBACA;wBAAE,mBAAmB;oBAAK;iBAC7B;gBACD,mCAAmC;oBAC/B;oBACA;wBACI,kBAAkB;oBACtB;iBACH;gBACD,2BAA2B;oBAAC;oBAAQ;iBAAQ;gBAC5C,gCAAgC;oBAC5B;oBACA;wBACI,YAAY;4BAAC;4BAAQ;yBAAO;oBAChC;iBACH;gBACD,yBAAyB;oBACrB;oBACA;wBACI,cAAc;wBACd,QAAQ,EAAE;oBACd;iBACH;gBACD,qCAAqC;gBACrC,4BAA4B;gBAC5B,kBAAkB;gBAClB,8BAA8B;oBAC1B;oBACA;wBACI,kBAAkB,EAAE;wBACpB,gBAAgB;oBACpB;iBACH;gBACD,yBAAyB;gBACzB,2BAA2B;gBAE3B,gDAAgD;gBAChD,sCAAsC;gBACtC,kCAAkC;gBAClC,kCAAkC;gBAClC,2BAA2B;gBAC3B,2BAA2B;gBAC3B,4BAA4B;gBAC5B,iCAAiC;gBACjC,0BAA0B;gBAC1B,gCAAgC;gBAChC,qCAAqC;gBACrC,yBAAyB;gBACzB,6BAA6B;gBAE7B,wCAAwC;gBACxC,mCAAmC;gBAEnC,uCAAuC;gBACvC,GAAGK,aAAa,QAAQ;oBACpB,sBAAsB;oBACtB,oCAAoC;oBACpC,2CAA2C;oBAC3C,kCAAkC;gBACtC,IAAI,CAAC,CAAC;gBAEN,qHAAqH;gBACrH,2CAA2C;gBAC3C,uCAAuC;gBACvC,uCAAuC;oBACnC;oBACA;wBACI,mBAAmB;oBACvB;iBACH;gBACD,gCAAgC;gBAChC,gCAAgC;oBAC5B;oBACA;wBACI,UAAU;wBACV,MAAM;oBACV;iBACH;gBACD,iCAAiC;gBACjC,sCAAsC;gBACtC,wCAAwC;oBAAC;oBAAQ;iBAAY;gBAC7D,qCAAqC;oBACjC;oBACA;wBACI,SAAS;wBACT,MAAM;oBACV;iBACH;gBACD,yBAAyB;oBAAC;oBAAQ;iBAAgB;gBAClD,8BAA8B;oBAC1B;oBACA;wBACI,mBAAmB;oBACvB;iBACH;gBACD,kCAAkC;oBAC9B;oBACA;wBACI,OAAO;wBACP,YAAY;wBACZ,WAAW;wBACX,aAAa;wBACb,SAAS;wBACT,MAAM;wBACN,eAAe;wBACf,QAAQ;oBACZ;iBACH;gBAED,+DAA+D;gBAC/D,GAAGD,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOE;AACX"}
package/dist/storybook.js CHANGED
@@ -6,7 +6,9 @@ import eslint_plugin_storybook from "eslint-plugin-storybook";
6
6
 
7
7
  const storybookGlobalIgnores = [
8
8
  "!.storybook",
9
- "storybook-static"
9
+ "storybook-static",
10
+ // Because it's usually included in the ".storybook" folder.
11
+ "mockServiceWorker.js"
10
12
  ];
11
13
  function defineStorybookConfig(options = {}) {
12
14
  const { storiesRules = {}, mainFileRules = {} } = options;
@@ -1 +1 @@
1
- {"version":3,"file":"storybook.js","sources":["webpack://@workleap/eslint-configs/./src/storybook.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport storybookPlugin from \"eslint-plugin-storybook\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface StorybookConfigOptions {\n storiesRules?: Partial<Linter.RulesRecord>;\n mainFileRules?: Partial<Linter.RulesRecord>;\n}\n\nexport const storybookGlobalIgnores = [\n \"!.storybook\",\n \"storybook-static\"\n];\n\nexport function defineStorybookConfig(options: StorybookConfigOptions = {}) {\n const {\n storiesRules = {},\n mainFileRules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [\n {\n name: \"@workleap/eslint-configs/storybook-stories\",\n files: [\n \"**/*.{stories,storybook,story,chroma}.{js,ts,jsx,tsx}\"\n ],\n extends: [\n // @ts-expect-error the typings are broken and think there's a \".default\" to add.\n storybookPlugin.configs[\"flat/recommended\"]\n // // @ts-expect-error the types are broken and think there's a \".default\" to add.\n // storybookPlugin.configs[\"flat/csf\"],\n // // @ts-expect-error the types are broken and think there's a \".default\" to add.\n // storybookPlugin.configs[\"flat/csf-strict\"]\n ],\n rules: storiesRules\n },\n {\n name: \"@workleap/eslint-configs/storybook-main\",\n files: [\"**/{.storybook,storybook}/main.@(js|cjs|mjs|ts)\"],\n plugins: {\n // @ts-expect-error the typings are broken.\n storybook: storybookPlugin\n },\n rules: {\n \"storybook/no-uninstalled-addons\": \"warn\",\n // Positioned last to allow the consumer to override any rules.\n ...mainFileRules\n }\n }\n ];\n\n return config;\n};\n"],"names":["storybookPlugin","storybookGlobalIgnores","defineStorybookConfig","options","storiesRules","mainFileRules","config"],"mappings":";;;;;AACsD;AAQ/C,MAAMC,yBAAyB;IAClC;IACA;CACH,CAAC;AAEK,SAASC,sBAAsBC,UAAkC,CAAC,CAAC;IACtE,MAAM,EACFC,eAAe,CAAC,CAAC,EACjBC,gBAAgB,CAAC,CAAC,EACrB,GAAGF;IAEJ,MAAMG,SAA8B;QAChC;YACI,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACL,iFAAiF;gBACjFN,mDAA2C;aAK9C;YACD,OAAOI;QACX;QACA;YACI,MAAM;YACN,OAAO;gBAAC;aAAkD;YAC1D,SAAS;gBACL,2CAA2C;gBAC3C,WAAWJ,uBAAeA;YAC9B;YACA,OAAO;gBACH,mCAAmC;gBACnC,+DAA+D;gBAC/D,GAAGK,aAAa;YACpB;QACJ;KACH;IAED,OAAOC;AACX"}
1
+ {"version":3,"file":"storybook.js","sources":["../src/storybook.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport storybookPlugin from \"eslint-plugin-storybook\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface StorybookConfigOptions {\n storiesRules?: Partial<Linter.RulesRecord>;\n mainFileRules?: Partial<Linter.RulesRecord>;\n}\n\nexport const storybookGlobalIgnores = [\n \"!.storybook\",\n \"storybook-static\",\n // Because it's usually included in the \".storybook\" folder.\n \"mockServiceWorker.js\"\n];\n\nexport function defineStorybookConfig(options: StorybookConfigOptions = {}) {\n const {\n storiesRules = {},\n mainFileRules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [\n {\n name: \"@workleap/eslint-configs/storybook-stories\",\n files: [\n \"**/*.{stories,storybook,story,chroma}.{js,ts,jsx,tsx}\"\n ],\n extends: [\n // @ts-expect-error the typings are broken and think there's a \".default\" to add.\n storybookPlugin.configs[\"flat/recommended\"]\n // // @ts-expect-error the types are broken and think there's a \".default\" to add.\n // storybookPlugin.configs[\"flat/csf\"],\n // // @ts-expect-error the types are broken and think there's a \".default\" to add.\n // storybookPlugin.configs[\"flat/csf-strict\"]\n ],\n rules: storiesRules\n },\n {\n name: \"@workleap/eslint-configs/storybook-main\",\n files: [\"**/{.storybook,storybook}/main.@(js|cjs|mjs|ts)\"],\n plugins: {\n // @ts-expect-error the typings are broken.\n storybook: storybookPlugin\n },\n rules: {\n \"storybook/no-uninstalled-addons\": \"warn\",\n // Positioned last to allow the consumer to override any rules.\n ...mainFileRules\n }\n }\n ];\n\n return config;\n};\n"],"names":["storybookPlugin","storybookGlobalIgnores","defineStorybookConfig","options","storiesRules","mainFileRules","config"],"mappings":";;;;;AACsD;AAQ/C,MAAMC,yBAAyB;IAClC;IACA;IACA,4DAA4D;IAC5D;CACH,CAAC;AAEK,SAASC,sBAAsBC,UAAkC,CAAC,CAAC;IACtE,MAAM,EACFC,eAAe,CAAC,CAAC,EACjBC,gBAAgB,CAAC,CAAC,EACrB,GAAGF;IAEJ,MAAMG,SAA8B;QAChC;YACI,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACL,iFAAiF;gBACjFN,mDAA2C;aAK9C;YACD,OAAOI;QACX;QACA;YACI,MAAM;YACN,OAAO;gBAAC;aAAkD;YAC1D,SAAS;gBACL,2CAA2C;gBAC3C,WAAWJ,uBAAeA;YAC9B;YACA,OAAO;gBACH,mCAAmC;gBACnC,+DAA+D;gBAC/D,GAAGK,aAAa;YACpB;QACJ;KACH;IAED,OAAOC;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"testingLibrary.js","sources":["webpack://@workleap/eslint-configs/./src/testingLibrary.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport testingLibraryPlugin from \"eslint-plugin-testing-library\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface TestingLibraryConfigOptions {\n reactRules?: Partial<Linter.RulesRecord>;\n jsRules?: Partial<Linter.RulesRecord>;\n}\n\nexport const testingLibraryGlobalIgnores = [];\n\nexport function defineTestingLibraryConfig(options: TestingLibraryConfigOptions = {}) {\n const {\n reactRules = {},\n jsRules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [\n {\n name: \"@workleap/eslint-configs/testing-library-react\",\n files: [\n \"**/*.test.[jt]sx\",\n \"**/*-test.[jt]sx\",\n \"**/__tests__/*.[jt]sx\",\n \"**/test.[jt]sx\"\n ],\n extends: [\n testingLibraryPlugin.configs[\"flat/react\"]\n ],\n rules: reactRules\n },\n {\n name: \"@workleap/eslint-configs/testing-library-js\",\n files: [\n \"**/*.test.[jt]s\",\n \"**/*-test.[jt]s\",\n \"**/__tests__/*.[jt]s\",\n \"**/test.[jt]s\"\n ],\n extends: [\n testingLibraryPlugin.configs[\"flat/dom\"]\n ],\n rules: jsRules\n }\n ];\n\n return config;\n};\n"],"names":["testingLibraryPlugin","testingLibraryGlobalIgnores","defineTestingLibraryConfig","options","reactRules","jsRules","config"],"mappings":";;;;;AACiE;AAQ1D,MAAMC,8BAA8B,EAAE,CAAC;AAEvC,SAASC,2BAA2BC,UAAuC,CAAC,CAAC;IAChF,MAAM,EACFC,aAAa,CAAC,CAAC,EACfC,UAAU,CAAC,CAAC,EACf,GAAGF;IAEJ,MAAMG,SAA8B;QAChC;YACI,MAAM;YACN,OAAO;gBACH;gBACA;gBACA;gBACA;aACH;YACD,SAAS;gBACLN,mDAA0C;aAC7C;YACD,OAAOI;QACX;QACA;YACI,MAAM;YACN,OAAO;gBACH;gBACA;gBACA;gBACA;aACH;YACD,SAAS;gBACLJ,iDAAwC;aAC3C;YACD,OAAOK;QACX;KACH;IAED,OAAOC;AACX"}
1
+ {"version":3,"file":"testingLibrary.js","sources":["../src/testingLibrary.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport testingLibraryPlugin from \"eslint-plugin-testing-library\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface TestingLibraryConfigOptions {\n reactRules?: Partial<Linter.RulesRecord>;\n jsRules?: Partial<Linter.RulesRecord>;\n}\n\nexport const testingLibraryGlobalIgnores = [];\n\nexport function defineTestingLibraryConfig(options: TestingLibraryConfigOptions = {}) {\n const {\n reactRules = {},\n jsRules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [\n {\n name: \"@workleap/eslint-configs/testing-library-react\",\n files: [\n \"**/*.test.[jt]sx\",\n \"**/*-test.[jt]sx\",\n \"**/__tests__/*.[jt]sx\",\n \"**/test.[jt]sx\"\n ],\n extends: [\n testingLibraryPlugin.configs[\"flat/react\"]\n ],\n rules: reactRules\n },\n {\n name: \"@workleap/eslint-configs/testing-library-js\",\n files: [\n \"**/*.test.[jt]s\",\n \"**/*-test.[jt]s\",\n \"**/__tests__/*.[jt]s\",\n \"**/test.[jt]s\"\n ],\n extends: [\n testingLibraryPlugin.configs[\"flat/dom\"]\n ],\n rules: jsRules\n }\n ];\n\n return config;\n};\n"],"names":["testingLibraryPlugin","testingLibraryGlobalIgnores","defineTestingLibraryConfig","options","reactRules","jsRules","config"],"mappings":";;;;;AACiE;AAQ1D,MAAMC,8BAA8B,EAAE,CAAC;AAEvC,SAASC,2BAA2BC,UAAuC,CAAC,CAAC;IAChF,MAAM,EACFC,aAAa,CAAC,CAAC,EACfC,UAAU,CAAC,CAAC,EACf,GAAGF;IAEJ,MAAMG,SAA8B;QAChC;YACI,MAAM;YACN,OAAO;gBACH;gBACA;gBACA;gBACA;aACH;YACD,SAAS;gBACLN,mDAA0C;aAC7C;YACD,OAAOI;QACX;QACA;YACI,MAAM;YACN,OAAO;gBACH;gBACA;gBACA;gBACA;aACH;YACD,SAAS;gBACLJ,iDAAwC;aAC3C;YACD,OAAOK;QACX;KACH;IAED,OAAOC;AACX"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["webpack://@workleap/eslint-configs/./src/types.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\n// Copied from: https://github.com/eslint/rewrite/blob/main/packages/config-helpers/src/types.ts\n/**\n * Infinite array type.\n */\nexport type InfiniteArray<T> = T | InfiniteArray<T>[];\n\n// Copied from: https://github.com/eslint/rewrite/blob/main/packages/config-helpers/src/types.ts\n/**\n * The type of array element in the `extends` property after flattening.\n */\nexport type SimpleExtendsElement = string | Linter.Config;\n\n// Copied from: https://github.com/eslint/rewrite/blob/main/packages/config-helpers/src/types.ts\n/**\n * The type of array element in the `extends` property before flattening.\n */\nexport type ExtendsElement = SimpleExtendsElement | InfiniteArray<Linter.Config>;\n\n// Copied from: https://github.com/eslint/rewrite/blob/main/packages/config-helpers/src/types.ts\n/**\n * Config with extends. Valid only inside of `defineConfig()`.\n */\nexport interface ConfigWithExtends extends Linter.Config {\n extends?: ExtendsElement[];\n}\n"],"names":[],"mappings":";;AAoBA,gGAAgG;AAChG;;CAEC,GAGA"}
1
+ {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\n// Copied from: https://github.com/eslint/rewrite/blob/main/packages/config-helpers/src/types.ts\n/**\n * Infinite array type.\n */\nexport type InfiniteArray<T> = T | InfiniteArray<T>[];\n\n// Copied from: https://github.com/eslint/rewrite/blob/main/packages/config-helpers/src/types.ts\n/**\n * The type of array element in the `extends` property after flattening.\n */\nexport type SimpleExtendsElement = string | Linter.Config;\n\n// Copied from: https://github.com/eslint/rewrite/blob/main/packages/config-helpers/src/types.ts\n/**\n * The type of array element in the `extends` property before flattening.\n */\nexport type ExtendsElement = SimpleExtendsElement | InfiniteArray<Linter.Config>;\n\n// Copied from: https://github.com/eslint/rewrite/blob/main/packages/config-helpers/src/types.ts\n/**\n * Config with extends. Valid only inside of `defineConfig()`.\n */\nexport interface ConfigWithExtends extends Linter.Config {\n extends?: ExtendsElement[];\n}\n"],"names":[],"mappings":";;AAoBA,gGAAgG;AAChG;;CAEC,GAGA"}
@@ -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 \"prefer-promise-reject-errors\": \"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/prefer-promise-reject-errors\": \"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: \"always\"\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,gCAAgC;gBAChC,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,mDAAmD;gBACnD,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":["../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 \"prefer-promise-reject-errors\": \"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/prefer-promise-reject-errors\": \"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: \"always\"\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,gCAAgC;gBAChC,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,mDAAmD;gBACnD,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/dist/vitest.js CHANGED
@@ -20,7 +20,6 @@ function defineVitestConfig(options = {}) {
20
20
  "**/test.{js,jsx,ts,tsx}"
21
21
  ],
22
22
  plugins: {
23
- // @ts-expect-error temporary code until defineConfig is supported.
24
23
  vitest: eslint_plugin
25
24
  },
26
25
  // Waiting for defineConfig support: https://github.com/vitest-dev/eslint-plugin-vitest/issues/771
@@ -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 enabled?: boolean;\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const vitestGlobalIgnores = [];\n\nexport function defineVitestConfig(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","defineVitestConfig","options","enabled","rules","config"],"mappings":";;;;;AAAiD;AAS1C,MAAMC,sBAAsB,EAAE,CAAC;AAE/B,SAASC,mBAAmBC,UAA+B,CAAC,CAAC;IAChE,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"}
1
+ {"version":3,"file":"vitest.js","sources":["../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 defineVitestConfig(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 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","defineVitestConfig","options","enabled","rules","config"],"mappings":";;;;;AAAiD;AAS1C,MAAMC,sBAAsB,EAAE,CAAC;AAE/B,SAASC,mBAAmBC,UAA+B,CAAC,CAAC;IAChE,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,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/dist/yaml.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"yaml.js","sources":["webpack://@workleap/eslint-configs/./src/yaml.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport yamlPlugin from \"eslint-plugin-yaml\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface YamlConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const yamlGlobalIgnores = [\n \"pnpm-lock.yaml\"\n];\n\nexport function defineYamlConfig(options: YamlConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/yaml\",\n files: [\n \"**/*.yaml\",\n \"**/*.yml\"\n ],\n extends: [\n // @ts-expect-error the typings are broken.\n yamlPlugin.configs.recommended\n ],\n rules\n }];\n\n return config;\n};\n"],"names":["yamlPlugin","yamlGlobalIgnores","defineYamlConfig","options","rules","config"],"mappings":";;;;;AAC4C;AAOrC,MAAMC,oBAAoB;IAC7B;CACH,CAAC;AAEK,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;gBACA;aACH;YACD,SAAS;gBACL,2CAA2C;gBAC3CL,sCAA8B;aACjC;YACDI;QACJ;KAAE;IAEF,OAAOC;AACX"}
1
+ {"version":3,"file":"yaml.js","sources":["../src/yaml.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport yamlPlugin from \"eslint-plugin-yaml\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface YamlConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const yamlGlobalIgnores = [\n \"pnpm-lock.yaml\"\n];\n\nexport function defineYamlConfig(options: YamlConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/yaml\",\n files: [\n \"**/*.yaml\",\n \"**/*.yml\"\n ],\n extends: [\n // @ts-expect-error the typings are broken.\n yamlPlugin.configs.recommended\n ],\n rules\n }];\n\n return config;\n};\n"],"names":["yamlPlugin","yamlGlobalIgnores","defineYamlConfig","options","rules","config"],"mappings":";;;;;AAC4C;AAOrC,MAAMC,oBAAoB;IAC7B;CACH,CAAC;AAEK,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;gBACA;aACH;YACD,SAAS;gBACL,2CAA2C;gBAC3CL,sCAA8B;aACjC;YACDI;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.6",
5
+ "version": "1.1.8",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
@@ -27,12 +27,12 @@
27
27
  "CHANGELOG.md"
28
28
  ],
29
29
  "peerDependencies": {
30
- "@eslint/js": "^9.38.0",
31
- "@typescript-eslint/parser": "^8.46.2",
32
- "eslint": "^9.38.0",
33
- "storybook": "^9.1.13",
30
+ "@eslint/js": "^9.39.1",
31
+ "@typescript-eslint/parser": "^8.49.0",
32
+ "eslint": "^9.39.1",
33
+ "storybook": "^10.1.6",
34
34
  "typescript": "^5.9.3",
35
- "typescript-eslint": "^8.46.2"
35
+ "typescript-eslint": "^8.49.0"
36
36
  },
37
37
  "peerDependenciesMeta": {
38
38
  "@typescript-eslint/parser": {
@@ -49,30 +49,30 @@
49
49
  }
50
50
  },
51
51
  "dependencies": {
52
- "@stylistic/eslint-plugin": "^5.5.0",
53
- "@vitest/eslint-plugin": "^1.3.23",
52
+ "@stylistic/eslint-plugin": "^5.6.1",
53
+ "@vitest/eslint-plugin": "^1.5.2",
54
54
  "eslint-plugin-import": "^2.32.0",
55
- "eslint-plugin-jest": "^29.0.1",
55
+ "eslint-plugin-jest": "^29.2.1",
56
56
  "eslint-plugin-jsonc": "^2.21.0",
57
57
  "eslint-plugin-jsx-a11y": "^6.10.2",
58
- "eslint-plugin-package-json": "^0.58.0",
58
+ "eslint-plugin-package-json": "^0.85.0",
59
59
  "eslint-plugin-react": "^7.37.5",
60
- "eslint-plugin-react-hooks": "^7.0.0",
61
- "eslint-plugin-storybook": "^9.1.13",
62
- "eslint-plugin-testing-library": "^7.13.3",
60
+ "eslint-plugin-react-hooks": "^7.0.1",
61
+ "eslint-plugin-storybook": "^10.1.6",
62
+ "eslint-plugin-testing-library": "^7.13.5",
63
63
  "eslint-plugin-yaml": "^1.1.3",
64
- "globals": "^16.4.0"
64
+ "globals": "^16.5.0"
65
65
  },
66
66
  "devDependencies": {
67
- "@eslint/js": "9.38.0",
68
- "@rsbuild/core": "1.5.17",
69
- "@rslib/core": "0.16.0",
67
+ "@eslint/js": "9.39.1",
68
+ "@rsbuild/core": "1.6.14",
69
+ "@rslib/core": "0.18.4",
70
70
  "@types/eslint-plugin-jsx-a11y": "6.10.1",
71
71
  "@types/estree": "1.0.8",
72
- "@types/node": "24.9.1",
73
- "eslint": "9.38.0",
72
+ "@types/node": "25.0.0",
73
+ "eslint": "9.39.1",
74
74
  "typescript": "5.9.3",
75
- "typescript-eslint": "8.46.2",
75
+ "typescript-eslint": "8.49.0",
76
76
  "@workleap/typescript-configs": "3.0.7"
77
77
  },
78
78
  "scripts": {
@@ -39,8 +39,10 @@ export function definePackageJsonConfig(options: PackageJsonConfigOptions = {})
39
39
  // I am not sure why, this rule is triggering errors for valid paths.
40
40
  "package-json/valid-repository-directory": "off",
41
41
  "package-json/valid-scripts": "off",
42
- // Doesn't make sense for our products
42
+ // Doesn't make sense for our products.
43
43
  "package-json/require-license": "off",
44
+ // Not useful when using PNPM and syncpack.
45
+ "package-json/specify-peers-locally": "off",
44
46
  // Positioned last to allow the consumer to override any rules.
45
47
  ...rules
46
48
  }
package/src/react.ts CHANGED
@@ -27,7 +27,6 @@ export function defineReactConfig(options: ReactConfigOptions = {}) {
27
27
  },
28
28
  extends: [
29
29
  reactPlugin.configs.flat.recommended,
30
- // @ts-expect-error the typings are broken and think there's a ".default" to add.
31
30
  reactHooksPlugin.configs.flat.recommended
32
31
  ],
33
32
  languageOptions: {
package/src/storybook.ts CHANGED
@@ -9,7 +9,9 @@ export interface StorybookConfigOptions {
9
9
 
10
10
  export const storybookGlobalIgnores = [
11
11
  "!.storybook",
12
- "storybook-static"
12
+ "storybook-static",
13
+ // Because it's usually included in the ".storybook" folder.
14
+ "mockServiceWorker.js"
13
15
  ];
14
16
 
15
17
  export function defineStorybookConfig(options: StorybookConfigOptions = {}) {
package/src/vitest.ts CHANGED
@@ -28,7 +28,6 @@ export function defineVitestConfig(options: VitestConfigOptions = {}) {
28
28
  "**/test.{js,jsx,ts,tsx}"
29
29
  ],
30
30
  plugins: {
31
- // @ts-expect-error temporary code until defineConfig is supported.
32
31
  vitest: vitestPlugin
33
32
  },
34
33
  // Waiting for defineConfig support: https://github.com/vitest-dev/eslint-plugin-vitest/issues/771