@cerios/sparta-lint-rules 0.0.2 → 0.0.3
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/README.md +41 -10
- package/dist/conventions-DK3A7JWL.d.cts +97 -0
- package/dist/conventions-DK3A7JWL.d.mts +97 -0
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -1
- package/dist/index.d.mts +16 -2
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/oxlint.cjs +2 -1
- package/dist/oxlint.cjs.map +1 -1
- package/dist/oxlint.d.cts +18 -1
- package/dist/oxlint.d.mts +19 -2
- package/dist/oxlint.mjs +2 -1
- package/dist/oxlint.mjs.map +1 -1
- package/dist/{plugin-types-CXFDQLJF.d.cts → plugin-types-7QJakt0Z.d.cts} +8 -3
- package/dist/{plugin-types-CXFDQLJF.d.mts → plugin-types-7QJakt0Z.d.mts} +8 -3
- package/dist/{rules-T_C5segG.cjs → rules-5VZcw4ds.cjs} +43 -29
- package/dist/rules-5VZcw4ds.cjs.map +1 -0
- package/dist/{rules-D94N3gGx.mjs → rules-Ay2ZlXtg.mjs} +43 -29
- package/dist/rules-Ay2ZlXtg.mjs.map +1 -0
- package/dist/settings.cjs +1 -0
- package/dist/settings.d.cts +5 -96
- package/dist/settings.d.mts +5 -96
- package/dist/settings.mjs +1 -0
- package/oxlintrc.schema.json +718 -0
- package/package.json +10 -3
- package/dist/rules-D94N3gGx.mjs.map +0 -1
- package/dist/rules-T_C5segG.cjs.map +0 -1
package/dist/settings.d.mts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
|
|
1
2
|
/**
|
|
2
|
-
* Types for `settings.sparta
|
|
3
|
+
* Types for `settings.sparta`. Most lint configs don't need them: importing `@cerios/sparta-lint-rules/oxlint`
|
|
4
|
+
* (oxlint) or the plugin (ESLint 10+) already types `settings.sparta` in `defineConfig()`. Use them on ESLint 9,
|
|
5
|
+
* or for settings you build outside the config:
|
|
3
6
|
*
|
|
4
7
|
* ```ts
|
|
5
8
|
* import type { SpartaSettings } from "@cerios/sparta-lint-rules/settings";
|
|
@@ -7,99 +10,5 @@
|
|
|
7
10
|
* settings: { sparta: { areas: { web: "ui" } } satisfies SpartaSettings }
|
|
8
11
|
* ```
|
|
9
12
|
*/
|
|
10
|
-
|
|
11
|
-
* The names a SPARTA project uses, and how `settings.sparta` extends them.
|
|
12
|
-
*
|
|
13
|
-
* Settings describe a project; they never relax the rules. A setting either maps a project's own name onto an
|
|
14
|
-
* existing SPARTA concept (so it gets all of that concept's checks) or adds names to detect (which only makes the
|
|
15
|
-
* rules stricter). Switching checks off is left to the linter config, where it stays visible.
|
|
16
|
-
*/
|
|
17
|
-
type Area = "api" | "database" | "desktop" | "mobile" | "ui";
|
|
18
|
-
/** A top-level SPARTA folder that aliases can point to. */
|
|
19
|
-
type TopFolder = "sparta" | "tests";
|
|
20
|
-
/** The standard layer folders, with the layer the architecture rules know them as and their file name suffix. */
|
|
21
|
-
declare const LAYER_FOLDERS: {
|
|
22
|
-
readonly asserters: {
|
|
23
|
-
readonly layer: "asserter";
|
|
24
|
-
readonly suffix: "asserter";
|
|
25
|
-
};
|
|
26
|
-
readonly builders: {
|
|
27
|
-
readonly layer: "builder";
|
|
28
|
-
readonly suffix: "builder";
|
|
29
|
-
};
|
|
30
|
-
readonly clients: {
|
|
31
|
-
readonly layer: "client";
|
|
32
|
-
readonly suffix: "client";
|
|
33
|
-
};
|
|
34
|
-
readonly components: {
|
|
35
|
-
readonly layer: "component";
|
|
36
|
-
readonly suffix: "component";
|
|
37
|
-
};
|
|
38
|
-
readonly containers: {
|
|
39
|
-
readonly layer: "container";
|
|
40
|
-
};
|
|
41
|
-
readonly databases: {
|
|
42
|
-
readonly layer: "database";
|
|
43
|
-
};
|
|
44
|
-
readonly directors: {
|
|
45
|
-
readonly layer: "director";
|
|
46
|
-
readonly suffix: "director";
|
|
47
|
-
};
|
|
48
|
-
readonly factories: {
|
|
49
|
-
readonly suffix: "factory";
|
|
50
|
-
};
|
|
51
|
-
readonly pages: {
|
|
52
|
-
readonly layer: "page";
|
|
53
|
-
readonly suffix: "page";
|
|
54
|
-
};
|
|
55
|
-
readonly repositories: {
|
|
56
|
-
readonly layer: "repository";
|
|
57
|
-
readonly suffix: "repository";
|
|
58
|
-
};
|
|
59
|
-
readonly scenarios: {
|
|
60
|
-
readonly layer: "scenario";
|
|
61
|
-
readonly suffix: "scenario";
|
|
62
|
-
};
|
|
63
|
-
readonly screens: {
|
|
64
|
-
readonly layer: "screen";
|
|
65
|
-
readonly suffix: "screen";
|
|
66
|
-
};
|
|
67
|
-
readonly services: {
|
|
68
|
-
readonly layer: "service";
|
|
69
|
-
readonly suffix: "service";
|
|
70
|
-
};
|
|
71
|
-
readonly steppers: {
|
|
72
|
-
readonly layer: "stepper";
|
|
73
|
-
readonly suffix: "stepper";
|
|
74
|
-
};
|
|
75
|
-
readonly windows: {
|
|
76
|
-
readonly layer: "window";
|
|
77
|
-
readonly suffix: "window";
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
type LayerFolder = keyof typeof LAYER_FOLDERS;
|
|
81
|
-
/** Settings accepted under `settings.sparta`. Every key is optional; the defaults are the SPARTA standard. */
|
|
82
|
-
type SpartaSettings = {
|
|
83
|
-
/** Project root that the aliases resolve against. Default: the nearest folder with a `package.json`. */
|
|
84
|
-
root?: string;
|
|
85
|
-
/** Names of the top-level folders. Default: `{ sparta: "sparta", tests: "tests" }`. */
|
|
86
|
-
folders?: {
|
|
87
|
-
sparta?: string;
|
|
88
|
-
tests?: string;
|
|
89
|
-
};
|
|
90
|
-
/** Extra area folders, mapped to the standard area they follow, e.g. `{ web: "ui" }`. */
|
|
91
|
-
areas?: Record<string, Area>;
|
|
92
|
-
/** Extra layer folders, mapped to the standard layer folder they follow, e.g. `{ "page-objects": "pages" }`. */
|
|
93
|
-
layers?: Record<string, LayerFolder>;
|
|
94
|
-
/** Extra path aliases, mapped to the top-level folder they point to, e.g. `{ "@app/*": "sparta" }`. */
|
|
95
|
-
aliases?: Record<string, TopFolder>;
|
|
96
|
-
/** The module `expect` must be imported from inside the sparta folder. Default: `@sparta/support`. */
|
|
97
|
-
supportModule?: string;
|
|
98
|
-
/** Extra retrying methods, added to `toPass`, `toPassAndReturn`, `poll` and `pollAndReturn`. */
|
|
99
|
-
pollingMethods?: string[];
|
|
100
|
-
/** Extra step decorators, added to `step`. */
|
|
101
|
-
stepDecorators?: string[];
|
|
102
|
-
/** Extra assertion functions that tests must not call, added to `expect` and `expectly…`. */
|
|
103
|
-
expectNames?: string[];
|
|
104
|
-
};
|
|
13
|
+
import { i as TopFolder, n as LayerFolder, r as SpartaSettings, t as Area } from "./conventions-DK3A7JWL.mjs";
|
|
105
14
|
export type { Area, LayerFolder, SpartaSettings, TopFolder };
|
package/dist/settings.mjs
CHANGED