@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/dist/index.js
CHANGED
|
@@ -2,6 +2,16 @@ import { defineMonorepoWorkspaceConfig } from "./by-project-type/defineMonorepoW
|
|
|
2
2
|
import { defineReactLibraryConfig } from "./by-project-type/defineReactLibraryConfig.js";
|
|
3
3
|
import { defineTypeScriptLibraryConfig } from "./by-project-type/defineTypescriptLibraryConfig.js";
|
|
4
4
|
import { defineWebApplicationConfig } from "./by-project-type/defineWebApplicationConfig.js";
|
|
5
|
+
import { defineCoreConfig } from "./core.js";
|
|
6
|
+
import { defineJestConfig } from "./jest.js";
|
|
7
|
+
import { defineJsxAllyConfig } from "./jsxAlly.js";
|
|
8
|
+
import { definePackageJsonConfig } from "./packageJson.js";
|
|
9
|
+
import { defineReactConfig } from "./react.js";
|
|
10
|
+
import { defineStorybookConfig } from "./storybook.js";
|
|
11
|
+
import { defineTestingLibraryConfig } from "./testingLibrary.js";
|
|
12
|
+
import { defineTypeScriptConfig } from "./typescript.js";
|
|
13
|
+
import { defineVitestConfig } from "./vitest.js";
|
|
14
|
+
import { defineYamlConfig } from "./yaml.js";
|
|
5
15
|
|
|
6
16
|
;// CONCATENATED MODULE: external "./by-project-type/defineMonorepoWorkspaceConfig.js"
|
|
7
17
|
|
|
@@ -11,12 +21,42 @@ import { defineWebApplicationConfig } from "./by-project-type/defineWebApplicati
|
|
|
11
21
|
|
|
12
22
|
;// CONCATENATED MODULE: external "./by-project-type/defineWebApplicationConfig.js"
|
|
13
23
|
|
|
24
|
+
;// CONCATENATED MODULE: external "./core.js"
|
|
25
|
+
|
|
26
|
+
;// CONCATENATED MODULE: external "./jest.js"
|
|
27
|
+
|
|
28
|
+
;// CONCATENATED MODULE: external "./jsxAlly.js"
|
|
29
|
+
|
|
30
|
+
;// CONCATENATED MODULE: external "./packageJson.js"
|
|
31
|
+
|
|
32
|
+
;// CONCATENATED MODULE: external "./react.js"
|
|
33
|
+
|
|
34
|
+
;// CONCATENATED MODULE: external "./storybook.js"
|
|
35
|
+
|
|
36
|
+
;// CONCATENATED MODULE: external "./testingLibrary.js"
|
|
37
|
+
|
|
38
|
+
;// CONCATENATED MODULE: external "./typescript.js"
|
|
39
|
+
|
|
40
|
+
;// CONCATENATED MODULE: external "./vitest.js"
|
|
41
|
+
|
|
42
|
+
;// CONCATENATED MODULE: external "./yaml.js"
|
|
43
|
+
|
|
14
44
|
;// CONCATENATED MODULE: ./src/index.ts
|
|
15
45
|
|
|
16
46
|
|
|
17
47
|
|
|
18
48
|
|
|
19
49
|
|
|
20
|
-
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
export { defineCoreConfig, defineJestConfig, defineJsxAllyConfig, defineMonorepoWorkspaceConfig, definePackageJsonConfig, defineReactConfig, defineReactLibraryConfig, defineStorybookConfig, defineTestingLibraryConfig, defineTypeScriptConfig, defineTypeScriptLibraryConfig, defineVitestConfig, defineWebApplicationConfig, defineYamlConfig };
|
|
21
61
|
|
|
22
62
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["webpack://@workleap/eslint-configs/./src/index.ts"],"sourcesContent":["export { defineMonorepoWorkspaceConfig, type DefineMonorepoWorkspaceConfigOptions } from \"./by-project-type/defineMonorepoWorkspaceConfig.ts\";\nexport { defineReactLibraryConfig, type DefineReactLibraryConfigOptions } from \"./by-project-type/defineReactLibraryConfig.ts\";\nexport { defineTypeScriptLibraryConfig, type DefineTypeScriptLibraryConfigOptions } from \"./by-project-type/defineTypescriptLibraryConfig.ts\";\nexport { defineWebApplicationConfig, type DefineWebApplicationConfigOptions } from \"./by-project-type/defineWebApplicationConfig.ts\";\nexport type
|
|
1
|
+
{"version":3,"file":"index.js","sources":["webpack://@workleap/eslint-configs/./src/index.ts"],"sourcesContent":["export { defineMonorepoWorkspaceConfig, type DefineMonorepoWorkspaceConfigOptions } from \"./by-project-type/defineMonorepoWorkspaceConfig.ts\";\nexport { defineReactLibraryConfig, type DefineReactLibraryConfigOptions } from \"./by-project-type/defineReactLibraryConfig.ts\";\nexport { defineTypeScriptLibraryConfig, type DefineTypeScriptLibraryConfigOptions } from \"./by-project-type/defineTypescriptLibraryConfig.ts\";\nexport { defineWebApplicationConfig, type DefineWebApplicationConfigOptions } from \"./by-project-type/defineWebApplicationConfig.ts\";\nexport { defineCoreConfig, type CoreConfigOptions } from \"./core.ts\";\nexport { defineJestConfig, type JestConfigOptions } from \"./jest.ts\";\nexport { defineJsxAllyConfig, type JsxAllyConfigOptions } from \"./jsxAlly.ts\";\nexport { definePackageJsonConfig, type PackageJsonConfigOptions } from \"./packageJson.ts\";\nexport { defineReactConfig, type ReactConfigOptions } from \"./react.ts\";\nexport { defineStorybookConfig, type StorybookConfigOptions } from \"./storybook.ts\";\nexport { defineTestingLibraryConfig, type TestingLibraryConfigOptions } from \"./testingLibrary.ts\";\nexport type { ConfigWithExtends, ExtendsElement, InfiniteArray, SimpleExtendsElement } from \"./types.ts\";\nexport { defineTypeScriptConfig, type TypeScriptConfigOptions } from \"./typescript.ts\";\nexport { defineVitestConfig, type VitestConfigOptions } from \"./vitest.ts\";\nexport { defineYamlConfig, type YamlConfigOptions } from \"./yaml.ts\";\n\n"],"names":["defineMonorepoWorkspaceConfig","defineReactLibraryConfig","defineTypeScriptLibraryConfig","defineWebApplicationConfig","defineCoreConfig","defineJestConfig","defineJsxAllyConfig","definePackageJsonConfig","defineReactConfig","defineStorybookConfig","defineTestingLibraryConfig","defineTypeScriptConfig","defineVitestConfig","defineYamlConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA8I;AACf;AACe;AACT;AAChE;AACA;AACS;AACY;AAClB;AACY;AACe;AAEZ;AACZ;AACN"}
|
package/dist/jest.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Linter } from "eslint";
|
|
2
2
|
import type { ConfigWithExtends } from "./types.ts";
|
|
3
3
|
export interface JestConfigOptions {
|
|
4
|
+
enabled?: boolean;
|
|
4
5
|
rules?: Partial<Linter.RulesRecord>;
|
|
5
6
|
}
|
|
6
7
|
export declare const jestGlobalIgnores: never[];
|
|
7
|
-
export declare function
|
|
8
|
+
export declare function defineJestConfig(options?: JestConfigOptions): ConfigWithExtends[];
|
package/dist/jest.js
CHANGED
|
@@ -9,8 +9,11 @@ import globals from "globals";
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
const jestGlobalIgnores = [];
|
|
12
|
-
function
|
|
13
|
-
const { rules = {} } = options;
|
|
12
|
+
function defineJestConfig(options = {}) {
|
|
13
|
+
const { enabled = false, rules = {} } = options;
|
|
14
|
+
if (!enabled) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
14
17
|
const config = [
|
|
15
18
|
{
|
|
16
19
|
name: "@workleap/eslint-configs/jest",
|
|
@@ -38,6 +41,7 @@ function jestConfig(options = {}) {
|
|
|
38
41
|
}
|
|
39
42
|
},
|
|
40
43
|
rules: {
|
|
44
|
+
"jest/no-commented-out-tests": "off",
|
|
41
45
|
// Gives better failure messages for array checks.
|
|
42
46
|
"jest/prefer-to-contain": "error",
|
|
43
47
|
// Prefer spies to allow for automatic restoration.
|
|
@@ -50,6 +54,6 @@ function jestConfig(options = {}) {
|
|
|
50
54
|
return config;
|
|
51
55
|
}
|
|
52
56
|
|
|
53
|
-
export {
|
|
57
|
+
export { defineJestConfig, jestGlobalIgnores };
|
|
54
58
|
|
|
55
59
|
//# sourceMappingURL=jest.js.map
|
package/dist/jest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jest.js","sources":["webpack://@workleap/eslint-configs/./src/jest.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport jestPlugin from \"eslint-plugin-jest\";\nimport globals from \"globals\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface JestConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jestGlobalIgnores = [];\n\nexport function
|
|
1
|
+
{"version":3,"file":"jest.js","sources":["webpack://@workleap/eslint-configs/./src/jest.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport jestPlugin from \"eslint-plugin-jest\";\nimport globals from \"globals\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface JestConfigOptions {\n enabled?: boolean;\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jestGlobalIgnores = [];\n\nexport function defineJestConfig(options: JestConfigOptions = {}) {\n const {\n enabled = false,\n rules = {}\n } = options;\n\n if (!enabled) {\n return [];\n }\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/jest\",\n files: [\n \"**/*.test.{js,jsx,ts,tsx}\",\n \"**/*-test.{js,jsx,ts,tsx}\",\n \"**/__tests__/*.{js,jsx,ts,tsx}\",\n \"**/test.{js,jsx,ts,tsx}\"\n ],\n extends: [\n jestPlugin.configs[\"flat/recommended\"]\n ],\n languageOptions: {\n globals: {\n ...globals.browser,\n ...globals.es2024,\n ...globals.node,\n ...globals.commonjs,\n ...globals.jest\n }\n },\n settings: {\n jest: {\n version: \"detect\"\n }\n },\n rules: {\n \"jest/no-commented-out-tests\": \"off\",\n // Gives better failure messages for array checks.\n \"jest/prefer-to-contain\": \"error\",\n // Prefer spies to allow for automatic restoration.\n \"jest/prefer-spy-on\": \"error\",\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["jestPlugin","globals","jestGlobalIgnores","defineJestConfig","options","enabled","rules","config"],"mappings":";;;;;;;;AAC4C;AACd;AAQvB,MAAME,oBAAoB,EAAE,CAAC;AAE7B,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,MAAM,EACFC,UAAU,KAAK,EACfC,QAAQ,CAAC,CAAC,EACb,GAAGF;IAEJ,IAAI,CAACC,SAAS;QACV,OAAO,EAAE;IACb;IAEA,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;gBACA;gBACA;gBACA;aACH;YACD,SAAS;gBACLP,8CAAsC;aACzC;YACD,iBAAiB;gBACb,SAAS;oBACL,GAAGC,eAAe;oBAClB,GAAGA,cAAc;oBACjB,GAAGA,YAAY;oBACf,GAAGA,gBAAgB;oBACnB,GAAGA,YAAY;gBACnB;YACJ;YACA,UAAU;gBACN,MAAM;oBACF,SAAS;gBACb;YACJ;YACA,OAAO;gBACH,+BAA+B;gBAC/B,kDAAkD;gBAClD,0BAA0B;gBAC1B,mDAAmD;gBACnD,sBAAsB;gBACtB,+DAA+D;gBAC/D,GAAGK,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
|
package/dist/json.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export interface JsonConfigOptions {
|
|
|
4
4
|
rules?: Partial<Linter.RulesRecord>;
|
|
5
5
|
}
|
|
6
6
|
export declare const jsonGlobalIgnores: never[];
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function defineJsonConfig(options?: JsonConfigOptions): ConfigWithExtends[];
|
package/dist/json.js
CHANGED
|
@@ -5,7 +5,7 @@ import eslint_plugin_jsonc from "eslint-plugin-jsonc";
|
|
|
5
5
|
;// CONCATENATED MODULE: ./src/json.ts
|
|
6
6
|
|
|
7
7
|
const jsonGlobalIgnores = [];
|
|
8
|
-
function
|
|
8
|
+
function defineJsonConfig(options = {}) {
|
|
9
9
|
const { rules = {} } = options;
|
|
10
10
|
const config = [
|
|
11
11
|
{
|
|
@@ -29,6 +29,6 @@ function jsonConfig(options = {}) {
|
|
|
29
29
|
return config;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export {
|
|
32
|
+
export { defineJsonConfig, jsonGlobalIgnores };
|
|
33
33
|
|
|
34
34
|
//# sourceMappingURL=json.js.map
|
package/dist/json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sources":["webpack://@workleap/eslint-configs/./src/json.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport jsoncPlugin from \"eslint-plugin-jsonc\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface JsonConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jsonGlobalIgnores = [];\n\nexport function
|
|
1
|
+
{"version":3,"file":"json.js","sources":["webpack://@workleap/eslint-configs/./src/json.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport jsoncPlugin from \"eslint-plugin-jsonc\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface JsonConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jsonGlobalIgnores = [];\n\nexport function defineJsonConfig(options: JsonConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/json\",\n files: [\n \"**/*.{json,jsonc}\"\n ],\n extends: [\n jsoncPlugin.configs[\"flat/base\"]\n ],\n rules: {\n \"jsonc/indent\": [\"warn\", 4],\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n}\n"],"names":["jsoncPlugin","jsonGlobalIgnores","defineJsonConfig","options","rules","config"],"mappings":";;;;;AAC8C;AAOvC,MAAMC,oBAAoB,EAAE,CAAC;AAE7B,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLL,wCAAgC;aACnC;YACD,OAAO;gBACH,gBAAgB;oBAAC;oBAAQ;iBAAE;gBAC3B,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
|
package/dist/jsxAlly.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export interface JsxAllyConfigOptions {
|
|
|
4
4
|
rules?: Partial<Linter.RulesRecord>;
|
|
5
5
|
}
|
|
6
6
|
export declare const jsxAllyGlobalIgnores: never[];
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function defineJsxAllyConfig(options?: JsxAllyConfigOptions): ConfigWithExtends[];
|
package/dist/jsxAlly.js
CHANGED
|
@@ -5,7 +5,7 @@ import eslint_plugin_jsx_a11y from "eslint-plugin-jsx-a11y";
|
|
|
5
5
|
;// CONCATENATED MODULE: ./src/jsxAlly.ts
|
|
6
6
|
|
|
7
7
|
const jsxAllyGlobalIgnores = [];
|
|
8
|
-
function
|
|
8
|
+
function defineJsxAllyConfig(options = {}) {
|
|
9
9
|
const { rules = {} } = options;
|
|
10
10
|
const config = [
|
|
11
11
|
{
|
|
@@ -46,6 +46,6 @@ function jsxAllyConfig(options = {}) {
|
|
|
46
46
|
return config;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export {
|
|
49
|
+
export { defineJsxAllyConfig, jsxAllyGlobalIgnores };
|
|
50
50
|
|
|
51
51
|
//# sourceMappingURL=jsxAlly.js.map
|
package/dist/jsxAlly.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsxAlly.js","sources":["webpack://@workleap/eslint-configs/./src/jsxAlly.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport jsxA11yPlugin from \"eslint-plugin-jsx-a11y\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface JsxAllyConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jsxAllyGlobalIgnores = [];\n\nexport function
|
|
1
|
+
{"version":3,"file":"jsxAlly.js","sources":["webpack://@workleap/eslint-configs/./src/jsxAlly.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport jsxA11yPlugin from \"eslint-plugin-jsx-a11y\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface JsxAllyConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const jsxAllyGlobalIgnores = [];\n\nexport function defineJsxAllyConfig(options: JsxAllyConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/jsx-a11y\",\n files: [\n \"**/*.{js,ts,jsx,tsx,cjs,mjs}\"\n ],\n extends: [\n jsxA11yPlugin.flatConfigs.recommended\n ],\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true\n }\n }\n },\n rules: {\n // This rule ensures that all labels have an associated control that they are labeling.\n // However, this rule causes a lot of false positive, since our current implementation of our company's design system\n // does not use the \"for\" attribute in the label element and automatically add it inside Fields.\n // Therefore, we are disabling this rule.\n \"jsx-a11y/label-has-associated-control:\": \"off\",\n // This rule ensures that all media elements have a <track> for captions.\n // Since we don't use captions, we are disabling this rule.\n \"jsx-a11y/media-has-caption\": \"off\",\n // There is a really good article that describes the issues with autoFocus and why it should be avoided:\n // https://brucelawson.co.uk/2009/the-accessibility-of-html-5-autofocus/\n // However, this issue is with screen readers and not with keyboard navigation.\n // In Workleap, we use autoFocus in a lot of places to improve the user experience.\n // Therefore, we are disabling this rule.\n \"jsx-a11y/no-autofocus\": \"off\",\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["jsxA11yPlugin","jsxAllyGlobalIgnores","defineJsxAllyConfig","options","rules","config"],"mappings":";;;;;AACmD;AAO5C,MAAMC,uBAAuB,EAAE,CAAC;AAEhC,SAASC,oBAAoBC,UAAgC,CAAC,CAAC;IAClE,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLL,8CAAqC;aACxC;YACD,iBAAiB;gBACb,eAAe;oBACX,cAAc;wBACV,KAAK;oBACT;gBACJ;YACJ;YACA,OAAO;gBACH,uFAAuF;gBACvF,qHAAqH;gBACrH,gGAAgG;gBAChG,yCAAyC;gBACzC,0CAA0C;gBAC1C,yEAAyE;gBACzE,2DAA2D;gBAC3D,8BAA8B;gBAC9B,wGAAwG;gBACxG,wEAAwE;gBACxE,+EAA+E;gBAC/E,mFAAmF;gBACnF,yCAAyC;gBACzC,yBAAyB;gBACzB,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
|
package/dist/packageJson.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export interface PackageJsonConfigOptions {
|
|
|
4
4
|
rules?: Partial<Linter.RulesRecord>;
|
|
5
5
|
}
|
|
6
6
|
export declare const packageJsonGlobalIgnores: never[];
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function definePackageJsonConfig(options?: PackageJsonConfigOptions): ConfigWithExtends[];
|
package/dist/packageJson.js
CHANGED
|
@@ -5,7 +5,7 @@ import eslint_plugin_package_json from "eslint-plugin-package-json";
|
|
|
5
5
|
;// CONCATENATED MODULE: ./src/packageJson.ts
|
|
6
6
|
|
|
7
7
|
const packageJsonGlobalIgnores = [];
|
|
8
|
-
function
|
|
8
|
+
function definePackageJsonConfig(options = {}) {
|
|
9
9
|
const { rules = {} } = options;
|
|
10
10
|
const config = [
|
|
11
11
|
{
|
|
@@ -42,6 +42,6 @@ function packageJsonConfig(options = {}) {
|
|
|
42
42
|
return config;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export {
|
|
45
|
+
export { definePackageJsonConfig, packageJsonGlobalIgnores };
|
|
46
46
|
|
|
47
47
|
//# sourceMappingURL=packageJson.js.map
|
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
|
|
1
|
+
{"version":3,"file":"packageJson.js","sources":["webpack://@workleap/eslint-configs/./src/packageJson.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport packageJsonPlugin from \"eslint-plugin-package-json\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface PackageJsonConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const packageJsonGlobalIgnores = [];\n\nexport function definePackageJsonConfig(options: PackageJsonConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/package-json\",\n files: [\n \"**/package.json\"\n ],\n extends: [\n packageJsonPlugin.configs.recommended\n ],\n rules: {\n \"package-json/order-properties\": \"off\",\n \"package-json/prefer-repository-shorthand\": \"off\",\n \"package-json/sort-collections\": [\n \"warn\",\n [\n // Do not sort \"scripts\".\n \"devDependencies\",\n \"dependencies\",\n \"peerDependencies\",\n \"config\"\n ]\n ],\n // Doesn't support \"workspace:*\" at the moment.\n \"package-json/valid-package-def\": \"off\",\n // I am not sure why, this rule is triggering errors for valid paths.\n \"package-json/valid-repository-directory\": \"off\",\n \"package-json/valid-scripts\": \"off\",\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["packageJsonPlugin","packageJsonGlobalIgnores","definePackageJsonConfig","options","rules","config"],"mappings":";;;;;AAC2D;AAOpD,MAAMC,2BAA2B,EAAE,CAAC;AAEpC,SAASC,wBAAwBC,UAAoC,CAAC,CAAC;IAC1E,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACLL,8CAAqC;aACxC;YACD,OAAO;gBACH,iCAAiC;gBACjC,4CAA4C;gBAC5C,iCAAiC;oBAC7B;oBACA;wBACI,yBAAyB;wBACzB;wBACA;wBACA;wBACA;qBACH;iBACJ;gBACD,+CAA+C;gBAC/C,kCAAkC;gBAClC,qEAAqE;gBACrE,2CAA2C;gBAC3C,8BAA8B;gBAC9B,+DAA+D;gBAC/D,GAAGI,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
|
package/dist/react.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ export interface ReactConfigOptions {
|
|
|
5
5
|
compiler?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare const reactGlobalIgnores: never[];
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function defineReactConfig(options?: ReactConfigOptions): ConfigWithExtends[];
|
package/dist/react.js
CHANGED
|
@@ -13,7 +13,7 @@ import eslint_plugin_react_hooks from "eslint-plugin-react-hooks";
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
const reactGlobalIgnores = [];
|
|
16
|
-
function
|
|
16
|
+
function defineReactConfig(options = {}) {
|
|
17
17
|
const { rules = {}, compiler = false } = options;
|
|
18
18
|
const config = [
|
|
19
19
|
{
|
|
@@ -191,6 +191,6 @@ function reactConfig(options = {}) {
|
|
|
191
191
|
return config;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
export {
|
|
194
|
+
export { defineReactConfig, reactGlobalIgnores };
|
|
195
195
|
|
|
196
196
|
//# sourceMappingURL=react.js.map
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sources":["webpack://@workleap/eslint-configs/./src/react.ts"],"sourcesContent":["import stylisticPlugin from \"@stylistic/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport reactPlugin from \"eslint-plugin-react\";\nimport reactHooksPlugin from \"eslint-plugin-react-hooks\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface ReactConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n compiler?: boolean;\n}\n\nexport const reactGlobalIgnores = [];\n\nexport function
|
|
1
|
+
{"version":3,"file":"react.js","sources":["webpack://@workleap/eslint-configs/./src/react.ts"],"sourcesContent":["import stylisticPlugin from \"@stylistic/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport reactPlugin from \"eslint-plugin-react\";\nimport reactHooksPlugin from \"eslint-plugin-react-hooks\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface ReactConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n compiler?: boolean;\n}\n\nexport const reactGlobalIgnores = [];\n\nexport function defineReactConfig(options: ReactConfigOptions = {}) {\n const {\n rules = {},\n compiler = false\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/react\",\n files: [\n \"**/*.[jt]sx\"\n ],\n plugins: {\n \"@stylistic\": stylisticPlugin\n },\n extends: [\n reactPlugin.configs.flat.recommended,\n // @ts-expect-error the typings are broken and think there's a \".default\" to add.\n reactHooksPlugin.configs.flat.recommended\n ],\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true\n }\n }\n },\n settings: {\n react: {\n version: \"detect\"\n }\n },\n rules: {\n // React recommend rules overrides\n \"react/display-name\": \"off\",\n \"react/jsx-key\": \"off\",\n \"react/jsx-no-duplicate-props\": [\n \"warn\",\n {\n ignoreCase: true\n }\n ],\n \"react/jsx-no-undef\": [\n \"warn\",\n {\n allowGlobals: true\n }\n ],\n \"react/no-unescaped-entities\": \"off\",\n \"react/prop-types\": \"off\",\n \"react/react-in-jsx-scope\": \"off\",\n\n // React extra rules\n \"react/button-has-type\": \"warn\",\n \"react/default-props-match-prop-types\": \"warn\",\n \"react/destructuring-assignment\": [\n \"warn\",\n \"always\",\n { ignoreClassFields: true }\n ],\n \"react/forbid-foreign-prop-types\": [\n \"warn\",\n {\n allowInPropTypes: true\n }\n ],\n \"react/jsx-boolean-value\": [\"warn\", \"never\"],\n \"react/jsx-filename-extension\": [\n \"warn\",\n {\n extensions: [\".jsx\", \".tsx\"]\n }\n ],\n \"react/jsx-pascal-case\": [\n \"warn\",\n {\n allowAllCaps: true,\n ignore: []\n }\n ],\n \"react/no-access-state-in-setstate\": \"warn\",\n \"react/no-array-index-key\": \"warn\",\n \"react/no-typos\": \"error\",\n \"react/no-unused-prop-types\": [\n \"warn\",\n {\n customValidators: [],\n skipShapeProps: true\n }\n ],\n \"react/no-unused-state\": \"warn\",\n \"react/style-prop-object\": \"warn\",\n\n // React rules turned off in favor of @stylistic\n \"react/jsx-closing-bracket-location\": \"off\",\n \"react/jsx-closing-tag-location\": \"off\",\n \"react/jsx-curly-brace-presence\": \"off\",\n \"react/jsx-curly-newline\": \"off\",\n \"react/jsx-curly-spacing\": \"off\",\n \"react/jsx-equals-spacing\": \"off\",\n \"react/jsx-first-prop-new-line\": \"off\",\n \"react/jsx-indent-props\": \"off\",\n \"react/jsx-max-props-per-line\": \"off\",\n \"react/jsx-one-expression-per-line\": \"off\",\n \"react/jsx-tag-spacing\": \"off\",\n \"react/jsx-wrap-multilines\": \"off\",\n\n // React hooks recommend rules overrides\n \"react-hooks/set-state-in-effect\": \"off\",\n\n // React hooks \"compiler\" related rules\n ...compiler === false ? {\n \"react-hooks/gating\": \"off\",\n \"react-hooks/incompatible-library\": \"off\",\n \"react-hooks/preserve-manual-memoization\": \"off\",\n \"react-hooks/unsupported-syntax\": \"off\"\n } : {},\n\n // @stylistic rules (cannot use the recommended config\" because it would conflict with the \"typescript\" config rules)\n \"@stylistic/jsx-closing-bracket-location\": \"warn\",\n \"@stylistic/jsx-closing-tag-location\": \"warn\",\n \"@stylistic/jsx-curly-brace-presence\": [\n \"warn\",\n {\n propElementValues: \"always\"\n }\n ],\n \"@stylistic/jsx-curly-newline\": \"warn\",\n \"@stylistic/jsx-curly-spacing\": [\n \"warn\",\n {\n children: true,\n when: \"never\"\n }\n ],\n \"@stylistic/jsx-equals-spacing\": \"warn\",\n \"@stylistic/jsx-first-prop-new-line\": \"warn\",\n \"@stylistic/jsx-function-call-newline\": [\"warn\", \"multiline\"],\n \"@stylistic/jsx-max-props-per-line\": [\n \"warn\",\n {\n maximum: 1,\n when: \"multiline\"\n }\n ],\n \"@stylistic/jsx-quotes\": [\"warn\", \"prefer-double\"],\n \"@stylistic/jsx-tag-spacing\": [\n \"warn\",\n {\n beforeSelfClosing: \"always\"\n }\n ],\n \"@stylistic/jsx-wrap-multilines\": [\n \"warn\",\n {\n arrow: \"parens-new-line\",\n assignment: \"parens-new-line\",\n condition: \"parens-new-line\",\n declaration: \"parens-new-line\",\n logical: \"parens-new-line\",\n prop: \"parens-new-line\",\n propertyValue: \"parens-new-line\",\n return: \"parens-new-line\"\n }\n ],\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["stylisticPlugin","reactPlugin","reactHooksPlugin","reactGlobalIgnores","defineReactConfig","options","rules","compiler","config"],"mappings":";;;;;;;;;;;AAAuD;AAET;AACW;AAQlD,MAAMG,qBAAqB,EAAE,CAAC;AAE9B,SAASC,kBAAkBC,UAA8B,CAAC,CAAC;IAC9D,MAAM,EACFC,QAAQ,CAAC,CAAC,EACVC,WAAW,KAAK,EACnB,GAAGF;IAEJ,MAAMG,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACL,cAAcR,aAAeA;YACjC;YACA,SAAS;gBACLC,4CAAoC;gBACpC,iFAAiF;gBACjFC,kDAAyC;aAC5C;YACD,iBAAiB;gBACb,eAAe;oBACX,cAAc;wBACV,KAAK;oBACT;gBACJ;YACJ;YACA,UAAU;gBACN,OAAO;oBACH,SAAS;gBACb;YACJ;YACA,OAAO;gBACH,kCAAkC;gBAClC,sBAAsB;gBACtB,iBAAiB;gBACjB,gCAAgC;oBAC5B;oBACA;wBACI,YAAY;oBAChB;iBACH;gBACD,sBAAsB;oBAClB;oBACA;wBACI,cAAc;oBAClB;iBACH;gBACD,+BAA+B;gBAC/B,oBAAoB;gBACpB,4BAA4B;gBAE5B,oBAAoB;gBACpB,yBAAyB;gBACzB,wCAAwC;gBACxC,kCAAkC;oBAC9B;oBACA;oBACA;wBAAE,mBAAmB;oBAAK;iBAC7B;gBACD,mCAAmC;oBAC/B;oBACA;wBACI,kBAAkB;oBACtB;iBACH;gBACD,2BAA2B;oBAAC;oBAAQ;iBAAQ;gBAC5C,gCAAgC;oBAC5B;oBACA;wBACI,YAAY;4BAAC;4BAAQ;yBAAO;oBAChC;iBACH;gBACD,yBAAyB;oBACrB;oBACA;wBACI,cAAc;wBACd,QAAQ,EAAE;oBACd;iBACH;gBACD,qCAAqC;gBACrC,4BAA4B;gBAC5B,kBAAkB;gBAClB,8BAA8B;oBAC1B;oBACA;wBACI,kBAAkB,EAAE;wBACpB,gBAAgB;oBACpB;iBACH;gBACD,yBAAyB;gBACzB,2BAA2B;gBAE3B,gDAAgD;gBAChD,sCAAsC;gBACtC,kCAAkC;gBAClC,kCAAkC;gBAClC,2BAA2B;gBAC3B,2BAA2B;gBAC3B,4BAA4B;gBAC5B,iCAAiC;gBACjC,0BAA0B;gBAC1B,gCAAgC;gBAChC,qCAAqC;gBACrC,yBAAyB;gBACzB,6BAA6B;gBAE7B,wCAAwC;gBACxC,mCAAmC;gBAEnC,uCAAuC;gBACvC,GAAGK,aAAa,QAAQ;oBACpB,sBAAsB;oBACtB,oCAAoC;oBACpC,2CAA2C;oBAC3C,kCAAkC;gBACtC,IAAI,CAAC,CAAC;gBAEN,qHAAqH;gBACrH,2CAA2C;gBAC3C,uCAAuC;gBACvC,uCAAuC;oBACnC;oBACA;wBACI,mBAAmB;oBACvB;iBACH;gBACD,gCAAgC;gBAChC,gCAAgC;oBAC5B;oBACA;wBACI,UAAU;wBACV,MAAM;oBACV;iBACH;gBACD,iCAAiC;gBACjC,sCAAsC;gBACtC,wCAAwC;oBAAC;oBAAQ;iBAAY;gBAC7D,qCAAqC;oBACjC;oBACA;wBACI,SAAS;wBACT,MAAM;oBACV;iBACH;gBACD,yBAAyB;oBAAC;oBAAQ;iBAAgB;gBAClD,8BAA8B;oBAC1B;oBACA;wBACI,mBAAmB;oBACvB;iBACH;gBACD,kCAAkC;oBAC9B;oBACA;wBACI,OAAO;wBACP,YAAY;wBACZ,WAAW;wBACX,aAAa;wBACb,SAAS;wBACT,MAAM;wBACN,eAAe;wBACf,QAAQ;oBACZ;iBACH;gBAED,+DAA+D;gBAC/D,GAAGD,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOE;AACX"}
|
package/dist/storybook.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ export interface StorybookConfigOptions {
|
|
|
5
5
|
mainFileRules?: Partial<Linter.RulesRecord>;
|
|
6
6
|
}
|
|
7
7
|
export declare const storybookGlobalIgnores: string[];
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function defineStorybookConfig(options?: StorybookConfigOptions): ConfigWithExtends[];
|
package/dist/storybook.js
CHANGED
|
@@ -8,7 +8,7 @@ const storybookGlobalIgnores = [
|
|
|
8
8
|
"!.storybook",
|
|
9
9
|
"storybook-static"
|
|
10
10
|
];
|
|
11
|
-
function
|
|
11
|
+
function defineStorybookConfig(options = {}) {
|
|
12
12
|
const { storiesRules = {}, mainFileRules = {} } = options;
|
|
13
13
|
const config = [
|
|
14
14
|
{
|
|
@@ -41,6 +41,6 @@ function storybookConfig(options = {}) {
|
|
|
41
41
|
return config;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export {
|
|
44
|
+
export { defineStorybookConfig, storybookGlobalIgnores };
|
|
45
45
|
|
|
46
46
|
//# sourceMappingURL=storybook.js.map
|
package/dist/storybook.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook.js","sources":["webpack://@workleap/eslint-configs/./src/storybook.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport storybookPlugin from \"eslint-plugin-storybook\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface StorybookConfigOptions {\n storiesRules?: Partial<Linter.RulesRecord>;\n mainFileRules?: Partial<Linter.RulesRecord>;\n}\n\nexport const storybookGlobalIgnores = [\n \"!.storybook\",\n \"storybook-static\"\n];\n\nexport function
|
|
1
|
+
{"version":3,"file":"storybook.js","sources":["webpack://@workleap/eslint-configs/./src/storybook.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport storybookPlugin from \"eslint-plugin-storybook\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface StorybookConfigOptions {\n storiesRules?: Partial<Linter.RulesRecord>;\n mainFileRules?: Partial<Linter.RulesRecord>;\n}\n\nexport const storybookGlobalIgnores = [\n \"!.storybook\",\n \"storybook-static\"\n];\n\nexport function defineStorybookConfig(options: StorybookConfigOptions = {}) {\n const {\n storiesRules = {},\n mainFileRules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [\n {\n name: \"@workleap/eslint-configs/storybook-stories\",\n files: [\n \"**/*.{stories,storybook,story,chroma}.{js,ts,jsx,tsx}\"\n ],\n extends: [\n // @ts-expect-error the typings are broken and think there's a \".default\" to add.\n storybookPlugin.configs[\"flat/recommended\"]\n // // @ts-expect-error the types are broken and think there's a \".default\" to add.\n // storybookPlugin.configs[\"flat/csf\"],\n // // @ts-expect-error the types are broken and think there's a \".default\" to add.\n // storybookPlugin.configs[\"flat/csf-strict\"]\n ],\n rules: storiesRules\n },\n {\n name: \"@workleap/eslint-configs/storybook-main\",\n files: [\"**/{.storybook,storybook}/main.@(js|cjs|mjs|ts)\"],\n plugins: {\n // @ts-expect-error the typings are broken.\n storybook: storybookPlugin\n },\n rules: {\n \"storybook/no-uninstalled-addons\": \"warn\",\n // Positioned last to allow the consumer to override any rules.\n ...mainFileRules\n }\n }\n ];\n\n return config;\n};\n"],"names":["storybookPlugin","storybookGlobalIgnores","defineStorybookConfig","options","storiesRules","mainFileRules","config"],"mappings":";;;;;AACsD;AAQ/C,MAAMC,yBAAyB;IAClC;IACA;CACH,CAAC;AAEK,SAASC,sBAAsBC,UAAkC,CAAC,CAAC;IACtE,MAAM,EACFC,eAAe,CAAC,CAAC,EACjBC,gBAAgB,CAAC,CAAC,EACrB,GAAGF;IAEJ,MAAMG,SAA8B;QAChC;YACI,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACL,iFAAiF;gBACjFN,mDAA2C;aAK9C;YACD,OAAOI;QACX;QACA;YACI,MAAM;YACN,OAAO;gBAAC;aAAkD;YAC1D,SAAS;gBACL,2CAA2C;gBAC3C,WAAWJ,uBAAeA;YAC9B;YACA,OAAO;gBACH,mCAAmC;gBACnC,+DAA+D;gBAC/D,GAAGK,aAAa;YACpB;QACJ;KACH;IAED,OAAOC;AACX"}
|
package/dist/testingLibrary.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ export interface TestingLibraryConfigOptions {
|
|
|
5
5
|
jsRules?: Partial<Linter.RulesRecord>;
|
|
6
6
|
}
|
|
7
7
|
export declare const testingLibraryGlobalIgnores: never[];
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function defineTestingLibraryConfig(options?: TestingLibraryConfigOptions): ConfigWithExtends[];
|
package/dist/testingLibrary.js
CHANGED
|
@@ -5,7 +5,7 @@ import eslint_plugin_testing_library from "eslint-plugin-testing-library";
|
|
|
5
5
|
;// CONCATENATED MODULE: ./src/testingLibrary.ts
|
|
6
6
|
|
|
7
7
|
const testingLibraryGlobalIgnores = [];
|
|
8
|
-
function
|
|
8
|
+
function defineTestingLibraryConfig(options = {}) {
|
|
9
9
|
const { reactRules = {}, jsRules = {} } = options;
|
|
10
10
|
const config = [
|
|
11
11
|
{
|
|
@@ -38,6 +38,6 @@ function testingLibraryConfig(options = {}) {
|
|
|
38
38
|
return config;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export {
|
|
41
|
+
export { defineTestingLibraryConfig, testingLibraryGlobalIgnores };
|
|
42
42
|
|
|
43
43
|
//# sourceMappingURL=testingLibrary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testingLibrary.js","sources":["webpack://@workleap/eslint-configs/./src/testingLibrary.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport testingLibraryPlugin from \"eslint-plugin-testing-library\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface TestingLibraryConfigOptions {\n reactRules?: Partial<Linter.RulesRecord>;\n jsRules?: Partial<Linter.RulesRecord>;\n}\n\nexport const testingLibraryGlobalIgnores = [];\n\nexport function
|
|
1
|
+
{"version":3,"file":"testingLibrary.js","sources":["webpack://@workleap/eslint-configs/./src/testingLibrary.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport testingLibraryPlugin from \"eslint-plugin-testing-library\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface TestingLibraryConfigOptions {\n reactRules?: Partial<Linter.RulesRecord>;\n jsRules?: Partial<Linter.RulesRecord>;\n}\n\nexport const testingLibraryGlobalIgnores = [];\n\nexport function defineTestingLibraryConfig(options: TestingLibraryConfigOptions = {}) {\n const {\n reactRules = {},\n jsRules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [\n {\n name: \"@workleap/eslint-configs/testing-library-react\",\n files: [\n \"**/*.test.[jt]sx\",\n \"**/*-test.[jt]sx\",\n \"**/__tests__/*.[jt]sx\",\n \"**/test.[jt]sx\"\n ],\n extends: [\n testingLibraryPlugin.configs[\"flat/react\"]\n ],\n rules: reactRules\n },\n {\n name: \"@workleap/eslint-configs/testing-library-js\",\n files: [\n \"**/*.test.[jt]s\",\n \"**/*-test.[jt]s\",\n \"**/__tests__/*.[jt]s\",\n \"**/test.[jt]s\"\n ],\n extends: [\n testingLibraryPlugin.configs[\"flat/dom\"]\n ],\n rules: jsRules\n }\n ];\n\n return config;\n};\n"],"names":["testingLibraryPlugin","testingLibraryGlobalIgnores","defineTestingLibraryConfig","options","reactRules","jsRules","config"],"mappings":";;;;;AACiE;AAQ1D,MAAMC,8BAA8B,EAAE,CAAC;AAEvC,SAASC,2BAA2BC,UAAuC,CAAC,CAAC;IAChF,MAAM,EACFC,aAAa,CAAC,CAAC,EACfC,UAAU,CAAC,CAAC,EACf,GAAGF;IAEJ,MAAMG,SAA8B;QAChC;YACI,MAAM;YACN,OAAO;gBACH;gBACA;gBACA;gBACA;aACH;YACD,SAAS;gBACLN,mDAA0C;aAC7C;YACD,OAAOI;QACX;QACA;YACI,MAAM;YACN,OAAO;gBACH;gBACA;gBACA;gBACA;aACH;YACD,SAAS;gBACLJ,iDAAwC;aAC3C;YACD,OAAOK;QACX;KACH;IAED,OAAOC;AACX"}
|
package/dist/typescript.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Linter } from "eslint";
|
|
2
2
|
import type { ConfigWithExtends } from "./types.ts";
|
|
3
|
-
export interface
|
|
3
|
+
export interface TypeScriptConfigOptions {
|
|
4
4
|
rules?: Partial<Linter.RulesRecord>;
|
|
5
5
|
}
|
|
6
6
|
export declare const typescriptGlobalIgnores: never[];
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function defineTypeScriptConfig(tsconfigRootDir: string, options?: TypeScriptConfigOptions): ConfigWithExtends[];
|
package/dist/typescript.js
CHANGED
|
@@ -13,7 +13,7 @@ import typescript_eslint from "typescript-eslint";
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
const typescriptGlobalIgnores = [];
|
|
16
|
-
function
|
|
16
|
+
function defineTypeScriptConfig(tsconfigRootDir, options = {}) {
|
|
17
17
|
const { rules = {} } = options;
|
|
18
18
|
const config = [
|
|
19
19
|
{
|
|
@@ -177,6 +177,6 @@ function typescriptConfig(tsconfigRootDir, options = {}) {
|
|
|
177
177
|
return config;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
export {
|
|
180
|
+
export { defineTypeScriptConfig, typescriptGlobalIgnores };
|
|
181
181
|
|
|
182
182
|
//# sourceMappingURL=typescript.js.map
|
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
|
|
1
|
+
{"version":3,"file":"typescript.js","sources":["webpack://@workleap/eslint-configs/./src/typescript.ts"],"sourcesContent":["import js from \"@eslint/js\";\nimport stylisticPlugin from \"@stylistic/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport tseslint from \"typescript-eslint\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface TypeScriptConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const typescriptGlobalIgnores = [];\n\nexport function defineTypeScriptConfig(tsconfigRootDir: string, options: TypeScriptConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/typescript\",\n files: [\n \"**/*.{ts,tsx}\"\n ],\n plugins: {\n \"@stylistic\": stylisticPlugin\n },\n extends: [\n js.configs.recommended,\n tseslint.configs.recommendedTypeChecked,\n tseslint.configs.stylisticTypeCheckedOnly,\n stylisticPlugin.configs.customize({\n braceStyle: \"1tbs\",\n commaDangle: \"never\",\n jsx: false,\n quotes: \"double\",\n semi: true,\n severity: \"warn\"\n })\n ],\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n // Rely on TypeScript's project service to automatically discover the \"tsconfig.json\" file\n // within the boundaries of \"tsconfigRootDir\".\n projectService: true,\n tsconfigRootDir\n }\n },\n rules: {\n // ESLint core rules overrides\n \"dot-notation\": \"off\",\n \"indent\": \"off\",\n \"no-dupe-class-members\": \"off\",\n \"no-empty-function\": \"off\",\n \"no-loop-func\": \"off\",\n \"no-shadow\": \"off\",\n \"no-unused-expressions\": \"off\",\n \"no-use-before-define\": \"off\",\n \"no-useless-constructor\": \"off\",\n \"object-curly-spacing\": \"off\",\n \"quotes\": \"off\",\n \"semi\": \"off\",\n\n // ESlint deprecated core rules\n \"arrow-parens\": \"off\",\n \"comma-dangle\": \"off\",\n\n // @typescript-eslint recommended rules overrides\n \"@typescript-eslint/dot-notation\": \"off\",\n \"@typescript-eslint/no-base-to-string\": \"off\",\n \"@typescript-eslint/no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\"\n }\n ],\n \"@typescript-eslint/no-floating-promises\": \"off\",\n // This rule should be enabled but has several options that need to be investigated.\n \"@typescript-eslint/no-misused-promises\": \"off\",\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\n \"@typescript-eslint/no-unsafe-argument\": \"off\",\n \"@typescript-eslint/no-unsafe-assignment\": \"off\",\n \"@typescript-eslint/no-unsafe-call\": \"off\",\n \"@typescript-eslint/no-unsafe-member-access\": \"off\",\n \"@typescript-eslint/no-unsafe-return\": \"off\",\n \"@typescript-eslint/only-throw-error\": \"off\",\n \"@typescript-eslint/prefer-nullish-coalescing\": \"off\",\n \"@typescript-eslint/restrict-template-expressions\": \"off\",\n // This rule should be enabled but it's strangely causing issues with common React Aria patterns\n // when destructuring an object literal returned by a hook like \"useFilter\".\n \"@typescript-eslint/unbound-method\": \"off\",\n\n // @stylistic recommend rules overrides\n \"@stylistic/arrow-parens\": [\n \"warn\",\n \"as-needed\",\n {\n requireForBlockBody: false\n }\n ],\n \"@stylistic/indent\": [\n \"warn\",\n 4,\n {\n SwitchCase: 1,\n CallExpression: { arguments: \"first\" }\n }\n ],\n \"@stylistic/indent-binary-ops\": [\"warn\", 4],\n \"@stylistic/member-delimiter-style\": [\n \"warn\",\n {\n multiline: {\n delimiter: \"semi\"\n },\n singleline: {\n delimiter: \"semi\"\n }\n }\n ],\n \"@stylistic/multiline-ternary\": \"off\",\n \"@stylistic/no-mixed-operators\": [\n \"warn\",\n {\n groups: [\n [\"&\", \"|\", \"^\", \"~\", \"<<\", \">>\", \">>>\"],\n [\"==\", \"!=\", \"===\", \"!==\", \">\", \">=\", \"<\", \"<=\"],\n [\"&&\", \"||\"],\n [\"in\", \"instanceof\"]\n ],\n allowSamePrecedence: false\n }\n ],\n \"@stylistic/no-multiple-empty-lines\": [\n \"warn\",\n {\n // View https://eslint.style/rules/eol-last.\n max: 1\n }\n ],\n \"@stylistic/operator-linebreak\": \"off\",\n \"@stylistic/spaced-comment\": \"off\",\n // Should be the default but somehow it's not enforced if it's not explicitly specified.\n \"@stylistic/quote-props\": \"off\",\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["js","stylisticPlugin","tseslint","typescriptGlobalIgnores","defineTypeScriptConfig","tsconfigRootDir","options","rules","config"],"mappings":";;;;;;;;;;;AAA4B;AAC2B;AAEd;AAOlC,MAAMG,0BAA0B,EAAE,CAAC;AAEnC,SAASC,uBAAuBC,eAAuB,EAAEC,UAAmC,CAAC,CAAC;IACjG,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;aACH;YACD,SAAS;gBACL,cAAcP,aAAeA;YACjC;YACA,SAAS;gBACLD,sBAAsB;gBACtBE,gDAAuC;gBACvCA,kDAAyC;gBACzCD,+BAAiC,CAAC;oBAC9B,YAAY;oBACZ,aAAa;oBACb,KAAK;oBACL,QAAQ;oBACR,MAAM;oBACN,UAAU;gBACd;aACH;YACD,iBAAiB;gBACb,QAAQC,wBAAe;gBACvB,eAAe;oBACX,0FAA0F;oBAC1F,8CAA8C;oBAC9C,gBAAgB;oBAChBG;gBACJ;YACJ;YACA,OAAO;gBACH,8BAA8B;gBAC9B,gBAAgB;gBAChB,UAAU;gBACV,yBAAyB;gBACzB,qBAAqB;gBACrB,gBAAgB;gBAChB,aAAa;gBACb,yBAAyB;gBACzB,wBAAwB;gBACxB,0BAA0B;gBAC1B,wBAAwB;gBACxB,UAAU;gBACV,QAAQ;gBAER,+BAA+B;gBAC/B,gBAAgB;gBAChB,gBAAgB;gBAEhB,iDAAiD;gBACjD,mCAAmC;gBACnC,wCAAwC;gBACxC,wCAAwC;gBACxC,2CAA2C;oBACvC;oBACA;wBACI,iBAAiB;wBACjB,kBAAkB;oBACtB;iBACH;gBACD,2CAA2C;gBAC3C,oFAAoF;gBACpF,0CAA0C;gBAC1C,4CAA4C;gBAC5C,yCAAyC;gBACzC,2CAA2C;gBAC3C,qCAAqC;gBACrC,8CAA8C;gBAC9C,uCAAuC;gBACvC,uCAAuC;gBACvC,gDAAgD;gBAChD,oDAAoD;gBACpD,gGAAgG;gBAChG,4EAA4E;gBAC5E,qCAAqC;gBAErC,uCAAuC;gBACvC,2BAA2B;oBACvB;oBACA;oBACA;wBACI,qBAAqB;oBACzB;iBACH;gBACD,qBAAqB;oBACjB;oBACA;oBACA;wBACI,YAAY;wBACZ,gBAAgB;4BAAE,WAAW;wBAAQ;oBACzC;iBACH;gBACD,gCAAgC;oBAAC;oBAAQ;iBAAE;gBAC3C,qCAAqC;oBACjC;oBACA;wBACI,WAAW;4BACP,WAAW;wBACf;wBACA,YAAY;4BACR,WAAW;wBACf;oBACJ;iBACH;gBACD,gCAAgC;gBAChC,iCAAiC;oBAC7B;oBACA;wBACI,QAAQ;4BACJ;gCAAC;gCAAK;gCAAK;gCAAK;gCAAK;gCAAM;gCAAM;6BAAM;4BACvC;gCAAC;gCAAM;gCAAM;gCAAO;gCAAO;gCAAK;gCAAM;gCAAK;6BAAK;4BAChD;gCAAC;gCAAM;6BAAK;4BACZ;gCAAC;gCAAM;6BAAa;yBACvB;wBACD,qBAAqB;oBACzB;iBACH;gBACD,sCAAsC;oBAClC;oBACA;wBACI,4CAA4C;wBAC5C,KAAK;oBACT;iBACH;gBACD,iCAAiC;gBACjC,6BAA6B;gBAC7B,wFAAwF;gBACxF,0BAA0B;gBAE1B,+DAA+D;gBAC/D,GAAGE,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
|
package/dist/vitest.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Linter } from "eslint";
|
|
2
2
|
import type { ConfigWithExtends } from "./types.ts";
|
|
3
3
|
export interface VitestConfigOptions {
|
|
4
|
+
enabled?: boolean;
|
|
4
5
|
rules?: Partial<Linter.RulesRecord>;
|
|
5
6
|
}
|
|
6
7
|
export declare const vitestGlobalIgnores: never[];
|
|
7
|
-
export declare function
|
|
8
|
+
export declare function defineVitestConfig(options?: VitestConfigOptions): ConfigWithExtends[];
|
package/dist/vitest.js
CHANGED
|
@@ -5,8 +5,11 @@ import eslint_plugin from "@vitest/eslint-plugin";
|
|
|
5
5
|
;// CONCATENATED MODULE: ./src/vitest.ts
|
|
6
6
|
|
|
7
7
|
const vitestGlobalIgnores = [];
|
|
8
|
-
function
|
|
9
|
-
const { rules = {} } = options;
|
|
8
|
+
function defineVitestConfig(options = {}) {
|
|
9
|
+
const { enabled = true, rules = {} } = options;
|
|
10
|
+
if (!enabled) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
10
13
|
const config = [
|
|
11
14
|
{
|
|
12
15
|
name: "@workleap/eslint-configs/vitest",
|
|
@@ -35,6 +38,6 @@ function vitestConfig(options = {}) {
|
|
|
35
38
|
return config;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
|
-
export {
|
|
41
|
+
export { defineVitestConfig, vitestGlobalIgnores };
|
|
39
42
|
|
|
40
43
|
//# sourceMappingURL=vitest.js.map
|
package/dist/vitest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.js","sources":["webpack://@workleap/eslint-configs/./src/vitest.ts"],"sourcesContent":["import vitestPlugin from \"@vitest/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface VitestConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const vitestGlobalIgnores = [];\n\nexport function
|
|
1
|
+
{"version":3,"file":"vitest.js","sources":["webpack://@workleap/eslint-configs/./src/vitest.ts"],"sourcesContent":["import vitestPlugin from \"@vitest/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface VitestConfigOptions {\n enabled?: boolean;\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const vitestGlobalIgnores = [];\n\nexport function defineVitestConfig(options: VitestConfigOptions = {}) {\n const {\n enabled = true,\n rules = {}\n } = options;\n\n if (!enabled) {\n return [];\n }\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/vitest\",\n files: [\n \"**/*.test.{js,jsx,ts,tsx}\",\n \"**/*-test.{js,jsx,ts,tsx}\",\n \"**/__tests__/*.{js,jsx,ts,tsx}\",\n \"**/test.{js,jsx,ts,tsx}\"\n ],\n plugins: {\n // @ts-expect-error temporary code until defineConfig is supported.\n vitest: vitestPlugin\n },\n // Waiting for defineConfig support: https://github.com/vitest-dev/eslint-plugin-vitest/issues/771\n // extends: [\n // vitestPlugin.configs.recommended\n // ],\n rules: {\n ...vitestPlugin.configs.recommended.rules,\n \"vitest/no-commented-out-tests\": \"off\",\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["vitestPlugin","vitestGlobalIgnores","defineVitestConfig","options","enabled","rules","config"],"mappings":";;;;;AAAiD;AAS1C,MAAMC,sBAAsB,EAAE,CAAC;AAE/B,SAASC,mBAAmBC,UAA+B,CAAC,CAAC;IAChE,MAAM,EACFC,UAAU,IAAI,EACdC,QAAQ,CAAC,CAAC,EACb,GAAGF;IAEJ,IAAI,CAACC,SAAS;QACV,OAAO,EAAE;IACb;IAEA,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;gBACA;gBACA;gBACA;aACH;YACD,SAAS;gBACL,mEAAmE;gBACnE,QAAQN,aAAYA;YACxB;YACA,kGAAkG;YAClG,aAAa;YACb,uCAAuC;YACvC,KAAK;YACL,OAAO;gBACH,GAAGA,uCAAsC;gBACzC,iCAAiC;gBACjC,+DAA+D;gBAC/D,GAAGK,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
|
package/dist/yaml.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export interface YamlConfigOptions {
|
|
|
4
4
|
rules?: Partial<Linter.RulesRecord>;
|
|
5
5
|
}
|
|
6
6
|
export declare const yamlGlobalIgnores: string[];
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function defineYamlConfig(options?: YamlConfigOptions): ConfigWithExtends[];
|
package/dist/yaml.js
CHANGED
|
@@ -7,7 +7,7 @@ import eslint_plugin_yaml from "eslint-plugin-yaml";
|
|
|
7
7
|
const yamlGlobalIgnores = [
|
|
8
8
|
"pnpm-lock.yaml"
|
|
9
9
|
];
|
|
10
|
-
function
|
|
10
|
+
function defineYamlConfig(options = {}) {
|
|
11
11
|
const { rules = {} } = options;
|
|
12
12
|
const config = [
|
|
13
13
|
{
|
|
@@ -26,6 +26,6 @@ function yamlConfig(options = {}) {
|
|
|
26
26
|
return config;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export {
|
|
29
|
+
export { defineYamlConfig, yamlGlobalIgnores };
|
|
30
30
|
|
|
31
31
|
//# sourceMappingURL=yaml.js.map
|
package/dist/yaml.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml.js","sources":["webpack://@workleap/eslint-configs/./src/yaml.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport yamlPlugin from \"eslint-plugin-yaml\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface YamlConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const yamlGlobalIgnores = [\n \"pnpm-lock.yaml\"\n];\n\nexport function
|
|
1
|
+
{"version":3,"file":"yaml.js","sources":["webpack://@workleap/eslint-configs/./src/yaml.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport yamlPlugin from \"eslint-plugin-yaml\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface YamlConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const yamlGlobalIgnores = [\n \"pnpm-lock.yaml\"\n];\n\nexport function defineYamlConfig(options: YamlConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/yaml\",\n files: [\n \"**/*.yaml\",\n \"**/*.yml\"\n ],\n extends: [\n // @ts-expect-error the typings are broken.\n yamlPlugin.configs.recommended\n ],\n rules\n }];\n\n return config;\n};\n"],"names":["yamlPlugin","yamlGlobalIgnores","defineYamlConfig","options","rules","config"],"mappings":";;;;;AAC4C;AAOrC,MAAMC,oBAAoB;IAC7B;CACH,CAAC;AAEK,SAASC,iBAAiBC,UAA6B,CAAC,CAAC;IAC5D,MAAM,EACFC,QAAQ,CAAC,CAAC,EACb,GAAGD;IAEJ,MAAME,SAA8B;QAAC;YACjC,MAAM;YACN,OAAO;gBACH;gBACA;aACH;YACD,SAAS;gBACL,2CAA2C;gBAC3CL,sCAA8B;aACjC;YACDI;QACJ;KAAE;IAEF,OAAOC;AACX"}
|