@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.
- package/CHANGELOG.md +13 -0
- package/LICENSE +201 -0
- package/README.md +16 -0
- package/dist/by-project-type/defineMonorepoWorkspaceConfig.d.ts +15 -0
- package/dist/by-project-type/defineMonorepoWorkspaceConfig.js +51 -0
- package/dist/by-project-type/defineMonorepoWorkspaceConfig.js.map +1 -0
- package/dist/by-project-type/defineReactLibraryConfig.d.ts +27 -0
- package/dist/by-project-type/defineReactLibraryConfig.js +96 -0
- package/dist/by-project-type/defineReactLibraryConfig.js.map +1 -0
- package/dist/by-project-type/defineTypescriptLibraryConfig.d.ts +19 -0
- package/dist/by-project-type/defineTypescriptLibraryConfig.js +72 -0
- package/dist/by-project-type/defineTypescriptLibraryConfig.js.map +1 -0
- package/dist/by-project-type/defineWebApplicationConfig.d.ts +27 -0
- package/dist/by-project-type/defineWebApplicationConfig.js +96 -0
- package/dist/by-project-type/defineWebApplicationConfig.js.map +1 -0
- package/dist/core.d.ts +7 -0
- package/dist/core.js +184 -0
- package/dist/core.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/jest.d.ts +7 -0
- package/dist/jest.js +55 -0
- package/dist/jest.js.map +1 -0
- package/dist/jsxAlly.d.ts +7 -0
- package/dist/jsxAlly.js +51 -0
- package/dist/jsxAlly.js.map +1 -0
- package/dist/packageJson.d.ts +7 -0
- package/dist/packageJson.js +47 -0
- package/dist/packageJson.js.map +1 -0
- package/dist/plugins/strictCssModulesNames.d.ts +7 -0
- package/dist/plugins/strictCssModulesNames.js +70 -0
- package/dist/plugins/strictCssModulesNames.js.map +1 -0
- package/dist/plugins/workleapPlugin.d.ts +5 -0
- package/dist/plugins/workleapPlugin.js +15 -0
- package/dist/plugins/workleapPlugin.js.map +1 -0
- package/dist/react.d.ts +7 -0
- package/dist/react.js +189 -0
- package/dist/react.js.map +1 -0
- package/dist/storybook.d.ts +8 -0
- package/dist/storybook.js +46 -0
- package/dist/storybook.js.map +1 -0
- package/dist/testingLibrary.d.ts +8 -0
- package/dist/testingLibrary.js +43 -0
- package/dist/testingLibrary.js.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/dist/typescript.d.ts +7 -0
- package/dist/typescript.js +139 -0
- package/dist/typescript.js.map +1 -0
- package/dist/vitest.d.ts +7 -0
- package/dist/vitest.js +40 -0
- package/dist/vitest.js.map +1 -0
- package/dist/yaml.d.ts +7 -0
- package/dist/yaml.js +31 -0
- package/dist/yaml.js.map +1 -0
- package/package.json +82 -0
- package/src/by-project-type/defineMonorepoWorkspaceConfig.ts +45 -0
- package/src/by-project-type/defineReactLibraryConfig.ts +81 -0
- package/src/by-project-type/defineTypescriptLibraryConfig.ts +61 -0
- package/src/by-project-type/defineWebApplicationConfig.ts +114 -0
- package/src/core.ts +138 -0
- package/src/index.ts +16 -0
- package/src/jest.ts +53 -0
- package/src/jsxAlly.ts +52 -0
- package/src/packageJson.ts +48 -0
- package/src/plugins/strictCssModulesNames.ts +75 -0
- package/src/plugins/workleapPlugin.ts +7 -0
- package/src/react.ts +175 -0
- package/src/storybook.ts +53 -0
- package/src/testingLibrary.ts +48 -0
- package/src/types.ts +27 -0
- package/src/typescript.ts +133 -0
- package/src/vitest.ts +41 -0
- 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
|
+
};
|