@workleap/eslint-configs 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/by-project-type/defineMonorepoWorkspaceConfig.d.ts +2 -2
- package/dist/by-project-type/defineMonorepoWorkspaceConfig.js +10 -10
- package/dist/by-project-type/defineMonorepoWorkspaceConfig.js.map +1 -1
- package/dist/by-project-type/defineReactLibraryConfig.d.ts +3 -2
- package/dist/by-project-type/defineReactLibraryConfig.js +29 -24
- package/dist/by-project-type/defineReactLibraryConfig.js.map +1 -1
- package/dist/by-project-type/defineTypescriptLibraryConfig.d.ts +3 -2
- package/dist/by-project-type/defineTypescriptLibraryConfig.js +21 -16
- package/dist/by-project-type/defineTypescriptLibraryConfig.js.map +1 -1
- package/dist/by-project-type/defineWebApplicationConfig.d.ts +3 -2
- package/dist/by-project-type/defineWebApplicationConfig.js +29 -24
- package/dist/by-project-type/defineWebApplicationConfig.js.map +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +2 -2
- package/dist/core.js.map +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +41 -1
- package/dist/index.js.map +1 -1
- package/dist/jest.d.ts +2 -1
- package/dist/jest.js +7 -3
- package/dist/jest.js.map +1 -1
- package/dist/json.d.ts +1 -1
- package/dist/json.js +2 -2
- package/dist/json.js.map +1 -1
- package/dist/jsxAlly.d.ts +1 -1
- package/dist/jsxAlly.js +2 -2
- package/dist/jsxAlly.js.map +1 -1
- package/dist/packageJson.d.ts +1 -1
- package/dist/packageJson.js +2 -2
- package/dist/packageJson.js.map +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +2 -2
- package/dist/react.js.map +1 -1
- package/dist/storybook.d.ts +1 -1
- package/dist/storybook.js +2 -2
- package/dist/storybook.js.map +1 -1
- package/dist/testingLibrary.d.ts +1 -1
- package/dist/testingLibrary.js +2 -2
- package/dist/testingLibrary.js.map +1 -1
- package/dist/typescript.d.ts +2 -2
- package/dist/typescript.js +2 -2
- package/dist/typescript.js.map +1 -1
- package/dist/vitest.d.ts +2 -1
- package/dist/vitest.js +6 -3
- package/dist/vitest.js.map +1 -1
- package/dist/yaml.d.ts +1 -1
- package/dist/yaml.js +2 -2
- package/dist/yaml.js.map +1 -1
- package/package.json +1 -1
- package/src/by-project-type/defineMonorepoWorkspaceConfig.ts +11 -11
- package/src/by-project-type/defineReactLibraryConfig.ts +31 -23
- package/src/by-project-type/defineTypescriptLibraryConfig.ts +23 -15
- package/src/by-project-type/defineWebApplicationConfig.ts +31 -90
- package/src/core.ts +1 -1
- package/src/index.ts +10 -10
- package/src/jest.ts +8 -1
- package/src/json.ts +1 -1
- package/src/jsxAlly.ts +1 -1
- package/src/packageJson.ts +1 -1
- package/src/react.ts +1 -1
- package/src/storybook.ts +1 -1
- package/src/testingLibrary.ts +1 -1
- package/src/typescript.ts +2 -2
- package/src/vitest.ts +7 -1
- package/src/yaml.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @workleap/eslint-configs
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#322](https://github.com/workleap/wl-web-configs/pull/322) [`9a6f6ed`](https://github.com/workleap/wl-web-configs/commit/9a6f6ed3f180d459c8bb04358b5b8be2d51d4d20) Thanks [@patricklafrance](https://github.com/patricklafrance)! - The package is now exporting all the granular configs, like "core", "react", "vitest", etc..
|
|
8
|
+
|
|
9
|
+
## 1.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#319](https://github.com/workleap/wl-web-configs/pull/319) [`544890b`](https://github.com/workleap/wl-web-configs/commit/544890be5ec24b2d9ac010e84c510559822a7447) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Disable Jest tests by default.
|
|
14
|
+
|
|
3
15
|
## 1.0.0
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type CoreConfigOptions } from "../core.ts";
|
|
2
2
|
import { JsonConfigOptions } from "../json.ts";
|
|
3
3
|
import { type PackageJsonConfigOptions } from "../packageJson.ts";
|
|
4
|
-
import { type
|
|
4
|
+
import { type TypeScriptConfigOptions } from "../typescript.ts";
|
|
5
5
|
import { type YamlConfigOptions } from "../yaml.ts";
|
|
6
6
|
export interface DefineMonorepoWorkspaceConfigOptions {
|
|
7
7
|
core?: CoreConfigOptions;
|
|
8
8
|
json?: JsonConfigOptions;
|
|
9
9
|
packageJson?: PackageJsonConfigOptions;
|
|
10
|
-
typescript?:
|
|
10
|
+
typescript?: TypeScriptConfigOptions;
|
|
11
11
|
yaml?: YamlConfigOptions;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { coreGlobalIgnores, defineCoreConfig } from "../core.js";
|
|
3
|
+
import { defineJsonConfig, jsonGlobalIgnores } from "../json.js";
|
|
4
|
+
import { definePackageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
|
|
5
|
+
import { defineTypeScriptConfig, typescriptGlobalIgnores } from "../typescript.js";
|
|
6
|
+
import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
7
7
|
|
|
8
8
|
;// CONCATENATED MODULE: external "eslint/config"
|
|
9
9
|
|
|
@@ -40,11 +40,11 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
40
40
|
...typescriptGlobalIgnores,
|
|
41
41
|
...yamlGlobalIgnores
|
|
42
42
|
]),
|
|
43
|
-
...
|
|
44
|
-
...
|
|
45
|
-
...
|
|
46
|
-
...
|
|
47
|
-
...
|
|
43
|
+
...defineCoreConfig(core),
|
|
44
|
+
...defineJsonConfig(json),
|
|
45
|
+
...definePackageJsonConfig(packageJson),
|
|
46
|
+
...defineTypeScriptConfig(tsconfigRootDir, typescript),
|
|
47
|
+
...defineYamlConfig(yaml),
|
|
48
48
|
{
|
|
49
49
|
rules: {
|
|
50
50
|
"package-json/valid-version": "off"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"by-project-type/defineMonorepoWorkspaceConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineMonorepoWorkspaceConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport {
|
|
1
|
+
{"version":3,"file":"by-project-type/defineMonorepoWorkspaceConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineMonorepoWorkspaceConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { type CoreConfigOptions, coreGlobalIgnores, defineCoreConfig } from \"../core.ts\";\nimport { defineJsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { definePackageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { defineTypeScriptConfig, type TypeScriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { defineYamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineMonorepoWorkspaceConfigOptions {\n core?: CoreConfigOptions;\n json?: JsonConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n typescript?: TypeScriptConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineMonorepoWorkspaceConfig(tsconfigRootDir: string, options: DefineMonorepoWorkspaceConfigOptions = {}) {\n const {\n core,\n json,\n packageJson,\n typescript,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jsonGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...defineCoreConfig(core),\n ...defineJsonConfig(json),\n ...definePackageJsonConfig(packageJson),\n ...defineTypeScriptConfig(tsconfigRootDir, typescript),\n ...defineYamlConfig(yaml),\n {\n rules: {\n \"package-json/valid-version\": \"off\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreGlobalIgnores","defineCoreConfig","defineJsonConfig","jsonGlobalIgnores","definePackageJsonConfig","packageJsonGlobalIgnores","defineTypeScriptConfig","typescriptGlobalIgnores","defineYamlConfig","yamlGlobalIgnores","defineMonorepoWorkspaceConfig","tsconfigRootDir","options","core","json","packageJson","typescript","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;AAA4D;AAC6B;AACL;AACiC;AACJ;AACxB;AAUzF;;;CAGC,GACM,SAASY,8BAA8BC,eAAuB,EAAEC,UAAgD,CAAC,CAAC;IACrH,MAAM,EACFC,IAAI,EACJC,IAAI,EACJC,WAAW,EACXC,UAAU,EACVC,IAAI,EACP,GAAGL;IAEJ,OAAOd,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;eACGC,iBAAiBA;eACjBG,iBAAiBA;eACjBE,wBAAwBA;eACxBE,uBAAuBA;eACvBE,iBAAiBA;SACvB;WACER,gBAAgBA,CAACY;WACjBX,gBAAgBA,CAACY;WACjBV,uBAAuBA,CAACW;WACxBT,sBAAsBA,CAACK,iBAAiBK;WACxCR,gBAAgBA,CAACS;QACpB;YACI,OAAO;gBACH,8BAA8B;YAClC;QACJ;KACH;AACL"}
|
|
@@ -6,10 +6,11 @@ import { type PackageJsonConfigOptions } from "../packageJson.ts";
|
|
|
6
6
|
import { type ReactConfigOptions } from "../react.ts";
|
|
7
7
|
import { type StorybookConfigOptions } from "../storybook.ts";
|
|
8
8
|
import { type TestingLibraryConfigOptions } from "../testingLibrary.ts";
|
|
9
|
-
import { type
|
|
9
|
+
import { type TypeScriptConfigOptions } from "../typescript.ts";
|
|
10
10
|
import { type VitestConfigOptions } from "../vitest.ts";
|
|
11
11
|
import { type YamlConfigOptions } from "../yaml.ts";
|
|
12
12
|
export interface DefineReactLibraryConfigOptions {
|
|
13
|
+
testFramework?: "vitest" | "jest";
|
|
13
14
|
core?: CoreConfigOptions;
|
|
14
15
|
jest?: JestConfigOptions;
|
|
15
16
|
json?: JsonConfigOptions;
|
|
@@ -18,7 +19,7 @@ export interface DefineReactLibraryConfigOptions {
|
|
|
18
19
|
react?: ReactConfigOptions;
|
|
19
20
|
storybook?: StorybookConfigOptions;
|
|
20
21
|
testingLibrary?: TestingLibraryConfigOptions;
|
|
21
|
-
typescript?:
|
|
22
|
+
typescript?: TypeScriptConfigOptions;
|
|
22
23
|
vitest?: VitestConfigOptions;
|
|
23
24
|
yaml?: YamlConfigOptions;
|
|
24
25
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { coreGlobalIgnores, defineCoreConfig } from "../core.js";
|
|
3
|
+
import { defineJestConfig, jestGlobalIgnores } from "../jest.js";
|
|
4
|
+
import { defineJsonConfig, jsonGlobalIgnores } from "../json.js";
|
|
5
|
+
import { defineJsxAllyConfig, jsxAllyGlobalIgnores } from "../jsxAlly.js";
|
|
6
|
+
import { definePackageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
|
|
7
7
|
import { WorkleapPlugin } from "../plugins/workleapPlugin.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import { defineReactConfig, reactGlobalIgnores } from "../react.js";
|
|
9
|
+
import { defineStorybookConfig, storybookGlobalIgnores } from "../storybook.js";
|
|
10
|
+
import { defineTestingLibraryConfig, testingLibraryGlobalIgnores } from "../testingLibrary.js";
|
|
11
|
+
import { defineTypeScriptConfig, typescriptGlobalIgnores } from "../typescript.js";
|
|
12
|
+
import { defineVitestConfig, vitestGlobalIgnores } from "../vitest.js";
|
|
13
|
+
import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
14
14
|
|
|
15
15
|
;// CONCATENATED MODULE: external "eslint/config"
|
|
16
16
|
|
|
@@ -56,7 +56,7 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
56
56
|
* @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.
|
|
57
57
|
* @param options An optional object of options for the ESlint core and plugins rules.
|
|
58
58
|
*/ function defineReactLibraryConfig(tsconfigRootDir, options = {}) {
|
|
59
|
-
const { core, jest, json, jsxAlly, packageJson, react, storybook, testingLibrary, typescript, vitest, yaml } = options;
|
|
59
|
+
const { testFramework = "vitest", core, jest, json, jsxAlly, packageJson, react, storybook, testingLibrary, typescript, vitest, yaml } = options;
|
|
60
60
|
return defineConfig([
|
|
61
61
|
// node_modules folder is ignored by default.
|
|
62
62
|
globalIgnores([
|
|
@@ -75,19 +75,24 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
75
75
|
...vitestGlobalIgnores,
|
|
76
76
|
...yamlGlobalIgnores
|
|
77
77
|
]),
|
|
78
|
-
...
|
|
79
|
-
...
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
...
|
|
84
|
-
...
|
|
85
|
-
...
|
|
86
|
-
...
|
|
78
|
+
...defineCoreConfig(core),
|
|
79
|
+
...defineJestConfig({
|
|
80
|
+
...jest,
|
|
81
|
+
enabled: jest?.enabled ?? testFramework === "jest"
|
|
82
|
+
}),
|
|
83
|
+
...defineJsonConfig(json),
|
|
84
|
+
...defineJsxAllyConfig(jsxAlly),
|
|
85
|
+
...definePackageJsonConfig(packageJson),
|
|
86
|
+
...defineReactConfig(react),
|
|
87
|
+
...defineStorybookConfig(storybook),
|
|
88
|
+
...defineTestingLibraryConfig(testingLibrary),
|
|
89
|
+
...defineTypeScriptConfig(tsconfigRootDir, typescript),
|
|
87
90
|
// Temporary fix until the vitest plugin support defineConfig and the types are fixed.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
...defineVitestConfig({
|
|
92
|
+
...vitest,
|
|
93
|
+
enabled: vitest?.enabled ?? testFramework === "vitest"
|
|
94
|
+
}),
|
|
95
|
+
...defineYamlConfig(yaml),
|
|
91
96
|
{
|
|
92
97
|
plugins: {
|
|
93
98
|
"@workleap": WorkleapPlugin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"by-project-type/defineReactLibraryConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineReactLibraryConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport {
|
|
1
|
+
{"version":3,"file":"by-project-type/defineReactLibraryConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineReactLibraryConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { type CoreConfigOptions, coreGlobalIgnores, defineCoreConfig } from \"../core.ts\";\nimport { defineJestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { defineJsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { defineJsxAllyConfig, type JsxAllyConfigOptions, jsxAllyGlobalIgnores } from \"../jsxAlly.ts\";\nimport { definePackageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { defineReactConfig, type ReactConfigOptions, reactGlobalIgnores } from \"../react.ts\";\nimport { defineStorybookConfig, type StorybookConfigOptions, storybookGlobalIgnores } from \"../storybook.ts\";\nimport { defineTestingLibraryConfig, type TestingLibraryConfigOptions, testingLibraryGlobalIgnores } from \"../testingLibrary.ts\";\nimport { defineTypeScriptConfig, type TypeScriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { defineVitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { defineYamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineReactLibraryConfigOptions {\n testFramework?: \"vitest\" | \"jest\";\n core?: CoreConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n jsxAlly?: JsxAllyConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n react?: ReactConfigOptions;\n storybook?: StorybookConfigOptions;\n testingLibrary?: TestingLibraryConfigOptions;\n typescript?: TypeScriptConfigOptions;\n vitest?: VitestConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineReactLibraryConfig(tsconfigRootDir: string, options: DefineReactLibraryConfigOptions = {}) {\n const {\n testFramework = \"vitest\",\n core,\n jest,\n json,\n jsxAlly,\n packageJson,\n react,\n storybook,\n testingLibrary,\n typescript,\n vitest,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \"**/__snapshots__/*\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...jsxAllyGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...reactGlobalIgnores,\n ...storybookGlobalIgnores,\n ...testingLibraryGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...defineCoreConfig(core),\n ...defineJestConfig({\n ...jest,\n enabled: jest?.enabled ?? testFramework === \"jest\"\n }),\n ...defineJsonConfig(json),\n ...defineJsxAllyConfig(jsxAlly),\n ...definePackageJsonConfig(packageJson),\n ...defineReactConfig(react),\n ...defineStorybookConfig(storybook),\n ...defineTestingLibraryConfig(testingLibrary),\n ...defineTypeScriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n ...(defineVitestConfig({\n ...vitest,\n enabled: vitest?.enabled ?? testFramework === \"vitest\"\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) as any),\n ...defineYamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreGlobalIgnores","defineCoreConfig","defineJestConfig","jestGlobalIgnores","defineJsonConfig","jsonGlobalIgnores","defineJsxAllyConfig","jsxAllyGlobalIgnores","definePackageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","defineReactConfig","reactGlobalIgnores","defineStorybookConfig","storybookGlobalIgnores","defineTestingLibraryConfig","testingLibraryGlobalIgnores","defineTypeScriptConfig","typescriptGlobalIgnores","defineVitestConfig","vitestGlobalIgnores","defineYamlConfig","yamlGlobalIgnores","defineReactLibraryConfig","tsconfigRootDir","options","testFramework","core","jest","json","jsxAlly","packageJson","react","storybook","testingLibrary","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AAC6B;AACA;AACL;AACiB;AACgB;AACvD;AAC+B;AACgB;AACoB;AAChB;AAChB;AACR;AAiBzF;;;CAGC,GACM,SAASyB,yBAAyBC,eAAuB,EAAEC,UAA2C,CAAC,CAAC;IAC3G,MAAM,EACFC,gBAAgB,QAAQ,EACxBC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,KAAK,EACLC,SAAS,EACTC,cAAc,EACdC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGZ;IAEJ,OAAO3B,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;YACA;eACGC,iBAAiBA;eACjBG,iBAAiBA;eACjBE,iBAAiBA;eACjBE,oBAAoBA;eACpBE,wBAAwBA;eACxBG,kBAAkBA;eAClBE,sBAAsBA;eACtBE,2BAA2BA;eAC3BE,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACErB,gBAAgBA,CAAC0B;WACjBzB,gBAAgBA,CAAC;YAChB,GAAG0B,IAAI;YACP,SAASA,MAAM,WAAWF,kBAAkB;QAChD;WACGtB,gBAAgBA,CAACyB;WACjBvB,mBAAmBA,CAACwB;WACpBtB,uBAAuBA,CAACuB;WACxBpB,iBAAiBA,CAACqB;WAClBnB,qBAAqBA,CAACoB;WACtBlB,0BAA0BA,CAACmB;WAC3BjB,sBAAsBA,CAACO,iBAAiBW;QAC3C,sFAAsF;WAClFhB,kBAAkBA,CAAC;YACnB,GAAGiB,MAAM;YACT,SAASA,QAAQ,WAAWV,kBAAkB;QAElD;WACGL,gBAAgBA,CAACgB;QACpB;YACI,SAAS;gBACL,aAAa3B,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL"}
|
|
@@ -2,12 +2,13 @@ import { type CoreConfigOptions } from "../core.ts";
|
|
|
2
2
|
import { type JestConfigOptions } from "../jest.ts";
|
|
3
3
|
import { JsonConfigOptions } from "../json.ts";
|
|
4
4
|
import { type PackageJsonConfigOptions } from "../packageJson.ts";
|
|
5
|
-
import { type
|
|
5
|
+
import { type TypeScriptConfigOptions } from "../typescript.ts";
|
|
6
6
|
import { type VitestConfigOptions } from "../vitest.ts";
|
|
7
7
|
import { type YamlConfigOptions } from "../yaml.ts";
|
|
8
8
|
export interface DefineTypeScriptLibraryConfigOptions {
|
|
9
|
+
testFramework?: "vitest" | "jest";
|
|
9
10
|
core?: CoreConfigOptions;
|
|
10
|
-
typescript?:
|
|
11
|
+
typescript?: TypeScriptConfigOptions;
|
|
11
12
|
jest?: JestConfigOptions;
|
|
12
13
|
json?: JsonConfigOptions;
|
|
13
14
|
vitest?: VitestConfigOptions;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { coreGlobalIgnores, defineCoreConfig } from "../core.js";
|
|
3
|
+
import { defineJestConfig, jestGlobalIgnores } from "../jest.js";
|
|
4
|
+
import { defineJsonConfig, jsonGlobalIgnores } from "../json.js";
|
|
5
|
+
import { definePackageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
|
|
6
6
|
import { WorkleapPlugin } from "../plugins/workleapPlugin.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { defineTypeScriptConfig, typescriptGlobalIgnores } from "../typescript.js";
|
|
8
|
+
import { defineVitestConfig, vitestGlobalIgnores } from "../vitest.js";
|
|
9
|
+
import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
10
10
|
|
|
11
11
|
;// CONCATENATED MODULE: external "eslint/config"
|
|
12
12
|
|
|
@@ -40,7 +40,7 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
40
40
|
* @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.
|
|
41
41
|
* @param options An optional object of options for the ESlint core and plugins rules.
|
|
42
42
|
*/ function defineTypeScriptLibraryConfig(tsconfigRootDir, options = {}) {
|
|
43
|
-
const { core, jest, json, packageJson, typescript, vitest, yaml } = options;
|
|
43
|
+
const { testFramework = "vitest", core, jest, json, packageJson, typescript, vitest, yaml } = options;
|
|
44
44
|
return defineConfig([
|
|
45
45
|
// node_modules folder is ignored by default.
|
|
46
46
|
globalIgnores([
|
|
@@ -55,15 +55,20 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
55
55
|
...vitestGlobalIgnores,
|
|
56
56
|
...yamlGlobalIgnores
|
|
57
57
|
]),
|
|
58
|
-
...
|
|
59
|
-
...
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
...defineCoreConfig(core),
|
|
59
|
+
...defineJestConfig({
|
|
60
|
+
...jest,
|
|
61
|
+
enabled: jest?.enabled ?? testFramework === "jest"
|
|
62
|
+
}),
|
|
63
|
+
...defineJsonConfig(json),
|
|
64
|
+
...definePackageJsonConfig(packageJson),
|
|
65
|
+
...defineTypeScriptConfig(tsconfigRootDir, typescript),
|
|
63
66
|
// Temporary fix until the vitest plugin support defineConfig and the types are fixed.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
...defineVitestConfig({
|
|
68
|
+
...vitest,
|
|
69
|
+
enabled: vitest?.enabled ?? testFramework === "vitest"
|
|
70
|
+
}),
|
|
71
|
+
...defineYamlConfig(yaml),
|
|
67
72
|
{
|
|
68
73
|
plugins: {
|
|
69
74
|
"@workleap": WorkleapPlugin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"by-project-type/defineTypescriptLibraryConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineTypescriptLibraryConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport {
|
|
1
|
+
{"version":3,"file":"by-project-type/defineTypescriptLibraryConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineTypescriptLibraryConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { type CoreConfigOptions, coreGlobalIgnores, defineCoreConfig } from \"../core.ts\";\nimport { defineJestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { defineJsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { definePackageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { defineTypeScriptConfig, type TypeScriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { defineVitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { defineYamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineTypeScriptLibraryConfigOptions {\n testFramework?: \"vitest\" | \"jest\";\n core?: CoreConfigOptions;\n typescript?: TypeScriptConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n vitest?: VitestConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options: DefineTypeScriptLibraryConfigOptions = {}) {\n const {\n testFramework = \"vitest\",\n core,\n jest,\n json,\n packageJson,\n typescript,\n vitest,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \"**/__snapshots__/*\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...defineCoreConfig(core),\n ...defineJestConfig({\n ...jest,\n enabled: jest?.enabled ?? testFramework === \"jest\"\n }),\n ...defineJsonConfig(json),\n ...definePackageJsonConfig(packageJson),\n ...defineTypeScriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n ...(defineVitestConfig({\n ...vitest,\n enabled: vitest?.enabled ?? testFramework === \"vitest\"\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) as any),\n ...defineYamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreGlobalIgnores","defineCoreConfig","defineJestConfig","jestGlobalIgnores","defineJsonConfig","jsonGlobalIgnores","definePackageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","defineTypeScriptConfig","typescriptGlobalIgnores","defineVitestConfig","vitestGlobalIgnores","defineYamlConfig","yamlGlobalIgnores","defineTypeScriptLibraryConfig","tsconfigRootDir","options","testFramework","core","jest","json","packageJson","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AAC6B;AACA;AACL;AACiC;AACvD;AACmD;AAChB;AACR;AAazF;;;CAGC,GACM,SAASiB,8BAA8BC,eAAuB,EAAEC,UAAgD,CAAC,CAAC;IACrH,MAAM,EACFC,gBAAgB,QAAQ,EACxBC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,WAAW,EACXC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGR;IAEJ,OAAOnB,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;YACA;eACGC,iBAAiBA;eACjBG,iBAAiBA;eACjBE,iBAAiBA;eACjBE,wBAAwBA;eACxBG,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACEb,gBAAgBA,CAACkB;WACjBjB,gBAAgBA,CAAC;YAChB,GAAGkB,IAAI;YACP,SAASA,MAAM,WAAWF,kBAAkB;QAChD;WACGd,gBAAgBA,CAACiB;WACjBf,uBAAuBA,CAACgB;WACxBb,sBAAsBA,CAACO,iBAAiBO;QAC3C,sFAAsF;WAClFZ,kBAAkBA,CAAC;YACnB,GAAGa,MAAM;YACT,SAASA,QAAQ,WAAWN,kBAAkB;QAElD;WACGL,gBAAgBA,CAACY;QACpB;YACI,SAAS;gBACL,aAAajB,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL"}
|
|
@@ -6,10 +6,11 @@ import { type PackageJsonConfigOptions } from "../packageJson.ts";
|
|
|
6
6
|
import { type ReactConfigOptions } from "../react.ts";
|
|
7
7
|
import { type StorybookConfigOptions } from "../storybook.ts";
|
|
8
8
|
import { type TestingLibraryConfigOptions } from "../testingLibrary.ts";
|
|
9
|
-
import { type
|
|
9
|
+
import { type TypeScriptConfigOptions } from "../typescript.ts";
|
|
10
10
|
import { type VitestConfigOptions } from "../vitest.ts";
|
|
11
11
|
import { type YamlConfigOptions } from "../yaml.ts";
|
|
12
12
|
export interface DefineWebApplicationConfigOptions {
|
|
13
|
+
testFramework?: "vitest" | "jest";
|
|
13
14
|
core?: CoreConfigOptions;
|
|
14
15
|
jest?: JestConfigOptions;
|
|
15
16
|
json?: JsonConfigOptions;
|
|
@@ -18,7 +19,7 @@ export interface DefineWebApplicationConfigOptions {
|
|
|
18
19
|
react?: ReactConfigOptions;
|
|
19
20
|
storybook?: StorybookConfigOptions;
|
|
20
21
|
testingLibrary?: TestingLibraryConfigOptions;
|
|
21
|
-
typescript?:
|
|
22
|
+
typescript?: TypeScriptConfigOptions;
|
|
22
23
|
vitest?: VitestConfigOptions;
|
|
23
24
|
yaml?: YamlConfigOptions;
|
|
24
25
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { coreGlobalIgnores, defineCoreConfig } from "../core.js";
|
|
3
|
+
import { defineJestConfig, jestGlobalIgnores } from "../jest.js";
|
|
4
|
+
import { defineJsonConfig, jsonGlobalIgnores } from "../json.js";
|
|
5
|
+
import { defineJsxAllyConfig, jsxAllyGlobalIgnores } from "../jsxAlly.js";
|
|
6
|
+
import { definePackageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
|
|
7
7
|
import { WorkleapPlugin } from "../plugins/workleapPlugin.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import { defineReactConfig, reactGlobalIgnores } from "../react.js";
|
|
9
|
+
import { defineStorybookConfig, storybookGlobalIgnores } from "../storybook.js";
|
|
10
|
+
import { defineTestingLibraryConfig, testingLibraryGlobalIgnores } from "../testingLibrary.js";
|
|
11
|
+
import { defineTypeScriptConfig, typescriptGlobalIgnores } from "../typescript.js";
|
|
12
|
+
import { defineVitestConfig, vitestGlobalIgnores } from "../vitest.js";
|
|
13
|
+
import { defineYamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
14
14
|
|
|
15
15
|
;// CONCATENATED MODULE: external "eslint/config"
|
|
16
16
|
|
|
@@ -56,7 +56,7 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
56
56
|
* @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.
|
|
57
57
|
* @param options An optional object of options for the ESlint core and plugins rules.
|
|
58
58
|
*/ const defineWebApplicationConfig = (tsconfigRootDir, options = {})=>{
|
|
59
|
-
const { core, jest, json, jsxAlly, packageJson, react, storybook, testingLibrary, typescript, vitest, yaml } = options;
|
|
59
|
+
const { testFramework = "vitest", core, jest, json, jsxAlly, packageJson, react, storybook, testingLibrary, typescript, vitest, yaml } = options;
|
|
60
60
|
return defineConfig([
|
|
61
61
|
// node_modules folder is ignored by default.
|
|
62
62
|
globalIgnores([
|
|
@@ -75,19 +75,24 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
75
75
|
...vitestGlobalIgnores,
|
|
76
76
|
...yamlGlobalIgnores
|
|
77
77
|
]),
|
|
78
|
-
...
|
|
79
|
-
...
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
...
|
|
84
|
-
...
|
|
85
|
-
...
|
|
86
|
-
...
|
|
78
|
+
...defineCoreConfig(core),
|
|
79
|
+
...defineJestConfig({
|
|
80
|
+
...jest,
|
|
81
|
+
enabled: jest?.enabled ?? testFramework === "jest"
|
|
82
|
+
}),
|
|
83
|
+
...defineJsonConfig(json),
|
|
84
|
+
...defineJsxAllyConfig(jsxAlly),
|
|
85
|
+
...definePackageJsonConfig(packageJson),
|
|
86
|
+
...defineReactConfig(react),
|
|
87
|
+
...defineStorybookConfig(storybook),
|
|
88
|
+
...defineTestingLibraryConfig(testingLibrary),
|
|
89
|
+
...defineTypeScriptConfig(tsconfigRootDir, typescript),
|
|
87
90
|
// Temporary fix until the vitest plugin support defineConfig and the types are fixed.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
...defineVitestConfig({
|
|
92
|
+
...vitest,
|
|
93
|
+
enabled: vitest?.enabled ?? testFramework === "vitest"
|
|
94
|
+
}),
|
|
95
|
+
...defineYamlConfig(yaml),
|
|
91
96
|
{
|
|
92
97
|
plugins: {
|
|
93
98
|
"@workleap": WorkleapPlugin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"by-project-type/defineWebApplicationConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineWebApplicationConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport {
|
|
1
|
+
{"version":3,"file":"by-project-type/defineWebApplicationConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineWebApplicationConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { type CoreConfigOptions, coreGlobalIgnores, defineCoreConfig } from \"../core.ts\";\nimport { defineJestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { defineJsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { defineJsxAllyConfig, type JsxAllyConfigOptions, jsxAllyGlobalIgnores } from \"../jsxAlly.ts\";\nimport { definePackageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { defineReactConfig, type ReactConfigOptions, reactGlobalIgnores } from \"../react.ts\";\nimport { defineStorybookConfig, type StorybookConfigOptions, storybookGlobalIgnores } from \"../storybook.ts\";\nimport { defineTestingLibraryConfig, type TestingLibraryConfigOptions, testingLibraryGlobalIgnores } from \"../testingLibrary.ts\";\nimport { defineTypeScriptConfig, type TypeScriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { defineVitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { defineYamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineWebApplicationConfigOptions {\n testFramework?: \"vitest\" | \"jest\";\n core?: CoreConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n jsxAlly?: JsxAllyConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n react?: ReactConfigOptions;\n storybook?: StorybookConfigOptions;\n testingLibrary?: TestingLibraryConfigOptions;\n typescript?: TypeScriptConfigOptions;\n vitest?: VitestConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport const defineWebApplicationConfig = (tsconfigRootDir: string, options: DefineWebApplicationConfigOptions = {}) => {\n const {\n testFramework = \"vitest\",\n core,\n jest,\n json,\n jsxAlly,\n packageJson,\n react,\n storybook,\n testingLibrary,\n typescript,\n vitest,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \"**/__snapshots__/*\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...jsxAllyGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...reactGlobalIgnores,\n ...storybookGlobalIgnores,\n ...testingLibraryGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...defineCoreConfig(core),\n ...defineJestConfig({\n ...jest,\n enabled: jest?.enabled ?? testFramework === \"jest\"\n }),\n ...defineJsonConfig(json),\n ...defineJsxAllyConfig(jsxAlly),\n ...definePackageJsonConfig(packageJson),\n ...defineReactConfig(react),\n ...defineStorybookConfig(storybook),\n ...defineTestingLibraryConfig(testingLibrary),\n ...defineTypeScriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n ...(defineVitestConfig({\n ...vitest,\n enabled: vitest?.enabled ?? testFramework === \"vitest\"\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) as any),\n ...defineYamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n};\n"],"names":["defineConfig","globalIgnores","coreGlobalIgnores","defineCoreConfig","defineJestConfig","jestGlobalIgnores","defineJsonConfig","jsonGlobalIgnores","defineJsxAllyConfig","jsxAllyGlobalIgnores","definePackageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","defineReactConfig","reactGlobalIgnores","defineStorybookConfig","storybookGlobalIgnores","defineTestingLibraryConfig","testingLibraryGlobalIgnores","defineTypeScriptConfig","typescriptGlobalIgnores","defineVitestConfig","vitestGlobalIgnores","defineYamlConfig","yamlGlobalIgnores","defineWebApplicationConfig","tsconfigRootDir","options","testFramework","core","jest","json","jsxAlly","packageJson","react","storybook","testingLibrary","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AAC6B;AACA;AACL;AACiB;AACgB;AACvD;AAC+B;AACgB;AACoB;AAChB;AAChB;AACR;AAiBzF;;;CAGC,GACM,MAAMyB,6BAA6B,CAACC,iBAAyBC,UAA6C,CAAC,CAAC;IAC/G,MAAM,EACFC,gBAAgB,QAAQ,EACxBC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,KAAK,EACLC,SAAS,EACTC,cAAc,EACdC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGZ;IAEJ,OAAO3B,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;YACA;eACGC,iBAAiBA;eACjBG,iBAAiBA;eACjBE,iBAAiBA;eACjBE,oBAAoBA;eACpBE,wBAAwBA;eACxBG,kBAAkBA;eAClBE,sBAAsBA;eACtBE,2BAA2BA;eAC3BE,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACErB,gBAAgBA,CAAC0B;WACjBzB,gBAAgBA,CAAC;YAChB,GAAG0B,IAAI;YACP,SAASA,MAAM,WAAWF,kBAAkB;QAChD;WACGtB,gBAAgBA,CAACyB;WACjBvB,mBAAmBA,CAACwB;WACpBtB,uBAAuBA,CAACuB;WACxBpB,iBAAiBA,CAACqB;WAClBnB,qBAAqBA,CAACoB;WACtBlB,0BAA0BA,CAACmB;WAC3BjB,sBAAsBA,CAACO,iBAAiBW;QAC3C,sFAAsF;WAClFhB,kBAAkBA,CAAC;YACnB,GAAGiB,MAAM;YACT,SAASA,QAAQ,WAAWV,kBAAkB;QAElD;WACGL,gBAAgBA,CAACgB;QACpB;YACI,SAAS;gBACL,aAAa3B,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL,EAAE"}
|
package/dist/core.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export interface CoreConfigOptions {
|
|
|
4
4
|
rules?: Partial<Linter.RulesRecord>;
|
|
5
5
|
}
|
|
6
6
|
export declare const coreGlobalIgnores: never[];
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function defineCoreConfig(options?: CoreConfigOptions): ConfigWithExtends[];
|
package/dist/core.js
CHANGED
|
@@ -13,7 +13,7 @@ import globals from "globals";
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
const coreGlobalIgnores = [];
|
|
16
|
-
function
|
|
16
|
+
function defineCoreConfig(options = {}) {
|
|
17
17
|
const { rules } = options;
|
|
18
18
|
const config = [
|
|
19
19
|
{
|
|
@@ -145,6 +145,6 @@ function coreConfig(options = {}) {
|
|
|
145
145
|
return config;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
export {
|
|
148
|
+
export { coreGlobalIgnores, defineCoreConfig };
|
|
149
149
|
|
|
150
150
|
//# sourceMappingURL=core.js.map
|
package/dist/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sources":["webpack://@workleap/eslint-configs/./src/core.ts"],"sourcesContent":["import js from \"@eslint/js\";\nimport type { Linter } from \"eslint\";\nimport importPlugin from \"eslint-plugin-import\";\nimport globals from \"globals\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface CoreConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const coreGlobalIgnores = [];\n\nexport function
|
|
1
|
+
{"version":3,"file":"core.js","sources":["webpack://@workleap/eslint-configs/./src/core.ts"],"sourcesContent":["import js from \"@eslint/js\";\nimport type { Linter } from \"eslint\";\nimport importPlugin from \"eslint-plugin-import\";\nimport globals from \"globals\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface CoreConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const coreGlobalIgnores = [];\n\nexport function defineCoreConfig(options: CoreConfigOptions = {}) {\n const {\n rules\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/core\",\n files: [\n \"**/*.{js,jsx,ts,tsx,cjs,mjs}\"\n ],\n plugins: {\n js,\n import: importPlugin\n },\n extends: [\n js.configs.recommended\n ],\n languageOptions: {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n globals: {\n ...globals.browser,\n ...globals.es2024,\n ...globals.node,\n ...globals.commonjs\n }\n },\n rules: {\n // Recommended rules overrides\n \"no-cond-assign\": [\"error\", \"except-parens\"],\n \"no-labels\": [\"warn\", { allowLoop: true, allowSwitch: false }],\n \"no-prototype-builtins\": \"off\",\n\n // Possible problems\n \"array-callback-return\": \"error\",\n \"no-self-compare\": \"error\",\n \"no-template-curly-in-string\": \"error\",\n \"no-use-before-define\": [\n \"error\",\n {\n functions: false,\n classes: false,\n variables: false\n }\n ],\n\n // Suggestions\n curly: \"warn\",\n eqeqeq: [\"warn\", \"smart\"],\n \"no-array-constructor\": \"warn\",\n \"no-caller\": \"warn\",\n \"no-eval\": \"warn\",\n \"no-extend-native\": \"warn\",\n \"no-extra-bind\": \"warn\",\n \"no-extra-label\": \"warn\",\n \"no-implied-eval\": \"warn\",\n \"no-iterator\": \"warn\",\n \"no-label-var\": \"warn\",\n \"no-lone-blocks\": \"warn\",\n \"no-loop-func\": \"warn\",\n \"no-multi-str\": \"warn\",\n \"no-new-func\": \"warn\",\n // Deprecated but still no replacement in @stylistic.\n // \"no-new-object\": \"warn\",\n \"no-new-wrappers\": \"warn\",\n \"no-octal-escape\": \"warn\",\n \"no-param-reassign\": \"warn\",\n \"no-restricted-properties\": \"warn\",\n \"no-restricted-globals\": [\"error\"],\n \"no-restricted-syntax\": [\"error\", \"WithStatement\"],\n \"no-script-url\": \"warn\",\n \"no-sequences\": \"warn\",\n \"no-shadow\": \"warn\",\n \"no-throw-literal\": \"warn\",\n \"no-unneeded-ternary\": \"warn\",\n \"no-unused-expressions\": [\n \"error\",\n {\n allowShortCircuit: true,\n allowTernary: true,\n allowTaggedTemplates: true\n }\n ],\n \"no-useless-computed-key\": \"warn\",\n \"no-useless-concat\": \"warn\",\n \"no-useless-constructor\": \"warn\",\n \"no-useless-rename\": [\n \"warn\",\n {\n ignoreDestructuring: false,\n ignoreImport: false,\n ignoreExport: false\n }\n ],\n \"no-var\": \"warn\",\n \"prefer-const\": \"warn\",\n strict: [\"warn\", \"never\"],\n\n // Layout & Formatting\n \"unicode-bom\": [\"warn\", \"never\"],\n\n // https://github.com/import-js/eslint-plugin-import/tree/main/docs/rules\n \"import/newline-after-import\": \"warn\",\n \"import/no-amd\": \"error\",\n \"import/no-duplicates\": \"warn\",\n \"import/no-self-import\": \"error\",\n \"import/no-webpack-loader-syntax\": \"error\",\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["js","importPlugin","globals","coreGlobalIgnores","defineCoreConfig","options","rules","config"],"mappings":";;;;;;;;;;;AAA4B;AAEoB;AAClB;AAOvB,MAAMG,oBAAoB,EAAE,CAAC;AAE7B,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,MAAM,EACFC,KAAK,EACR,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLP,EAAEA,EAAAA,EAAAA;gBACF,QAAQC,oBAAYA;YACxB;YACA,SAAS;gBACLD,sBAAsB;aACzB;YACD,iBAAiB;gBACb,aAAa;gBACb,YAAY;gBACZ,SAAS;oBACL,GAAGE,eAAe;oBAClB,GAAGA,cAAc;oBACjB,GAAGA,YAAY;oBACf,GAAGA,gBAAgB;gBACvB;YACJ;YACA,OAAO;gBACH,8BAA8B;gBAC9B,kBAAkB;oBAAC;oBAAS;iBAAgB;gBAC5C,aAAa;oBAAC;oBAAQ;wBAAE,WAAW;wBAAM,aAAa;oBAAM;iBAAE;gBAC9D,yBAAyB;gBAEzB,oBAAoB;gBACpB,yBAAyB;gBACzB,mBAAmB;gBACnB,+BAA+B;gBAC/B,wBAAwB;oBACpB;oBACA;wBACI,WAAW;wBACX,SAAS;wBACT,WAAW;oBACf;iBACH;gBAED,cAAc;gBACd,OAAO;gBACP,QAAQ;oBAAC;oBAAQ;iBAAQ;gBACzB,wBAAwB;gBACxB,aAAa;gBACb,WAAW;gBACX,oBAAoB;gBACpB,iBAAiB;gBACjB,kBAAkB;gBAClB,mBAAmB;gBACnB,eAAe;gBACf,gBAAgB;gBAChB,kBAAkB;gBAClB,gBAAgB;gBAChB,gBAAgB;gBAChB,eAAe;gBACf,qDAAqD;gBACrD,2BAA2B;gBAC3B,mBAAmB;gBACnB,mBAAmB;gBACnB,qBAAqB;gBACrB,4BAA4B;gBAC5B,yBAAyB;oBAAC;iBAAQ;gBAClC,wBAAwB;oBAAC;oBAAS;iBAAgB;gBAClD,iBAAiB;gBACjB,gBAAgB;gBAChB,aAAa;gBACb,oBAAoB;gBACpB,uBAAuB;gBACvB,yBAAyB;oBACrB;oBACA;wBACI,mBAAmB;wBACnB,cAAc;wBACd,sBAAsB;oBAC1B;iBACH;gBACD,2BAA2B;gBAC3B,qBAAqB;gBACrB,0BAA0B;gBAC1B,qBAAqB;oBACjB;oBACA;wBACI,qBAAqB;wBACrB,cAAc;wBACd,cAAc;oBAClB;iBACH;gBACD,UAAU;gBACV,gBAAgB;gBAChB,QAAQ;oBAAC;oBAAQ;iBAAQ;gBAEzB,sBAAsB;gBACtB,eAAe;oBAAC;oBAAQ;iBAAQ;gBAEhC,yEAAyE;gBACzE,+BAA+B;gBAC/B,iBAAiB;gBACjB,wBAAwB;gBACxB,yBAAyB;gBACzB,mCAAmC;gBAEnC,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,14 +2,14 @@ export { defineMonorepoWorkspaceConfig, type DefineMonorepoWorkspaceConfigOption
|
|
|
2
2
|
export { defineReactLibraryConfig, type DefineReactLibraryConfigOptions } from "./by-project-type/defineReactLibraryConfig.ts";
|
|
3
3
|
export { defineTypeScriptLibraryConfig, type DefineTypeScriptLibraryConfigOptions } from "./by-project-type/defineTypescriptLibraryConfig.ts";
|
|
4
4
|
export { defineWebApplicationConfig, type DefineWebApplicationConfigOptions } from "./by-project-type/defineWebApplicationConfig.ts";
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
11
|
-
export type
|
|
5
|
+
export { defineCoreConfig, type CoreConfigOptions } from "./core.ts";
|
|
6
|
+
export { defineJestConfig, type JestConfigOptions } from "./jest.ts";
|
|
7
|
+
export { defineJsxAllyConfig, type JsxAllyConfigOptions } from "./jsxAlly.ts";
|
|
8
|
+
export { definePackageJsonConfig, type PackageJsonConfigOptions } from "./packageJson.ts";
|
|
9
|
+
export { defineReactConfig, type ReactConfigOptions } from "./react.ts";
|
|
10
|
+
export { defineStorybookConfig, type StorybookConfigOptions } from "./storybook.ts";
|
|
11
|
+
export { defineTestingLibraryConfig, type TestingLibraryConfigOptions } from "./testingLibrary.ts";
|
|
12
12
|
export type { ConfigWithExtends, ExtendsElement, InfiniteArray, SimpleExtendsElement } from "./types.ts";
|
|
13
|
-
export type
|
|
14
|
-
export type
|
|
15
|
-
export type
|
|
13
|
+
export { defineTypeScriptConfig, type TypeScriptConfigOptions } from "./typescript.ts";
|
|
14
|
+
export { defineVitestConfig, type VitestConfigOptions } from "./vitest.ts";
|
|
15
|
+
export { defineYamlConfig, type YamlConfigOptions } from "./yaml.ts";
|