@workleap/eslint-configs 0.0.3 → 0.0.4
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 +6 -0
- package/dist/by-project-type/defineMonorepoWorkspaceConfig.d.ts +2 -0
- package/dist/by-project-type/defineMonorepoWorkspaceConfig.js +8 -1
- package/dist/by-project-type/defineMonorepoWorkspaceConfig.js.map +1 -1
- package/dist/by-project-type/defineReactLibraryConfig.d.ts +2 -0
- package/dist/by-project-type/defineReactLibraryConfig.js +8 -1
- package/dist/by-project-type/defineReactLibraryConfig.js.map +1 -1
- package/dist/by-project-type/defineTypescriptLibraryConfig.d.ts +2 -0
- package/dist/by-project-type/defineTypescriptLibraryConfig.js +8 -1
- package/dist/by-project-type/defineTypescriptLibraryConfig.js.map +1 -1
- package/dist/by-project-type/defineWebApplicationConfig.d.ts +8 -6
- package/dist/by-project-type/defineWebApplicationConfig.js +8 -1
- package/dist/by-project-type/defineWebApplicationConfig.js.map +1 -1
- package/dist/json.d.ts +7 -0
- package/dist/json.js +34 -0
- package/dist/json.js.map +1 -0
- package/dist/packageJson.js +1 -1
- package/dist/packageJson.js.map +1 -1
- package/dist/typescript.js +4 -0
- package/dist/typescript.js.map +1 -1
- package/package.json +2 -1
- package/src/by-project-type/defineMonorepoWorkspaceConfig.ts +6 -0
- package/src/by-project-type/defineReactLibraryConfig.ts +6 -0
- package/src/by-project-type/defineTypescriptLibraryConfig.ts +6 -0
- package/src/by-project-type/defineWebApplicationConfig.ts +12 -6
- package/src/json.ts +32 -0
- package/src/packageJson.ts +1 -1
- package/src/typescript.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @workleap/eslint-configs
|
|
2
2
|
|
|
3
|
+
## 0.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#305](https://github.com/workleap/wl-web-configs/pull/305) [`563a04c`](https://github.com/workleap/wl-web-configs/commit/563a04c21b1c56ac08742c1eacdf7624fd7f548a) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Fine tuning ESLint rules.
|
|
8
|
+
|
|
3
9
|
## 0.0.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type CoreConfigOptions } from "../core.ts";
|
|
2
|
+
import { JsonConfigOptions } from "../json.ts";
|
|
2
3
|
import { type PackageJsonConfigOptions } from "../packageJson.ts";
|
|
3
4
|
import { type TypescriptConfigOptions } from "../typescript.ts";
|
|
4
5
|
import { type YamlConfigOptions } from "../yaml.ts";
|
|
5
6
|
export interface DefineMonorepoWorkspaceConfigOptions {
|
|
6
7
|
core?: CoreConfigOptions;
|
|
8
|
+
json?: JsonConfigOptions;
|
|
7
9
|
packageJson?: PackageJsonConfigOptions;
|
|
8
10
|
typescript?: TypescriptConfigOptions;
|
|
9
11
|
yaml?: YamlConfigOptions;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
2
|
import { coreConfig, coreGlobalIgnores } from "../core.js";
|
|
3
|
+
import { jsonConfig, jsonGlobalIgnores } from "../json.js";
|
|
3
4
|
import { packageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
|
|
4
5
|
import { typescriptConfig, typescriptGlobalIgnores } from "../typescript.js";
|
|
5
6
|
import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
@@ -8,6 +9,8 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
8
9
|
|
|
9
10
|
;// CONCATENATED MODULE: external "../core.js"
|
|
10
11
|
|
|
12
|
+
;// CONCATENATED MODULE: external "../json.js"
|
|
13
|
+
|
|
11
14
|
;// CONCATENATED MODULE: external "../packageJson.js"
|
|
12
15
|
|
|
13
16
|
;// CONCATENATED MODULE: external "../typescript.js"
|
|
@@ -20,21 +23,25 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
20
23
|
|
|
21
24
|
|
|
22
25
|
|
|
26
|
+
|
|
23
27
|
/**
|
|
24
28
|
* @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.
|
|
25
29
|
* @param options An optional object of options for the ESlint core and plugins rules.
|
|
26
30
|
*/ function defineMonorepoWorkspaceConfig(tsconfigRootDir, options = {}) {
|
|
27
|
-
const { core, packageJson, typescript, yaml } = options;
|
|
31
|
+
const { core, json, packageJson, typescript, yaml } = options;
|
|
28
32
|
return defineConfig([
|
|
29
33
|
// node_modules folder is ignored by default.
|
|
30
34
|
globalIgnores([
|
|
31
35
|
"dist",
|
|
36
|
+
".turbo",
|
|
32
37
|
...coreGlobalIgnores,
|
|
38
|
+
...jsonGlobalIgnores,
|
|
33
39
|
...packageJsonGlobalIgnores,
|
|
34
40
|
...typescriptGlobalIgnores,
|
|
35
41
|
...yamlGlobalIgnores
|
|
36
42
|
]),
|
|
37
43
|
...coreConfig(core),
|
|
44
|
+
...jsonConfig(json),
|
|
38
45
|
...packageJsonConfig(packageJson),
|
|
39
46
|
...typescriptConfig(tsconfigRootDir, typescript),
|
|
40
47
|
...yamlConfig(yaml),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"by-project-type/defineMonorepoWorkspaceConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineMonorepoWorkspaceConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from \"../core.ts\";\nimport { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineMonorepoWorkspaceConfigOptions {\n core?: CoreConfigOptions;\n 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 packageJson,\n typescript,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n ...coreGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...coreConfig(core),\n ...packageJsonConfig(packageJson),\n ...typescriptConfig(tsconfigRootDir, typescript),\n ...yamlConfig(yaml),\n {\n rules: {\n \"package-json/valid-version\": \"off\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreConfig","coreGlobalIgnores","packageJsonConfig","packageJsonGlobalIgnores","typescriptConfig","typescriptGlobalIgnores","yamlConfig","yamlGlobalIgnores","defineMonorepoWorkspaceConfig","tsconfigRootDir","options","core","packageJson","typescript","yaml"],"mappings":"
|
|
1
|
+
{"version":3,"file":"by-project-type/defineMonorepoWorkspaceConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineMonorepoWorkspaceConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from \"../core.ts\";\nimport { jsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineMonorepoWorkspaceConfigOptions {\n core?: CoreConfigOptions;\n json?: JsonConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n typescript?: TypescriptConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineMonorepoWorkspaceConfig(tsconfigRootDir: string, options: DefineMonorepoWorkspaceConfigOptions = {}) {\n const {\n core,\n json,\n packageJson,\n typescript,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \".turbo\",\n ...coreGlobalIgnores,\n ...jsonGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...coreConfig(core),\n ...jsonConfig(json),\n ...packageJsonConfig(packageJson),\n ...typescriptConfig(tsconfigRootDir, typescript),\n ...yamlConfig(yaml),\n {\n rules: {\n \"package-json/valid-version\": \"off\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreConfig","coreGlobalIgnores","jsonConfig","jsonGlobalIgnores","packageJsonConfig","packageJsonGlobalIgnores","typescriptConfig","typescriptGlobalIgnores","yamlConfig","yamlGlobalIgnores","defineMonorepoWorkspaceConfig","tsconfigRootDir","options","core","json","packageJson","typescript","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;AAA4D;AACuB;AACL;AACiC;AACJ;AACxB;AAUnF;;;CAGC,GACM,SAASY,8BAA8BC,eAAuB,EAAEC,UAAgD,CAAC,CAAC;IACrH,MAAM,EACFC,IAAI,EACJC,IAAI,EACJC,WAAW,EACXC,UAAU,EACVC,IAAI,EACP,GAAGL;IAEJ,OAAOd,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;eACGE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,wBAAwBA;eACxBE,uBAAuBA;eACvBE,iBAAiBA;SACvB;WACET,UAAUA,CAACa;WACXX,UAAUA,CAACY;WACXV,iBAAiBA,CAACW;WAClBT,gBAAgBA,CAACK,iBAAiBK;WAClCR,UAAUA,CAACS;QACd;YACI,OAAO;gBACH,8BAA8B;YAClC;QACJ;KACH;AACL"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CoreConfigOptions } from "../core.ts";
|
|
2
2
|
import { type JestConfigOptions } from "../jest.ts";
|
|
3
|
+
import { JsonConfigOptions } from "../json.ts";
|
|
3
4
|
import { type JsxAllyConfigOptions } from "../jsxAlly.ts";
|
|
4
5
|
import { type PackageJsonConfigOptions } from "../packageJson.ts";
|
|
5
6
|
import { type ReactConfigOptions } from "../react.ts";
|
|
@@ -11,6 +12,7 @@ import { type YamlConfigOptions } from "../yaml.ts";
|
|
|
11
12
|
export interface DefineReactLibraryConfigOptions {
|
|
12
13
|
core?: CoreConfigOptions;
|
|
13
14
|
jest?: JestConfigOptions;
|
|
15
|
+
json?: JsonConfigOptions;
|
|
14
16
|
jsxAlly?: JsxAllyConfigOptions;
|
|
15
17
|
packageJson?: PackageJsonConfigOptions;
|
|
16
18
|
react?: ReactConfigOptions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
2
|
import { coreConfig, coreGlobalIgnores } from "../core.js";
|
|
3
3
|
import { jestConfig, jestGlobalIgnores } from "../jest.js";
|
|
4
|
+
import { jsonConfig, jsonGlobalIgnores } from "../json.js";
|
|
4
5
|
import { jsxAllyConfig, jsxAllyGlobalIgnores } from "../jsxAlly.js";
|
|
5
6
|
import { packageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
|
|
6
7
|
import { WorkleapPlugin } from "../plugins/workleapPlugin.js";
|
|
@@ -17,6 +18,8 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
17
18
|
|
|
18
19
|
;// CONCATENATED MODULE: external "../jest.js"
|
|
19
20
|
|
|
21
|
+
;// CONCATENATED MODULE: external "../json.js"
|
|
22
|
+
|
|
20
23
|
;// CONCATENATED MODULE: external "../jsxAlly.js"
|
|
21
24
|
|
|
22
25
|
;// CONCATENATED MODULE: external "../packageJson.js"
|
|
@@ -48,17 +51,20 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
48
51
|
|
|
49
52
|
|
|
50
53
|
|
|
54
|
+
|
|
51
55
|
/**
|
|
52
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.
|
|
53
57
|
* @param options An optional object of options for the ESlint core and plugins rules.
|
|
54
58
|
*/ function defineReactLibraryConfig(tsconfigRootDir, options = {}) {
|
|
55
|
-
const { core, jest, jsxAlly, packageJson, react, storybook, testingLibrary, typescript, vitest, yaml } = options;
|
|
59
|
+
const { core, jest, json, jsxAlly, packageJson, react, storybook, testingLibrary, typescript, vitest, yaml } = options;
|
|
56
60
|
return defineConfig([
|
|
57
61
|
// node_modules folder is ignored by default.
|
|
58
62
|
globalIgnores([
|
|
59
63
|
"dist",
|
|
64
|
+
"**/__snapshots__/*",
|
|
60
65
|
...coreGlobalIgnores,
|
|
61
66
|
...jestGlobalIgnores,
|
|
67
|
+
...jsonGlobalIgnores,
|
|
62
68
|
...jsxAllyGlobalIgnores,
|
|
63
69
|
...packageJsonGlobalIgnores,
|
|
64
70
|
...reactGlobalIgnores,
|
|
@@ -70,6 +76,7 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
70
76
|
]),
|
|
71
77
|
...coreConfig(core),
|
|
72
78
|
...jestConfig(jest),
|
|
79
|
+
...jsonConfig(json),
|
|
73
80
|
...jsxAllyConfig(jsxAlly),
|
|
74
81
|
...packageJsonConfig(packageJson),
|
|
75
82
|
...reactConfig(react),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"by-project-type/defineReactLibraryConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineReactLibraryConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from \"../core.ts\";\nimport { jestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { jsxAllyConfig, type JsxAllyConfigOptions, jsxAllyGlobalIgnores } from \"../jsxAlly.ts\";\nimport { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { reactConfig, type ReactConfigOptions, reactGlobalIgnores } from \"../react.ts\";\nimport { storybookConfig, type StorybookConfigOptions, storybookGlobalIgnores } from \"../storybook.ts\";\nimport { testingLibraryConfig, type TestingLibraryConfigOptions, testingLibraryGlobalIgnores } from \"../testingLibrary.ts\";\nimport { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { vitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineReactLibraryConfigOptions {\n core?: CoreConfigOptions;\n jest?: JestConfigOptions;\n jsxAlly?: JsxAllyConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n react?: ReactConfigOptions;\n storybook?: StorybookConfigOptions;\n testingLibrary?: TestingLibraryConfigOptions;\n typescript?: TypescriptConfigOptions;\n vitest?: VitestConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineReactLibraryConfig(tsconfigRootDir: string, options: DefineReactLibraryConfigOptions = {}) {\n const {\n core,\n jest,\n 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 ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsxAllyGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...reactGlobalIgnores,\n ...storybookGlobalIgnores,\n ...testingLibraryGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...coreConfig(core),\n ...jestConfig(jest),\n ...jsxAllyConfig(jsxAlly),\n ...packageJsonConfig(packageJson),\n ...reactConfig(react),\n ...storybookConfig(storybook),\n ...testingLibraryConfig(testingLibrary),\n ...typescriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(vitestConfig(vitest) as any),\n ...yamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreConfig","coreGlobalIgnores","jestConfig","jestGlobalIgnores","jsxAllyConfig","jsxAllyGlobalIgnores","packageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","reactConfig","reactGlobalIgnores","storybookConfig","storybookGlobalIgnores","testingLibraryConfig","testingLibraryGlobalIgnores","typescriptConfig","typescriptGlobalIgnores","vitestConfig","vitestGlobalIgnores","yamlConfig","yamlGlobalIgnores","defineReactLibraryConfig","tsconfigRootDir","options","core","jest","jsxAlly","packageJson","react","storybook","testingLibrary","typescript","vitest","yaml"],"mappings":"
|
|
1
|
+
{"version":3,"file":"by-project-type/defineReactLibraryConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineReactLibraryConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from \"../core.ts\";\nimport { jestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { jsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { jsxAllyConfig, type JsxAllyConfigOptions, jsxAllyGlobalIgnores } from \"../jsxAlly.ts\";\nimport { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { reactConfig, type ReactConfigOptions, reactGlobalIgnores } from \"../react.ts\";\nimport { storybookConfig, type StorybookConfigOptions, storybookGlobalIgnores } from \"../storybook.ts\";\nimport { testingLibraryConfig, type TestingLibraryConfigOptions, testingLibraryGlobalIgnores } from \"../testingLibrary.ts\";\nimport { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { vitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineReactLibraryConfigOptions {\n core?: CoreConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n jsxAlly?: JsxAllyConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n react?: ReactConfigOptions;\n storybook?: StorybookConfigOptions;\n testingLibrary?: TestingLibraryConfigOptions;\n typescript?: TypescriptConfigOptions;\n vitest?: VitestConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineReactLibraryConfig(tsconfigRootDir: string, options: DefineReactLibraryConfigOptions = {}) {\n const {\n core,\n jest,\n json,\n jsxAlly,\n packageJson,\n react,\n storybook,\n testingLibrary,\n typescript,\n vitest,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \"**/__snapshots__/*\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...jsxAllyGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...reactGlobalIgnores,\n ...storybookGlobalIgnores,\n ...testingLibraryGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...coreConfig(core),\n ...jestConfig(jest),\n ...jsonConfig(json),\n ...jsxAllyConfig(jsxAlly),\n ...packageJsonConfig(packageJson),\n ...reactConfig(react),\n ...storybookConfig(storybook),\n ...testingLibraryConfig(testingLibrary),\n ...typescriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(vitestConfig(vitest) as any),\n ...yamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreConfig","coreGlobalIgnores","jestConfig","jestGlobalIgnores","jsonConfig","jsonGlobalIgnores","jsxAllyConfig","jsxAllyGlobalIgnores","packageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","reactConfig","reactGlobalIgnores","storybookConfig","storybookGlobalIgnores","testingLibraryConfig","testingLibraryGlobalIgnores","typescriptConfig","typescriptGlobalIgnores","vitestConfig","vitestGlobalIgnores","yamlConfig","yamlGlobalIgnores","defineReactLibraryConfig","tsconfigRootDir","options","core","jest","json","jsxAlly","packageJson","react","storybook","testingLibrary","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AACuB;AACA;AACL;AACiB;AACgB;AACjD;AACyB;AACgB;AACoB;AAChB;AAChB;AACR;AAgBnF;;;CAGC,GACM,SAASyB,yBAAyBC,eAAuB,EAAEC,UAA2C,CAAC,CAAC;IAC3G,MAAM,EACFC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,KAAK,EACLC,SAAS,EACTC,cAAc,EACdC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGX;IAEJ,OAAO3B,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;eACGE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,oBAAoBA;eACpBE,wBAAwBA;eACxBG,kBAAkBA;eAClBE,sBAAsBA;eACtBE,2BAA2BA;eAC3BE,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACEtB,UAAUA,CAAC0B;WACXxB,UAAUA,CAACyB;WACXvB,UAAUA,CAACwB;WACXtB,aAAaA,CAACuB;WACdrB,iBAAiBA,CAACsB;WAClBnB,WAAWA,CAACoB;WACZlB,eAAeA,CAACmB;WAChBjB,oBAAoBA,CAACkB;WACrBhB,gBAAgBA,CAACO,iBAAiBU;QACrC,sFAAsF;QACtF,8DAA8D;WAC1Df,YAAYA,CAACgB;WACdd,UAAUA,CAACe;QACd;YACI,SAAS;gBACL,aAAa1B,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CoreConfigOptions } from "../core.ts";
|
|
2
2
|
import { type JestConfigOptions } from "../jest.ts";
|
|
3
|
+
import { JsonConfigOptions } from "../json.ts";
|
|
3
4
|
import { type PackageJsonConfigOptions } from "../packageJson.ts";
|
|
4
5
|
import { type TypescriptConfigOptions } from "../typescript.ts";
|
|
5
6
|
import { type VitestConfigOptions } from "../vitest.ts";
|
|
@@ -8,6 +9,7 @@ export interface DefineTypeScriptLibraryConfigOptions {
|
|
|
8
9
|
core?: CoreConfigOptions;
|
|
9
10
|
typescript?: TypescriptConfigOptions;
|
|
10
11
|
jest?: JestConfigOptions;
|
|
12
|
+
json?: JsonConfigOptions;
|
|
11
13
|
vitest?: VitestConfigOptions;
|
|
12
14
|
packageJson?: PackageJsonConfigOptions;
|
|
13
15
|
yaml?: YamlConfigOptions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
2
|
import { coreConfig, coreGlobalIgnores } from "../core.js";
|
|
3
3
|
import { jestConfig, jestGlobalIgnores } from "../jest.js";
|
|
4
|
+
import { jsonConfig, jsonGlobalIgnores } from "../json.js";
|
|
4
5
|
import { packageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
|
|
5
6
|
import { WorkleapPlugin } from "../plugins/workleapPlugin.js";
|
|
6
7
|
import { typescriptConfig, typescriptGlobalIgnores } from "../typescript.js";
|
|
@@ -13,6 +14,8 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
13
14
|
|
|
14
15
|
;// CONCATENATED MODULE: external "../jest.js"
|
|
15
16
|
|
|
17
|
+
;// CONCATENATED MODULE: external "../json.js"
|
|
18
|
+
|
|
16
19
|
;// CONCATENATED MODULE: external "../packageJson.js"
|
|
17
20
|
|
|
18
21
|
;// CONCATENATED MODULE: external "../plugins/workleapPlugin.js"
|
|
@@ -32,17 +35,20 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
32
35
|
|
|
33
36
|
|
|
34
37
|
|
|
38
|
+
|
|
35
39
|
/**
|
|
36
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.
|
|
37
41
|
* @param options An optional object of options for the ESlint core and plugins rules.
|
|
38
42
|
*/ function defineTypeScriptLibraryConfig(tsconfigRootDir, options = {}) {
|
|
39
|
-
const { core, jest, packageJson, typescript, vitest, yaml } = options;
|
|
43
|
+
const { core, jest, json, packageJson, typescript, vitest, yaml } = options;
|
|
40
44
|
return defineConfig([
|
|
41
45
|
// node_modules folder is ignored by default.
|
|
42
46
|
globalIgnores([
|
|
43
47
|
"dist",
|
|
48
|
+
"**/__snapshots__/*",
|
|
44
49
|
...coreGlobalIgnores,
|
|
45
50
|
...jestGlobalIgnores,
|
|
51
|
+
...jsonGlobalIgnores,
|
|
46
52
|
...packageJsonGlobalIgnores,
|
|
47
53
|
...typescriptGlobalIgnores,
|
|
48
54
|
...vitestGlobalIgnores,
|
|
@@ -50,6 +56,7 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
50
56
|
]),
|
|
51
57
|
...coreConfig(core),
|
|
52
58
|
...jestConfig(jest),
|
|
59
|
+
...jsonConfig(json),
|
|
53
60
|
...packageJsonConfig(packageJson),
|
|
54
61
|
...typescriptConfig(tsconfigRootDir, typescript),
|
|
55
62
|
// Temporary fix until the vitest plugin support defineConfig and the types are fixed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"by-project-type/defineTypescriptLibraryConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineTypescriptLibraryConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from \"../core.ts\";\nimport { jestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { vitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineTypeScriptLibraryConfigOptions {\n core?: CoreConfigOptions;\n typescript?: TypescriptConfigOptions;\n jest?: JestConfigOptions;\n vitest?: VitestConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options: DefineTypeScriptLibraryConfigOptions = {}) {\n const {\n core,\n jest,\n 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 ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...coreConfig(core),\n ...jestConfig(jest),\n ...packageJsonConfig(packageJson),\n ...typescriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(vitestConfig(vitest) as any),\n ...yamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreConfig","coreGlobalIgnores","jestConfig","jestGlobalIgnores","packageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","typescriptConfig","typescriptGlobalIgnores","vitestConfig","vitestGlobalIgnores","yamlConfig","yamlGlobalIgnores","defineTypeScriptLibraryConfig","tsconfigRootDir","options","core","jest","packageJson","typescript","vitest","yaml"],"mappings":"
|
|
1
|
+
{"version":3,"file":"by-project-type/defineTypescriptLibraryConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineTypescriptLibraryConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from \"../core.ts\";\nimport { jestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { jsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { vitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\nexport interface DefineTypeScriptLibraryConfigOptions {\n core?: CoreConfigOptions;\n typescript?: TypescriptConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n vitest?: VitestConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options: DefineTypeScriptLibraryConfigOptions = {}) {\n const {\n core,\n jest,\n json,\n packageJson,\n typescript,\n vitest,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \"**/__snapshots__/*\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...coreConfig(core),\n ...jestConfig(jest),\n ...jsonConfig(json),\n ...packageJsonConfig(packageJson),\n ...typescriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(vitestConfig(vitest) as any),\n ...yamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n}\n"],"names":["defineConfig","globalIgnores","coreConfig","coreGlobalIgnores","jestConfig","jestGlobalIgnores","jsonConfig","jsonGlobalIgnores","packageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","typescriptConfig","typescriptGlobalIgnores","vitestConfig","vitestGlobalIgnores","yamlConfig","yamlGlobalIgnores","defineTypeScriptLibraryConfig","tsconfigRootDir","options","core","jest","json","packageJson","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AACuB;AACA;AACL;AACiC;AACjD;AAC6C;AAChB;AACR;AAYnF;;;CAGC,GACM,SAASiB,8BAA8BC,eAAuB,EAAEC,UAAgD,CAAC,CAAC;IACrH,MAAM,EACFC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,WAAW,EACXC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGP;IAEJ,OAAOnB,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;eACGE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,wBAAwBA;eACxBG,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACEd,UAAUA,CAACkB;WACXhB,UAAUA,CAACiB;WACXf,UAAUA,CAACgB;WACXd,iBAAiBA,CAACe;WAClBZ,gBAAgBA,CAACO,iBAAiBM;QACrC,sFAAsF;QACtF,8DAA8D;WAC1DX,YAAYA,CAACY;WACdV,UAAUA,CAACW;QACd;YACI,SAAS;gBACL,aAAahB,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CoreConfigOptions } from "../core.ts";
|
|
2
2
|
import { type JestConfigOptions } from "../jest.ts";
|
|
3
|
+
import { JsonConfigOptions } from "../json.ts";
|
|
3
4
|
import { type JsxAllyConfigOptions } from "../jsxAlly.ts";
|
|
4
5
|
import { type PackageJsonConfigOptions } from "../packageJson.ts";
|
|
5
6
|
import { type ReactConfigOptions } from "../react.ts";
|
|
@@ -10,14 +11,15 @@ import { type VitestConfigOptions } from "../vitest.ts";
|
|
|
10
11
|
import { type YamlConfigOptions } from "../yaml.ts";
|
|
11
12
|
export interface DefineWebApplicationConfigOptions {
|
|
12
13
|
core?: CoreConfigOptions;
|
|
13
|
-
typescript?: TypescriptConfigOptions;
|
|
14
|
-
react?: ReactConfigOptions;
|
|
15
|
-
jsxAlly?: JsxAllyConfigOptions;
|
|
16
14
|
jest?: JestConfigOptions;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
storybook?: StorybookConfigOptions;
|
|
15
|
+
json?: JsonConfigOptions;
|
|
16
|
+
jsxAlly?: JsxAllyConfigOptions;
|
|
20
17
|
packageJson?: PackageJsonConfigOptions;
|
|
18
|
+
react?: ReactConfigOptions;
|
|
19
|
+
storybook?: StorybookConfigOptions;
|
|
20
|
+
testingLibrary?: TestingLibraryConfigOptions;
|
|
21
|
+
typescript?: TypescriptConfigOptions;
|
|
22
|
+
vitest?: VitestConfigOptions;
|
|
21
23
|
yaml?: YamlConfigOptions;
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
2
|
import { coreConfig, coreGlobalIgnores } from "../core.js";
|
|
3
3
|
import { jestConfig, jestGlobalIgnores } from "../jest.js";
|
|
4
|
+
import { jsonConfig, jsonGlobalIgnores } from "../json.js";
|
|
4
5
|
import { jsxAllyConfig, jsxAllyGlobalIgnores } from "../jsxAlly.js";
|
|
5
6
|
import { packageJsonConfig, packageJsonGlobalIgnores } from "../packageJson.js";
|
|
6
7
|
import { WorkleapPlugin } from "../plugins/workleapPlugin.js";
|
|
@@ -17,6 +18,8 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
17
18
|
|
|
18
19
|
;// CONCATENATED MODULE: external "../jest.js"
|
|
19
20
|
|
|
21
|
+
;// CONCATENATED MODULE: external "../json.js"
|
|
22
|
+
|
|
20
23
|
;// CONCATENATED MODULE: external "../jsxAlly.js"
|
|
21
24
|
|
|
22
25
|
;// CONCATENATED MODULE: external "../packageJson.js"
|
|
@@ -48,17 +51,20 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
48
51
|
|
|
49
52
|
|
|
50
53
|
|
|
54
|
+
|
|
51
55
|
/**
|
|
52
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.
|
|
53
57
|
* @param options An optional object of options for the ESlint core and plugins rules.
|
|
54
58
|
*/ const defineWebApplicationConfig = (tsconfigRootDir, options = {})=>{
|
|
55
|
-
const { core, jest, jsxAlly, packageJson, react, storybook, testingLibrary, typescript, vitest, yaml } = options;
|
|
59
|
+
const { core, jest, json, jsxAlly, packageJson, react, storybook, testingLibrary, typescript, vitest, yaml } = options;
|
|
56
60
|
return defineConfig([
|
|
57
61
|
// node_modules folder is ignored by default.
|
|
58
62
|
globalIgnores([
|
|
59
63
|
"dist",
|
|
64
|
+
"**/__snapshots__/*",
|
|
60
65
|
...coreGlobalIgnores,
|
|
61
66
|
...jestGlobalIgnores,
|
|
67
|
+
...jsonGlobalIgnores,
|
|
62
68
|
...jsxAllyGlobalIgnores,
|
|
63
69
|
...packageJsonGlobalIgnores,
|
|
64
70
|
...reactGlobalIgnores,
|
|
@@ -70,6 +76,7 @@ import { yamlConfig, yamlGlobalIgnores } from "../yaml.js";
|
|
|
70
76
|
]),
|
|
71
77
|
...coreConfig(core),
|
|
72
78
|
...jestConfig(jest),
|
|
79
|
+
...jsonConfig(json),
|
|
73
80
|
...jsxAllyConfig(jsxAlly),
|
|
74
81
|
...packageJsonConfig(packageJson),
|
|
75
82
|
...reactConfig(react),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"by-project-type/defineWebApplicationConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineWebApplicationConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from \"../core.ts\";\nimport { jestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { jsxAllyConfig, type JsxAllyConfigOptions, jsxAllyGlobalIgnores } from \"../jsxAlly.ts\";\nimport { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { reactConfig, type ReactConfigOptions, reactGlobalIgnores } from \"../react.ts\";\nimport { storybookConfig, type StorybookConfigOptions, storybookGlobalIgnores } from \"../storybook.ts\";\nimport { testingLibraryConfig, type TestingLibraryConfigOptions, testingLibraryGlobalIgnores } from \"../testingLibrary.ts\";\nimport { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { vitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\n/*\n\nThe WHY for the interface instead of using nested \"extends\".\n\n1- ESlint flat config doesn't support nested \"extends\":\n\nEach configuration object may have an extends key, but only at the top level — not inside another config that already came from an extends.\n\nFlat config was designed to be explicitly ordered and fully expanded:\n\n- \"extends\" in flat config is syntactic sugar for concatenating multiple config objects.\n- Allowing recursion would make config evaluation order ambiguous and slow.\n\nSo ESLint enforces a one-level-deep rule:\n\n- only a top-level config object can have extends.\n\n2- Each object in the array is evaluated independently. \"plugins\" declared in one object are not inherited by the next object.\nSo when a second object sets the rule using a plugin \"xyz\", it doesn’t \"see\" the plugin \"xyz\" that’s defined inside a predefine config, and ESLint throws.\n\n3- Trying to redefine a plugin that as already been define in a configuration object will throw: Cannot redefine plugin \"xyz\".\n\n*/\n\n/*\n\nerror Parsing error: C:\\Dev\\workleap\\wl-web-configs\\samples\\storybook\\rsbuild\\.storybook\\main.ts was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject\n\n-> It usually means that the project tsconfig.json file cannot find the specified file\n-> Make sure to clear the ESLint cache after such an error because update the tsconfig.json file doesn't invalidate the ESLint cache\n\n*/\n\nexport interface DefineWebApplicationConfigOptions {\n core?: CoreConfigOptions;\n
|
|
1
|
+
{"version":3,"file":"by-project-type/defineWebApplicationConfig.js","sources":["webpack://@workleap/eslint-configs/./src/by-project-type/defineWebApplicationConfig.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from \"../core.ts\";\nimport { jestConfig, type JestConfigOptions, jestGlobalIgnores } from \"../jest.ts\";\nimport { jsonConfig, JsonConfigOptions, jsonGlobalIgnores } from \"../json.ts\";\nimport { jsxAllyConfig, type JsxAllyConfigOptions, jsxAllyGlobalIgnores } from \"../jsxAlly.ts\";\nimport { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from \"../packageJson.ts\";\nimport { WorkleapPlugin } from \"../plugins/workleapPlugin.ts\";\nimport { reactConfig, type ReactConfigOptions, reactGlobalIgnores } from \"../react.ts\";\nimport { storybookConfig, type StorybookConfigOptions, storybookGlobalIgnores } from \"../storybook.ts\";\nimport { testingLibraryConfig, type TestingLibraryConfigOptions, testingLibraryGlobalIgnores } from \"../testingLibrary.ts\";\nimport { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from \"../typescript.ts\";\nimport { vitestConfig, type VitestConfigOptions, vitestGlobalIgnores } from \"../vitest.ts\";\nimport { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from \"../yaml.ts\";\n\n/*\n\nThe WHY for the interface instead of using nested \"extends\".\n\n1- ESlint flat config doesn't support nested \"extends\":\n\nEach configuration object may have an extends key, but only at the top level — not inside another config that already came from an extends.\n\nFlat config was designed to be explicitly ordered and fully expanded:\n\n- \"extends\" in flat config is syntactic sugar for concatenating multiple config objects.\n- Allowing recursion would make config evaluation order ambiguous and slow.\n\nSo ESLint enforces a one-level-deep rule:\n\n- only a top-level config object can have extends.\n\n2- Each object in the array is evaluated independently. \"plugins\" declared in one object are not inherited by the next object.\nSo when a second object sets the rule using a plugin \"xyz\", it doesn’t \"see\" the plugin \"xyz\" that’s defined inside a predefine config, and ESLint throws.\n\n3- Trying to redefine a plugin that as already been define in a configuration object will throw: Cannot redefine plugin \"xyz\".\n\n*/\n\n/*\n\nerror Parsing error: C:\\Dev\\workleap\\wl-web-configs\\samples\\storybook\\rsbuild\\.storybook\\main.ts was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject\n\n-> It usually means that the project tsconfig.json file cannot find the specified file\n-> Make sure to clear the ESLint cache after such an error because update the tsconfig.json file doesn't invalidate the ESLint cache\n\n*/\n\nexport interface DefineWebApplicationConfigOptions {\n core?: CoreConfigOptions;\n jest?: JestConfigOptions;\n json?: JsonConfigOptions;\n jsxAlly?: JsxAllyConfigOptions;\n packageJson?: PackageJsonConfigOptions;\n react?: ReactConfigOptions;\n storybook?: StorybookConfigOptions;\n testingLibrary?: TestingLibraryConfigOptions;\n typescript?: TypescriptConfigOptions;\n vitest?: VitestConfigOptions;\n yaml?: YamlConfigOptions;\n}\n\n/**\n * @param tsconfigRootDir The directory of the tsconfig file to use for rules that needs a TypeScript type check: https://typescript-eslint.io/packages/parser/#tsconfigrootdir.\n * @param options An optional object of options for the ESlint core and plugins rules.\n */\nexport const defineWebApplicationConfig = (tsconfigRootDir: string, options: DefineWebApplicationConfigOptions = {}) => {\n const {\n core,\n jest,\n json,\n jsxAlly,\n packageJson,\n react,\n storybook,\n testingLibrary,\n typescript,\n vitest,\n yaml\n } = options;\n\n return defineConfig([\n // node_modules folder is ignored by default.\n globalIgnores([\n \"dist\",\n \"**/__snapshots__/*\",\n ...coreGlobalIgnores,\n ...jestGlobalIgnores,\n ...jsonGlobalIgnores,\n ...jsxAllyGlobalIgnores,\n ...packageJsonGlobalIgnores,\n ...reactGlobalIgnores,\n ...storybookGlobalIgnores,\n ...testingLibraryGlobalIgnores,\n ...typescriptGlobalIgnores,\n ...vitestGlobalIgnores,\n ...yamlGlobalIgnores\n ]),\n ...coreConfig(core),\n ...jestConfig(jest),\n ...jsonConfig(json),\n ...jsxAllyConfig(jsxAlly),\n ...packageJsonConfig(packageJson),\n ...reactConfig(react),\n ...storybookConfig(storybook),\n ...testingLibraryConfig(testingLibrary),\n ...typescriptConfig(tsconfigRootDir, typescript),\n // Temporary fix until the vitest plugin support defineConfig and the types are fixed.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(vitestConfig(vitest) as any),\n ...yamlConfig(yaml),\n {\n plugins: {\n \"@workleap\": WorkleapPlugin\n },\n rules: {\n \"@workleap/strict-css-modules-names\": \"warn\"\n }\n }\n ]);\n};\n"],"names":["defineConfig","globalIgnores","coreConfig","coreGlobalIgnores","jestConfig","jestGlobalIgnores","jsonConfig","jsonGlobalIgnores","jsxAllyConfig","jsxAllyGlobalIgnores","packageJsonConfig","packageJsonGlobalIgnores","WorkleapPlugin","reactConfig","reactGlobalIgnores","storybookConfig","storybookGlobalIgnores","testingLibraryConfig","testingLibraryGlobalIgnores","typescriptConfig","typescriptGlobalIgnores","vitestConfig","vitestGlobalIgnores","yamlConfig","yamlGlobalIgnores","defineWebApplicationConfig","tsconfigRootDir","options","core","jest","json","jsxAlly","packageJson","react","storybook","testingLibrary","typescript","vitest","yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA4D;AACuB;AACA;AACL;AACiB;AACgB;AACjD;AACyB;AACgB;AACoB;AAChB;AAChB;AACR;AAiDnF;;;CAGC,GACM,MAAMyB,6BAA6B,CAACC,iBAAyBC,UAA6C,CAAC,CAAC;IAC/G,MAAM,EACFC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,KAAK,EACLC,SAAS,EACTC,cAAc,EACdC,UAAU,EACVC,MAAM,EACNC,IAAI,EACP,GAAGX;IAEJ,OAAO3B,YAAYA,CAAC;QAChB,6CAA6C;QAC7CC,aAAaA,CAAC;YACV;YACA;eACGE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,iBAAiBA;eACjBE,oBAAoBA;eACpBE,wBAAwBA;eACxBG,kBAAkBA;eAClBE,sBAAsBA;eACtBE,2BAA2BA;eAC3BE,uBAAuBA;eACvBE,mBAAmBA;eACnBE,iBAAiBA;SACvB;WACEtB,UAAUA,CAAC0B;WACXxB,UAAUA,CAACyB;WACXvB,UAAUA,CAACwB;WACXtB,aAAaA,CAACuB;WACdrB,iBAAiBA,CAACsB;WAClBnB,WAAWA,CAACoB;WACZlB,eAAeA,CAACmB;WAChBjB,oBAAoBA,CAACkB;WACrBhB,gBAAgBA,CAACO,iBAAiBU;QACrC,sFAAsF;QACtF,8DAA8D;WAC1Df,YAAYA,CAACgB;WACdd,UAAUA,CAACe;QACd;YACI,SAAS;gBACL,aAAa1B,cAAcA;YAC/B;YACA,OAAO;gBACH,sCAAsC;YAC1C;QACJ;KACH;AACL,EAAE"}
|
package/dist/json.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Linter } from "eslint";
|
|
2
|
+
import type { ConfigWithExtends } from "./types.ts";
|
|
3
|
+
export interface JsonConfigOptions {
|
|
4
|
+
rules?: Partial<Linter.RulesRecord>;
|
|
5
|
+
}
|
|
6
|
+
export declare const jsonGlobalIgnores: never[];
|
|
7
|
+
export declare function jsonConfig(options?: JsonConfigOptions): ConfigWithExtends[];
|
package/dist/json.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import eslint_plugin_jsonc from "eslint-plugin-jsonc";
|
|
2
|
+
|
|
3
|
+
;// CONCATENATED MODULE: external "eslint-plugin-jsonc"
|
|
4
|
+
|
|
5
|
+
;// CONCATENATED MODULE: ./src/json.ts
|
|
6
|
+
|
|
7
|
+
const jsonGlobalIgnores = [];
|
|
8
|
+
function jsonConfig(options = {}) {
|
|
9
|
+
const { rules = {} } = options;
|
|
10
|
+
const config = [
|
|
11
|
+
{
|
|
12
|
+
name: "@workleap/eslint-configs/json",
|
|
13
|
+
files: [
|
|
14
|
+
"**/*.{json,jsonc}"
|
|
15
|
+
],
|
|
16
|
+
extends: [
|
|
17
|
+
eslint_plugin_jsonc.configs["flat/base"]
|
|
18
|
+
],
|
|
19
|
+
rules: {
|
|
20
|
+
"jsonc/indent": [
|
|
21
|
+
"warn",
|
|
22
|
+
4
|
|
23
|
+
],
|
|
24
|
+
// Positioned last to allow the consumer to override any rules.
|
|
25
|
+
...rules
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
return config;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { jsonConfig, jsonGlobalIgnores };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=json.js.map
|
package/dist/json.js.map
ADDED
|
@@ -0,0 +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 jsonConfig(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","jsonConfig","options","rules","config"],"mappings":";;;;;AAC8C;AAOvC,MAAMC,oBAAoB,EAAE,CAAC;AAE7B,SAASC,WAAWC,UAA6B,CAAC,CAAC;IACtD,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;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"}
|
package/dist/packageJson.js
CHANGED
package/dist/packageJson.js.map
CHANGED
|
@@ -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 packageJsonConfig(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 \"
|
|
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 packageJsonConfig(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 // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["packageJsonPlugin","packageJsonGlobalIgnores","packageJsonConfig","options","rules","config"],"mappings":";;;;;AAC2D;AAOpD,MAAMC,2BAA2B,EAAE,CAAC;AAEpC,SAASC,kBAAkBC,UAAoC,CAAC,CAAC;IACpE,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,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
|
package/dist/typescript.js
CHANGED
|
@@ -75,10 +75,13 @@ function typescriptConfig(tsconfigRootDir, options = {}) {
|
|
|
75
75
|
}
|
|
76
76
|
],
|
|
77
77
|
"@typescript-eslint/no-floating-promises": "off",
|
|
78
|
+
// This rule should be enabled but has several options that need to be investigated.
|
|
79
|
+
"@typescript-eslint/no-misused-promises": "off",
|
|
78
80
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
79
81
|
"@typescript-eslint/no-unsafe-argument": "off",
|
|
80
82
|
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
81
83
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
84
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
82
85
|
"@typescript-eslint/only-throw-error": "off",
|
|
83
86
|
"@typescript-eslint/prefer-nullish-coalescing": "off",
|
|
84
87
|
"@typescript-eslint/restrict-template-expressions": "off",
|
|
@@ -124,6 +127,7 @@ function typescriptConfig(tsconfigRootDir, options = {}) {
|
|
|
124
127
|
}
|
|
125
128
|
],
|
|
126
129
|
"@stylistic/operator-linebreak": "off",
|
|
130
|
+
"@stylistic/spaced-comment": "off",
|
|
127
131
|
// Should be the default but somehow it's not enforced if it's not explicitly specified.
|
|
128
132
|
"@stylistic/quote-props": "off",
|
|
129
133
|
// Positioned last to allow the consumer to override any rules.
|
package/dist/typescript.js.map
CHANGED
|
@@ -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 typescriptConfig(tsconfigRootDir: string, options: TypescriptConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/typescript\",\n files: [\n \"**/*.{ts,tsx}\"\n ],\n plugins: {\n \"@stylistic\": stylisticPlugin\n },\n extends: [\n js.configs.recommended,\n tseslint.configs.recommendedTypeChecked,\n tseslint.configs.stylisticTypeCheckedOnly,\n stylisticPlugin.configs.customize({\n braceStyle: \"1tbs\",\n commaDangle: \"never\",\n jsx: false,\n quotes: \"double\",\n semi: true,\n severity: \"warn\"\n })\n ],\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n // Rely on TypeScript's project service to automatically discover the \"tsconfig.json\" file\n // within the boundaries of \"tsconfigRootDir\".\n projectService: true,\n tsconfigRootDir\n }\n },\n rules: {\n // ESLint core rules overrides\n \"dot-notation\": \"off\",\n \"indent\": \"off\",\n \"no-dupe-class-members\": \"off\",\n \"no-empty-function\": \"off\",\n \"no-loop-func\": \"off\",\n \"no-shadow\": \"off\",\n \"no-unused-expressions\": \"off\",\n \"no-use-before-define\": \"off\",\n \"no-useless-constructor\": \"off\",\n \"object-curly-spacing\": \"off\",\n \"quotes\": \"off\",\n \"semi\": \"off\",\n\n // ESlint deprecated core rules\n \"arrow-parens\": \"off\",\n \"comma-dangle\": \"off\",\n\n // @typescript-eslint recommended rules overrides\n \"@typescript-eslint/dot-notation\": \"off\",\n \"@typescript-eslint/no-base-to-string\": \"off\",\n \"@typescript-eslint/no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\"\n }\n ],\n \"@typescript-eslint/no-floating-promises\": \"off\",\n \"@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-member-access\": \"off\",\n \"@typescript-eslint/only-throw-error\": \"off\",\n \"@typescript-eslint/prefer-nullish-coalescing\": \"off\",\n \"@typescript-eslint/restrict-template-expressions\": \"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-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 // 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","typescriptConfig","tsconfigRootDir","options","rules","config"],"mappings":";;;;;;;;;;;AAA4B;AAC2B;AAEd;AAOlC,MAAMG,0BAA0B,EAAE,CAAC;AAEnC,SAASC,iBAAiBC,eAAuB,EAAEC,UAAmC,CAAC,CAAC;IAC3F,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACL,cAAcP,aAAeA;YACjC;YACA,SAAS;gBACLD,sBAAsB;gBACtBE,gDAAuC;gBACvCA,kDAAyC;gBACzCD,+BAAiC,CAAC;oBAC9B,YAAY;oBACZ,aAAa;oBACb,KAAK;oBACL,QAAQ;oBACR,MAAM;oBACN,UAAU;gBACd;aACH;YACD,iBAAiB;gBACb,QAAQC,wBAAe;gBACvB,eAAe;oBACX,0FAA0F;oBAC1F,8CAA8C;oBAC9C,gBAAgB;oBAChBG;gBACJ;YACJ;YACA,OAAO;gBACH,8BAA8B;gBAC9B,gBAAgB;gBAChB,UAAU;gBACV,yBAAyB;gBACzB,qBAAqB;gBACrB,gBAAgB;gBAChB,aAAa;gBACb,yBAAyB;gBACzB,wBAAwB;gBACxB,0BAA0B;gBAC1B,wBAAwB;gBACxB,UAAU;gBACV,QAAQ;gBAER,+BAA+B;gBAC/B,gBAAgB;gBAChB,gBAAgB;gBAEhB,iDAAiD;gBACjD,mCAAmC;gBACnC,wCAAwC;gBACxC,wCAAwC;gBACxC,2CAA2C;oBACvC;oBACA;wBACI,iBAAiB;wBACjB,kBAAkB;oBACtB;iBACH;gBACD,2CAA2C;gBAC3C,4CAA4C;gBAC5C,yCAAyC;gBACzC,2CAA2C;gBAC3C,8CAA8C;gBAC9C,uCAAuC;gBACvC,gDAAgD;gBAChD,oDAAoD;gBAEpD,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,sCAAsC;oBAClC;oBACA;wBACI,4CAA4C;wBAC5C,KAAK;oBACT;iBACH;gBACD,iCAAiC;gBACjC,wFAAwF;gBACxF,0BAA0B;gBAE1B,+DAA+D;gBAC/D,GAAGE,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
|
|
1
|
+
{"version":3,"file":"typescript.js","sources":["webpack://@workleap/eslint-configs/./src/typescript.ts"],"sourcesContent":["import js from \"@eslint/js\";\nimport stylisticPlugin from \"@stylistic/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport tseslint from \"typescript-eslint\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface TypescriptConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const typescriptGlobalIgnores = [];\n\nexport function typescriptConfig(tsconfigRootDir: string, options: TypescriptConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/typescript\",\n files: [\n \"**/*.{ts,tsx}\"\n ],\n plugins: {\n \"@stylistic\": stylisticPlugin\n },\n extends: [\n js.configs.recommended,\n tseslint.configs.recommendedTypeChecked,\n tseslint.configs.stylisticTypeCheckedOnly,\n stylisticPlugin.configs.customize({\n braceStyle: \"1tbs\",\n commaDangle: \"never\",\n jsx: false,\n quotes: \"double\",\n semi: true,\n severity: \"warn\"\n })\n ],\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n // Rely on TypeScript's project service to automatically discover the \"tsconfig.json\" file\n // within the boundaries of \"tsconfigRootDir\".\n projectService: true,\n tsconfigRootDir\n }\n },\n rules: {\n // ESLint core rules overrides\n \"dot-notation\": \"off\",\n \"indent\": \"off\",\n \"no-dupe-class-members\": \"off\",\n \"no-empty-function\": \"off\",\n \"no-loop-func\": \"off\",\n \"no-shadow\": \"off\",\n \"no-unused-expressions\": \"off\",\n \"no-use-before-define\": \"off\",\n \"no-useless-constructor\": \"off\",\n \"object-curly-spacing\": \"off\",\n \"quotes\": \"off\",\n \"semi\": \"off\",\n\n // ESlint deprecated core rules\n \"arrow-parens\": \"off\",\n \"comma-dangle\": \"off\",\n\n // @typescript-eslint recommended rules overrides\n \"@typescript-eslint/dot-notation\": \"off\",\n \"@typescript-eslint/no-base-to-string\": \"off\",\n \"@typescript-eslint/no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\"\n }\n ],\n \"@typescript-eslint/no-floating-promises\": \"off\",\n // This rule should be enabled but has several options that need to be investigated.\n \"@typescript-eslint/no-misused-promises\": \"off\",\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\n \"@typescript-eslint/no-unsafe-argument\": \"off\",\n \"@typescript-eslint/no-unsafe-assignment\": \"off\",\n \"@typescript-eslint/no-unsafe-member-access\": \"off\",\n \"@typescript-eslint/no-unsafe-return\": \"off\",\n \"@typescript-eslint/only-throw-error\": \"off\",\n \"@typescript-eslint/prefer-nullish-coalescing\": \"off\",\n \"@typescript-eslint/restrict-template-expressions\": \"off\",\n\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-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/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","typescriptConfig","tsconfigRootDir","options","rules","config"],"mappings":";;;;;;;;;;;AAA4B;AAC2B;AAEd;AAOlC,MAAMG,0BAA0B,EAAE,CAAC;AAEnC,SAASC,iBAAiBC,eAAuB,EAAEC,UAAmC,CAAC,CAAC;IAC3F,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACL,cAAcP,aAAeA;YACjC;YACA,SAAS;gBACLD,sBAAsB;gBACtBE,gDAAuC;gBACvCA,kDAAyC;gBACzCD,+BAAiC,CAAC;oBAC9B,YAAY;oBACZ,aAAa;oBACb,KAAK;oBACL,QAAQ;oBACR,MAAM;oBACN,UAAU;gBACd;aACH;YACD,iBAAiB;gBACb,QAAQC,wBAAe;gBACvB,eAAe;oBACX,0FAA0F;oBAC1F,8CAA8C;oBAC9C,gBAAgB;oBAChBG;gBACJ;YACJ;YACA,OAAO;gBACH,8BAA8B;gBAC9B,gBAAgB;gBAChB,UAAU;gBACV,yBAAyB;gBACzB,qBAAqB;gBACrB,gBAAgB;gBAChB,aAAa;gBACb,yBAAyB;gBACzB,wBAAwB;gBACxB,0BAA0B;gBAC1B,wBAAwB;gBACxB,UAAU;gBACV,QAAQ;gBAER,+BAA+B;gBAC/B,gBAAgB;gBAChB,gBAAgB;gBAEhB,iDAAiD;gBACjD,mCAAmC;gBACnC,wCAAwC;gBACxC,wCAAwC;gBACxC,2CAA2C;oBACvC;oBACA;wBACI,iBAAiB;wBACjB,kBAAkB;oBACtB;iBACH;gBACD,2CAA2C;gBAC3C,oFAAoF;gBACpF,0CAA0C;gBAC1C,4CAA4C;gBAC5C,yCAAyC;gBACzC,2CAA2C;gBAC3C,8CAA8C;gBAC9C,uCAAuC;gBACvC,uCAAuC;gBACvC,gDAAgD;gBAChD,oDAAoD;gBAEpD,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,sCAAsC;oBAClC;oBACA;wBACI,4CAA4C;wBAC5C,KAAK;oBACT;iBACH;gBACD,iCAAiC;gBACjC,6BAA6B;gBAC7B,wFAAwF;gBACxF,0BAA0B;gBAE1B,+DAA+D;gBAC/D,GAAGE,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@workleap/eslint-configs",
|
|
3
3
|
"author": "Workleap",
|
|
4
4
|
"description": "Workleap recommended ESLint configurations.",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.4",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@vitest/eslint-plugin": "^1.3.23",
|
|
54
54
|
"eslint-plugin-import": "^2.32.0",
|
|
55
55
|
"eslint-plugin-jest": "^29.0.1",
|
|
56
|
+
"eslint-plugin-jsonc": "^2.21.0",
|
|
56
57
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
57
58
|
"eslint-plugin-package-json": "^0.58.0",
|
|
58
59
|
"eslint-plugin-react": "^7.37.5",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
2
|
import { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from "../core.ts";
|
|
3
|
+
import { jsonConfig, JsonConfigOptions, jsonGlobalIgnores } from "../json.ts";
|
|
3
4
|
import { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from "../packageJson.ts";
|
|
4
5
|
import { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from "../typescript.ts";
|
|
5
6
|
import { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from "../yaml.ts";
|
|
6
7
|
|
|
7
8
|
export interface DefineMonorepoWorkspaceConfigOptions {
|
|
8
9
|
core?: CoreConfigOptions;
|
|
10
|
+
json?: JsonConfigOptions;
|
|
9
11
|
packageJson?: PackageJsonConfigOptions;
|
|
10
12
|
typescript?: TypescriptConfigOptions;
|
|
11
13
|
yaml?: YamlConfigOptions;
|
|
@@ -18,6 +20,7 @@ export interface DefineMonorepoWorkspaceConfigOptions {
|
|
|
18
20
|
export function defineMonorepoWorkspaceConfig(tsconfigRootDir: string, options: DefineMonorepoWorkspaceConfigOptions = {}) {
|
|
19
21
|
const {
|
|
20
22
|
core,
|
|
23
|
+
json,
|
|
21
24
|
packageJson,
|
|
22
25
|
typescript,
|
|
23
26
|
yaml
|
|
@@ -27,12 +30,15 @@ export function defineMonorepoWorkspaceConfig(tsconfigRootDir: string, options:
|
|
|
27
30
|
// node_modules folder is ignored by default.
|
|
28
31
|
globalIgnores([
|
|
29
32
|
"dist",
|
|
33
|
+
".turbo",
|
|
30
34
|
...coreGlobalIgnores,
|
|
35
|
+
...jsonGlobalIgnores,
|
|
31
36
|
...packageJsonGlobalIgnores,
|
|
32
37
|
...typescriptGlobalIgnores,
|
|
33
38
|
...yamlGlobalIgnores
|
|
34
39
|
]),
|
|
35
40
|
...coreConfig(core),
|
|
41
|
+
...jsonConfig(json),
|
|
36
42
|
...packageJsonConfig(packageJson),
|
|
37
43
|
...typescriptConfig(tsconfigRootDir, typescript),
|
|
38
44
|
...yamlConfig(yaml),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
2
|
import { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from "../core.ts";
|
|
3
3
|
import { jestConfig, type JestConfigOptions, jestGlobalIgnores } from "../jest.ts";
|
|
4
|
+
import { jsonConfig, JsonConfigOptions, jsonGlobalIgnores } from "../json.ts";
|
|
4
5
|
import { jsxAllyConfig, type JsxAllyConfigOptions, jsxAllyGlobalIgnores } from "../jsxAlly.ts";
|
|
5
6
|
import { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from "../packageJson.ts";
|
|
6
7
|
import { WorkleapPlugin } from "../plugins/workleapPlugin.ts";
|
|
@@ -14,6 +15,7 @@ import { yamlConfig, type YamlConfigOptions, yamlGlobalIgnores } from "../yaml.t
|
|
|
14
15
|
export interface DefineReactLibraryConfigOptions {
|
|
15
16
|
core?: CoreConfigOptions;
|
|
16
17
|
jest?: JestConfigOptions;
|
|
18
|
+
json?: JsonConfigOptions;
|
|
17
19
|
jsxAlly?: JsxAllyConfigOptions;
|
|
18
20
|
packageJson?: PackageJsonConfigOptions;
|
|
19
21
|
react?: ReactConfigOptions;
|
|
@@ -32,6 +34,7 @@ export function defineReactLibraryConfig(tsconfigRootDir: string, options: Defin
|
|
|
32
34
|
const {
|
|
33
35
|
core,
|
|
34
36
|
jest,
|
|
37
|
+
json,
|
|
35
38
|
jsxAlly,
|
|
36
39
|
packageJson,
|
|
37
40
|
react,
|
|
@@ -46,8 +49,10 @@ export function defineReactLibraryConfig(tsconfigRootDir: string, options: Defin
|
|
|
46
49
|
// node_modules folder is ignored by default.
|
|
47
50
|
globalIgnores([
|
|
48
51
|
"dist",
|
|
52
|
+
"**/__snapshots__/*",
|
|
49
53
|
...coreGlobalIgnores,
|
|
50
54
|
...jestGlobalIgnores,
|
|
55
|
+
...jsonGlobalIgnores,
|
|
51
56
|
...jsxAllyGlobalIgnores,
|
|
52
57
|
...packageJsonGlobalIgnores,
|
|
53
58
|
...reactGlobalIgnores,
|
|
@@ -59,6 +64,7 @@ export function defineReactLibraryConfig(tsconfigRootDir: string, options: Defin
|
|
|
59
64
|
]),
|
|
60
65
|
...coreConfig(core),
|
|
61
66
|
...jestConfig(jest),
|
|
67
|
+
...jsonConfig(json),
|
|
62
68
|
...jsxAllyConfig(jsxAlly),
|
|
63
69
|
...packageJsonConfig(packageJson),
|
|
64
70
|
...reactConfig(react),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
2
|
import { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from "../core.ts";
|
|
3
3
|
import { jestConfig, type JestConfigOptions, jestGlobalIgnores } from "../jest.ts";
|
|
4
|
+
import { jsonConfig, JsonConfigOptions, jsonGlobalIgnores } from "../json.ts";
|
|
4
5
|
import { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from "../packageJson.ts";
|
|
5
6
|
import { WorkleapPlugin } from "../plugins/workleapPlugin.ts";
|
|
6
7
|
import { typescriptConfig, type TypescriptConfigOptions, typescriptGlobalIgnores } from "../typescript.ts";
|
|
@@ -11,6 +12,7 @@ export interface DefineTypeScriptLibraryConfigOptions {
|
|
|
11
12
|
core?: CoreConfigOptions;
|
|
12
13
|
typescript?: TypescriptConfigOptions;
|
|
13
14
|
jest?: JestConfigOptions;
|
|
15
|
+
json?: JsonConfigOptions;
|
|
14
16
|
vitest?: VitestConfigOptions;
|
|
15
17
|
packageJson?: PackageJsonConfigOptions;
|
|
16
18
|
yaml?: YamlConfigOptions;
|
|
@@ -24,6 +26,7 @@ export function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options:
|
|
|
24
26
|
const {
|
|
25
27
|
core,
|
|
26
28
|
jest,
|
|
29
|
+
json,
|
|
27
30
|
packageJson,
|
|
28
31
|
typescript,
|
|
29
32
|
vitest,
|
|
@@ -34,8 +37,10 @@ export function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options:
|
|
|
34
37
|
// node_modules folder is ignored by default.
|
|
35
38
|
globalIgnores([
|
|
36
39
|
"dist",
|
|
40
|
+
"**/__snapshots__/*",
|
|
37
41
|
...coreGlobalIgnores,
|
|
38
42
|
...jestGlobalIgnores,
|
|
43
|
+
...jsonGlobalIgnores,
|
|
39
44
|
...packageJsonGlobalIgnores,
|
|
40
45
|
...typescriptGlobalIgnores,
|
|
41
46
|
...vitestGlobalIgnores,
|
|
@@ -43,6 +48,7 @@ export function defineTypeScriptLibraryConfig(tsconfigRootDir: string, options:
|
|
|
43
48
|
]),
|
|
44
49
|
...coreConfig(core),
|
|
45
50
|
...jestConfig(jest),
|
|
51
|
+
...jsonConfig(json),
|
|
46
52
|
...packageJsonConfig(packageJson),
|
|
47
53
|
...typescriptConfig(tsconfigRootDir, typescript),
|
|
48
54
|
// Temporary fix until the vitest plugin support defineConfig and the types are fixed.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
2
|
import { coreConfig, type CoreConfigOptions, coreGlobalIgnores } from "../core.ts";
|
|
3
3
|
import { jestConfig, type JestConfigOptions, jestGlobalIgnores } from "../jest.ts";
|
|
4
|
+
import { jsonConfig, JsonConfigOptions, jsonGlobalIgnores } from "../json.ts";
|
|
4
5
|
import { jsxAllyConfig, type JsxAllyConfigOptions, jsxAllyGlobalIgnores } from "../jsxAlly.ts";
|
|
5
6
|
import { packageJsonConfig, type PackageJsonConfigOptions, packageJsonGlobalIgnores } from "../packageJson.ts";
|
|
6
7
|
import { WorkleapPlugin } from "../plugins/workleapPlugin.ts";
|
|
@@ -46,14 +47,15 @@ error Parsing error: C:\Dev\workleap\wl-web-configs\samples\storybook\rsbuild\.
|
|
|
46
47
|
|
|
47
48
|
export interface DefineWebApplicationConfigOptions {
|
|
48
49
|
core?: CoreConfigOptions;
|
|
49
|
-
typescript?: TypescriptConfigOptions;
|
|
50
|
-
react?: ReactConfigOptions;
|
|
51
|
-
jsxAlly?: JsxAllyConfigOptions;
|
|
52
50
|
jest?: JestConfigOptions;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
storybook?: StorybookConfigOptions;
|
|
51
|
+
json?: JsonConfigOptions;
|
|
52
|
+
jsxAlly?: JsxAllyConfigOptions;
|
|
56
53
|
packageJson?: PackageJsonConfigOptions;
|
|
54
|
+
react?: ReactConfigOptions;
|
|
55
|
+
storybook?: StorybookConfigOptions;
|
|
56
|
+
testingLibrary?: TestingLibraryConfigOptions;
|
|
57
|
+
typescript?: TypescriptConfigOptions;
|
|
58
|
+
vitest?: VitestConfigOptions;
|
|
57
59
|
yaml?: YamlConfigOptions;
|
|
58
60
|
}
|
|
59
61
|
|
|
@@ -65,6 +67,7 @@ export const defineWebApplicationConfig = (tsconfigRootDir: string, options: Def
|
|
|
65
67
|
const {
|
|
66
68
|
core,
|
|
67
69
|
jest,
|
|
70
|
+
json,
|
|
68
71
|
jsxAlly,
|
|
69
72
|
packageJson,
|
|
70
73
|
react,
|
|
@@ -79,8 +82,10 @@ export const defineWebApplicationConfig = (tsconfigRootDir: string, options: Def
|
|
|
79
82
|
// node_modules folder is ignored by default.
|
|
80
83
|
globalIgnores([
|
|
81
84
|
"dist",
|
|
85
|
+
"**/__snapshots__/*",
|
|
82
86
|
...coreGlobalIgnores,
|
|
83
87
|
...jestGlobalIgnores,
|
|
88
|
+
...jsonGlobalIgnores,
|
|
84
89
|
...jsxAllyGlobalIgnores,
|
|
85
90
|
...packageJsonGlobalIgnores,
|
|
86
91
|
...reactGlobalIgnores,
|
|
@@ -92,6 +97,7 @@ export const defineWebApplicationConfig = (tsconfigRootDir: string, options: Def
|
|
|
92
97
|
]),
|
|
93
98
|
...coreConfig(core),
|
|
94
99
|
...jestConfig(jest),
|
|
100
|
+
...jsonConfig(json),
|
|
95
101
|
...jsxAllyConfig(jsxAlly),
|
|
96
102
|
...packageJsonConfig(packageJson),
|
|
97
103
|
...reactConfig(react),
|
package/src/json.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Linter } from "eslint";
|
|
2
|
+
import jsoncPlugin from "eslint-plugin-jsonc";
|
|
3
|
+
import type { ConfigWithExtends } from "./types.ts";
|
|
4
|
+
|
|
5
|
+
export interface JsonConfigOptions {
|
|
6
|
+
rules?: Partial<Linter.RulesRecord>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const jsonGlobalIgnores = [];
|
|
10
|
+
|
|
11
|
+
export function jsonConfig(options: JsonConfigOptions = {}) {
|
|
12
|
+
const {
|
|
13
|
+
rules = {}
|
|
14
|
+
} = options;
|
|
15
|
+
|
|
16
|
+
const config: ConfigWithExtends[] = [{
|
|
17
|
+
name: "@workleap/eslint-configs/json",
|
|
18
|
+
files: [
|
|
19
|
+
"**/*.{json,jsonc}"
|
|
20
|
+
],
|
|
21
|
+
extends: [
|
|
22
|
+
jsoncPlugin.configs["flat/base"]
|
|
23
|
+
],
|
|
24
|
+
rules: {
|
|
25
|
+
"jsonc/indent": ["warn", 4],
|
|
26
|
+
// Positioned last to allow the consumer to override any rules.
|
|
27
|
+
...rules
|
|
28
|
+
}
|
|
29
|
+
}];
|
|
30
|
+
|
|
31
|
+
return config;
|
|
32
|
+
}
|
package/src/packageJson.ts
CHANGED
|
@@ -25,7 +25,7 @@ export function packageJsonConfig(options: PackageJsonConfigOptions = {}) {
|
|
|
25
25
|
"package-json/order-properties": "off",
|
|
26
26
|
"package-json/prefer-repository-shorthand": "off",
|
|
27
27
|
"package-json/sort-collections": [
|
|
28
|
-
"
|
|
28
|
+
"warn",
|
|
29
29
|
[
|
|
30
30
|
// Do not sort "scripts".
|
|
31
31
|
"devDependencies",
|
package/src/typescript.ts
CHANGED
|
@@ -76,10 +76,13 @@ export function typescriptConfig(tsconfigRootDir: string, options: TypescriptCon
|
|
|
76
76
|
}
|
|
77
77
|
],
|
|
78
78
|
"@typescript-eslint/no-floating-promises": "off",
|
|
79
|
+
// This rule should be enabled but has several options that need to be investigated.
|
|
80
|
+
"@typescript-eslint/no-misused-promises": "off",
|
|
79
81
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
80
82
|
"@typescript-eslint/no-unsafe-argument": "off",
|
|
81
83
|
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
82
84
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
85
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
83
86
|
"@typescript-eslint/only-throw-error": "off",
|
|
84
87
|
"@typescript-eslint/prefer-nullish-coalescing": "off",
|
|
85
88
|
"@typescript-eslint/restrict-template-expressions": "off",
|
|
@@ -121,6 +124,7 @@ export function typescriptConfig(tsconfigRootDir: string, options: TypescriptCon
|
|
|
121
124
|
}
|
|
122
125
|
],
|
|
123
126
|
"@stylistic/operator-linebreak": "off",
|
|
127
|
+
"@stylistic/spaced-comment": "off",
|
|
124
128
|
// Should be the default but somehow it's not enforced if it's not explicitly specified.
|
|
125
129
|
"@stylistic/quote-props": "off",
|
|
126
130
|
|