@workleap/eslint-configs 0.0.2

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.
Files changed (76) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +201 -0
  3. package/README.md +16 -0
  4. package/dist/by-project-type/defineMonorepoWorkspaceConfig.d.ts +15 -0
  5. package/dist/by-project-type/defineMonorepoWorkspaceConfig.js +51 -0
  6. package/dist/by-project-type/defineMonorepoWorkspaceConfig.js.map +1 -0
  7. package/dist/by-project-type/defineReactLibraryConfig.d.ts +27 -0
  8. package/dist/by-project-type/defineReactLibraryConfig.js +96 -0
  9. package/dist/by-project-type/defineReactLibraryConfig.js.map +1 -0
  10. package/dist/by-project-type/defineTypescriptLibraryConfig.d.ts +19 -0
  11. package/dist/by-project-type/defineTypescriptLibraryConfig.js +72 -0
  12. package/dist/by-project-type/defineTypescriptLibraryConfig.js.map +1 -0
  13. package/dist/by-project-type/defineWebApplicationConfig.d.ts +27 -0
  14. package/dist/by-project-type/defineWebApplicationConfig.js +96 -0
  15. package/dist/by-project-type/defineWebApplicationConfig.js.map +1 -0
  16. package/dist/core.d.ts +7 -0
  17. package/dist/core.js +184 -0
  18. package/dist/core.js.map +1 -0
  19. package/dist/index.d.ts +15 -0
  20. package/dist/index.js +22 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/jest.d.ts +7 -0
  23. package/dist/jest.js +55 -0
  24. package/dist/jest.js.map +1 -0
  25. package/dist/jsxAlly.d.ts +7 -0
  26. package/dist/jsxAlly.js +51 -0
  27. package/dist/jsxAlly.js.map +1 -0
  28. package/dist/packageJson.d.ts +7 -0
  29. package/dist/packageJson.js +47 -0
  30. package/dist/packageJson.js.map +1 -0
  31. package/dist/plugins/strictCssModulesNames.d.ts +7 -0
  32. package/dist/plugins/strictCssModulesNames.js +70 -0
  33. package/dist/plugins/strictCssModulesNames.js.map +1 -0
  34. package/dist/plugins/workleapPlugin.d.ts +5 -0
  35. package/dist/plugins/workleapPlugin.js +15 -0
  36. package/dist/plugins/workleapPlugin.js.map +1 -0
  37. package/dist/react.d.ts +7 -0
  38. package/dist/react.js +189 -0
  39. package/dist/react.js.map +1 -0
  40. package/dist/storybook.d.ts +8 -0
  41. package/dist/storybook.js +46 -0
  42. package/dist/storybook.js.map +1 -0
  43. package/dist/testingLibrary.d.ts +8 -0
  44. package/dist/testingLibrary.js +43 -0
  45. package/dist/testingLibrary.js.map +1 -0
  46. package/dist/types.d.ts +19 -0
  47. package/dist/types.js +9 -0
  48. package/dist/types.js.map +1 -0
  49. package/dist/typescript.d.ts +7 -0
  50. package/dist/typescript.js +139 -0
  51. package/dist/typescript.js.map +1 -0
  52. package/dist/vitest.d.ts +7 -0
  53. package/dist/vitest.js +40 -0
  54. package/dist/vitest.js.map +1 -0
  55. package/dist/yaml.d.ts +7 -0
  56. package/dist/yaml.js +31 -0
  57. package/dist/yaml.js.map +1 -0
  58. package/package.json +82 -0
  59. package/src/by-project-type/defineMonorepoWorkspaceConfig.ts +45 -0
  60. package/src/by-project-type/defineReactLibraryConfig.ts +81 -0
  61. package/src/by-project-type/defineTypescriptLibraryConfig.ts +61 -0
  62. package/src/by-project-type/defineWebApplicationConfig.ts +114 -0
  63. package/src/core.ts +138 -0
  64. package/src/index.ts +16 -0
  65. package/src/jest.ts +53 -0
  66. package/src/jsxAlly.ts +52 -0
  67. package/src/packageJson.ts +48 -0
  68. package/src/plugins/strictCssModulesNames.ts +75 -0
  69. package/src/plugins/workleapPlugin.ts +7 -0
  70. package/src/react.ts +175 -0
  71. package/src/storybook.ts +53 -0
  72. package/src/testingLibrary.ts +48 -0
  73. package/src/types.ts +27 -0
  74. package/src/typescript.ts +133 -0
  75. package/src/vitest.ts +41 -0
  76. package/src/yaml.ts +32 -0
package/src/vitest.ts ADDED
@@ -0,0 +1,41 @@
1
+ import vitestPlugin from "@vitest/eslint-plugin";
2
+ import type { Linter } from "eslint";
3
+ import type { ConfigWithExtends } from "./types.ts";
4
+
5
+ export interface VitestConfigOptions {
6
+ rules?: Partial<Linter.RulesRecord>;
7
+ }
8
+
9
+ export const vitestGlobalIgnores = [];
10
+
11
+ export function vitestConfig(options: VitestConfigOptions = {}) {
12
+ const {
13
+ rules = {}
14
+ } = options;
15
+
16
+ const config: ConfigWithExtends[] = [{
17
+ name: "@workleap/eslint-configs/vitest",
18
+ files: [
19
+ "**/*.test.{js,jsx,ts,tsx}",
20
+ "**/*-test.{js,jsx,ts,tsx}",
21
+ "**/__tests__/*.{js,jsx,ts,tsx}",
22
+ "**/test.{js,jsx,ts,tsx}"
23
+ ],
24
+ plugins: {
25
+ // @ts-expect-error temporary code until defineConfig is supported.
26
+ vitest: vitestPlugin
27
+ },
28
+ // Waiting for defineConfig support: https://github.com/vitest-dev/eslint-plugin-vitest/issues/771
29
+ // extends: [
30
+ // vitestPlugin.configs.recommended
31
+ // ],
32
+ rules: {
33
+ ...vitestPlugin.configs.recommended.rules,
34
+ "vitest/no-commented-out-tests": "off",
35
+ // Positioned last to allow the consumer to override any rules.
36
+ ...rules
37
+ }
38
+ }];
39
+
40
+ return config;
41
+ };
package/src/yaml.ts ADDED
@@ -0,0 +1,32 @@
1
+ import type { Linter } from "eslint";
2
+ import yamlPlugin from "eslint-plugin-yaml";
3
+ import type { ConfigWithExtends } from "./types.ts";
4
+
5
+ export interface YamlConfigOptions {
6
+ rules?: Partial<Linter.RulesRecord>;
7
+ }
8
+
9
+ export const yamlGlobalIgnores = [
10
+ "pnpm-lock.yaml"
11
+ ];
12
+
13
+ export function yamlConfig(options: YamlConfigOptions = {}) {
14
+ const {
15
+ rules = {}
16
+ } = options;
17
+
18
+ const config: ConfigWithExtends[] = [{
19
+ name: "@workleap/eslint-configs/yaml",
20
+ files: [
21
+ "**/*.yaml",
22
+ "**/*.yml"
23
+ ],
24
+ extends: [
25
+ // @ts-expect-error the typings are broken.
26
+ yamlPlugin.configs.recommended
27
+ ],
28
+ rules
29
+ }];
30
+
31
+ return config;
32
+ };