-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathfolderStructure.mjs
73 lines (65 loc) · 1.64 KB
/
folderStructure.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// @ts-check
import { createFolderStructure } from "eslint-plugin-project-structure";
export const folderStructureConfig = createFolderStructure({
structure: [
{ name: ".(husky|github)", children: [] },
{ name: "images", children: [{ name: "*.png" }] },
{
name: "src",
children: [
{ ruleId: "rules_folder" },
{ ruleId: "helpers_folder" },
{ ruleId: "errors_folder" },
{ name: "consts.ts" },
{ name: "types.ts" },
{ name: "index.ts" },
{ name: "parser.ts" },
],
},
{
name: "types",
children: [{ name: "*.d.ts" }],
},
{ name: "*" },
],
rules: {
additional_files: { name: "{folderName}(.(types|consts|test)).ts" },
test_file: { name: "{camelCase}.test.ts" },
helper_folder: {
name: "{camelCase}",
children: [
{ ruleId: "helpers_folder" },
{ ruleId: "additional_files" },
{ name: "{folderName}.ts" },
],
},
helpers_folder: {
name: "helpers",
children: [
{ ruleId: "helper_folder" },
{ name: "{camelCase}.test.ts" },
{ name: "{camelCase}.ts" },
],
},
rule_folder: {
name: "{camelCase}",
children: [
{ ruleId: "helpers_folder" },
{ ruleId: "errors_folder" },
{ ruleId: "additional_files" },
{ name: "{folderName}.ts" },
],
},
rules_folder: {
name: "rules",
children: [{ ruleId: "rule_folder" }],
},
errors_folder: {
name: "errors",
children: [
{ name: "{camelCase}(.test)?.ts" },
{ name: "{PascalCase}(.test)?.ts" },
],
},
},
});