@yahoo/uds-create-config 5.61.1 → 5.62.1
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/dist/configs/react-native-system.d.ts +9 -0
- package/dist/configs/system.js +2 -0
- package/dist/entities/native/NativeSettings.d.ts +9 -0
- package/dist/entities/native/NativeStyleProperty.js +4 -3
- package/dist/entities/system/Settings.d.ts +18 -0
- package/dist/entities/system/Settings.js +35 -16
- package/dist/framework/Config.d.ts +1 -1
- package/dist/framework/Config.js +1 -1
- package/dist/framework/layer-styles.d.ts +11 -1
- package/dist/framework/layer-styles.js +69 -25
- package/dist/framework/schema-version.d.ts +1 -1
- package/dist/framework/schema-version.js +5 -5
- package/dist/framework/utils/color.d.ts +14 -0
- package/dist/framework/utils/color.js +130 -0
- package/dist/framework/utils/css-length.d.ts +12 -0
- package/dist/framework/utils/css-length.js +16 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/lint/context.d.ts +254 -0
- package/dist/lint/context.js +622 -0
- package/dist/lint/edits.d.ts +77 -0
- package/dist/lint/edits.js +121 -0
- package/dist/lint/index.d.ts +5 -0
- package/dist/lint/index.js +5 -0
- package/dist/lint/lint.d.ts +107 -0
- package/dist/lint/lint.js +91 -0
- package/dist/lint/rules.d.ts +337 -0
- package/dist/lint/rules.js +466 -0
- package/dist/migrations/20261027205147_lint_ignore.d.ts +6 -0
- package/dist/migrations/20261027205147_lint_ignore.js +8 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { ConfigLintContext, ConfigLintReport, LintLayer, LintValue, LintedComponent } from "./context.js";
|
|
2
|
+
|
|
3
|
+
//#region src/lint/rules.d.ts
|
|
4
|
+
declare const AUTHORING_LINT_GROUPS: {
|
|
5
|
+
readonly portability: {
|
|
6
|
+
readonly title: "Portability";
|
|
7
|
+
readonly about: "Values that reach a component only through code, so a team that links or extends your system can’t change them.";
|
|
8
|
+
};
|
|
9
|
+
readonly editability: {
|
|
10
|
+
readonly title: "Editability";
|
|
11
|
+
readonly about: "Behavior and styling decided in code, where Create can't show or change it. Turn this group off if your system is only ever edited in code.";
|
|
12
|
+
};
|
|
13
|
+
readonly maintainability: {
|
|
14
|
+
readonly title: "Maintainability";
|
|
15
|
+
readonly about: "Styles written longer than they need to be: values your tokens already hold, the same value repeated under every option, and settings that change nothing. Each makes the next change harder.";
|
|
16
|
+
};
|
|
17
|
+
readonly design: {
|
|
18
|
+
readonly title: "Design";
|
|
19
|
+
readonly about: "Contrast, spacing and sizing your users will notice: text that is hard to read, values just off your scale, colors that stay the same in dark mode, and targets too small to tap.";
|
|
20
|
+
};
|
|
21
|
+
readonly compatibility: {
|
|
22
|
+
readonly title: "Compatibility";
|
|
23
|
+
readonly about: "Reliance on parts of the platform that are changing or internal, which a future update can break.";
|
|
24
|
+
};
|
|
25
|
+
readonly nursery: {
|
|
26
|
+
readonly title: "Nursery";
|
|
27
|
+
readonly about: "New rules still being tuned. They are off unless you turn them on, and their advice may change."; /** Naming the group turns none of them on: a nursery rule is taken up one at a time. */
|
|
28
|
+
readonly defaultSeverity: "off";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
type AuthoringLintGroup = keyof typeof AUTHORING_LINT_GROUPS;
|
|
32
|
+
declare const AUTHORING_LINT_RULES: {
|
|
33
|
+
readonly 'inline-style-on-layer': {
|
|
34
|
+
readonly group: "portability";
|
|
35
|
+
readonly label: "Inline style";
|
|
36
|
+
readonly detects: "A style written directly on an element. It beats every rule, so no edit or override can change it.";
|
|
37
|
+
readonly fix: "move the values into the layer's style rule; a value the render works out becomes a `.states()` entry a rule keys on";
|
|
38
|
+
};
|
|
39
|
+
readonly 'token-variable-as-text': {
|
|
40
|
+
readonly group: "portability";
|
|
41
|
+
readonly label: "Token spelled as text";
|
|
42
|
+
readonly detects: "A token's CSS variable typed out by hand. Rename the token and this spot keeps the old name.";
|
|
43
|
+
readonly fix: "reference the token: `Token.ref(path)` as a value, `[Token.ref(path).cssVariable.name()]` as a key; a value built from several tokens composes them with `shadow()`, `alpha()`, `timing()` or `transition()`";
|
|
44
|
+
};
|
|
45
|
+
readonly 'variable-channel': {
|
|
46
|
+
readonly group: "portability";
|
|
47
|
+
readonly label: "Private CSS variable";
|
|
48
|
+
readonly detects: "A CSS variable the system sets and reads for itself, which overrides and linked systems can’t see.";
|
|
49
|
+
readonly fix: "carry the value the way the reader can take it, which each site names: an element that reads it becomes a layer with the style property set on it, a motion preset takes a variant chosen by a state, a rule takes the value itself, and a runtime value is a prop forwarded to a style property";
|
|
50
|
+
};
|
|
51
|
+
readonly 'foreign-variable': {
|
|
52
|
+
readonly group: "portability";
|
|
53
|
+
readonly label: "Another package's variable";
|
|
54
|
+
readonly detects: "A CSS variable from outside the system. Nothing records that the system depends on it.";
|
|
55
|
+
readonly fix: "one the system sets for another library: declare it as a token under that exact name (`cssVariable: '--name'`) and reach it through `Token.ref`, so the dependency is on the record. One it only reads is blocked: a token would set it too, and could override the library's value";
|
|
56
|
+
};
|
|
57
|
+
readonly 'runtime-style-read': {
|
|
58
|
+
readonly group: "editability";
|
|
59
|
+
readonly label: "Style read while running";
|
|
60
|
+
readonly detects: "A value measured in the browser at runtime, which the system's settings never see.";
|
|
61
|
+
readonly fix: "a rule, a modifier (`_reducedMotion`, `_rtl`), logical properties, or a `Token.ref` reader";
|
|
62
|
+
};
|
|
63
|
+
readonly 'render-data-attribute': {
|
|
64
|
+
readonly group: "editability";
|
|
65
|
+
readonly label: "Hidden state";
|
|
66
|
+
readonly detects: "A state the code sets for styling that the component doesn't declare, so Create can't show, force or preview it.";
|
|
67
|
+
readonly fix: "a value the render knows becomes a `.states()` entry; a value from a declared prop becomes a `when: { prop }` rule";
|
|
68
|
+
};
|
|
69
|
+
readonly 'internal-marker': {
|
|
70
|
+
readonly group: "compatibility";
|
|
71
|
+
readonly fixKind: "blocked";
|
|
72
|
+
readonly label: "Internal marker";
|
|
73
|
+
readonly detects: "A platform-internal attribute written by hand, which an update can change without notice.";
|
|
74
|
+
readonly fix: "use the public API that sets it; where none exists, report the gap rather than writing the marker";
|
|
75
|
+
};
|
|
76
|
+
readonly 'reserved-variable-name': {
|
|
77
|
+
readonly group: "portability";
|
|
78
|
+
readonly label: "Variable name a token could take";
|
|
79
|
+
readonly detects: "A hand-written CSS variable named like a token, which a future token could collide with.";
|
|
80
|
+
readonly fix: "rename it outside the generated prefixes, or make it a token so the build owns the name";
|
|
81
|
+
};
|
|
82
|
+
readonly 'override-copies-source': {
|
|
83
|
+
readonly group: "portability";
|
|
84
|
+
readonly fixKind: "auto";
|
|
85
|
+
readonly label: "Copied instead of extended";
|
|
86
|
+
readonly detects: "An override that copies a linked system's whole list to add to it, so later additions upstream never arrive.";
|
|
87
|
+
readonly fix: "`extend` the list with only the additions, or drop the override when it adds nothing. Order matters only where two entries share a name, since the earlier one wins";
|
|
88
|
+
};
|
|
89
|
+
readonly 'number-in-brackets': {
|
|
90
|
+
readonly reads: "both";
|
|
91
|
+
readonly group: "maintainability";
|
|
92
|
+
readonly label: "Number written as text";
|
|
93
|
+
readonly detects: "A number wrapped in brackets, like [240px], where the plain number works and reads better.";
|
|
94
|
+
readonly fix: "write the number (`width: 240`); a property most of whose bracketed values are px takes `arbitrary: 'px'` first, and one whose are plain numbers `arbitrary: 'unitless'`";
|
|
95
|
+
readonly fixKind: "auto";
|
|
96
|
+
readonly check: {
|
|
97
|
+
readonly value: typeof numberInBrackets;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
readonly 'unused-token-group': {
|
|
101
|
+
readonly group: "nursery";
|
|
102
|
+
readonly label: "Unused token group";
|
|
103
|
+
readonly detects: "A group of tokens a property offers that nothing picks.";
|
|
104
|
+
readonly fix: "drop the group from the property's `values`, once the systems and apps in other repos that use it are checked too";
|
|
105
|
+
};
|
|
106
|
+
readonly 'duplicate-value-name': {
|
|
107
|
+
readonly group: "portability";
|
|
108
|
+
readonly label: "Two values, one name";
|
|
109
|
+
readonly detects: "A property that offers two values under the same name. Only one can ever be picked.";
|
|
110
|
+
readonly fix: "rename one of them, or drop the one that isn’t wanted, so each name means one value";
|
|
111
|
+
};
|
|
112
|
+
readonly 'render-default': {
|
|
113
|
+
readonly group: "editability";
|
|
114
|
+
readonly label: "Default hidden in code";
|
|
115
|
+
readonly detects: "A default value chosen in code rather than in the component's settings, so Create shows a different default than what renders.";
|
|
116
|
+
readonly fix: "move it into `.defaultProps({ … })`; a default the component already declares is deleted from the render";
|
|
117
|
+
};
|
|
118
|
+
readonly 'undeclared-prop': {
|
|
119
|
+
readonly group: "editability";
|
|
120
|
+
readonly label: "Property Create can't see";
|
|
121
|
+
readonly detects: "A property the component uses that it doesn't declare, so it doesn't show in the panel and can't be set or previewed.";
|
|
122
|
+
readonly fix: "declare it in `.props()` with the type it takes; a handler is a forward to the layer that takes it";
|
|
123
|
+
};
|
|
124
|
+
readonly 'state-for-modifier': {
|
|
125
|
+
readonly group: "editability";
|
|
126
|
+
readonly label: "Hover tracked in code";
|
|
127
|
+
readonly detects: "Hover or focus tracked by code, where a built-in state would do the same and show in Create.";
|
|
128
|
+
readonly fix: "write the rules it chooses under the modifier the handlers follow (`_hover`, `_focus`, `_focusVisible`, `_focusWithin`, or a `_group…` one for a parent), and drop the state and its handlers";
|
|
129
|
+
};
|
|
130
|
+
readonly 'forward-replaced-by-render': {
|
|
131
|
+
readonly group: "editability";
|
|
132
|
+
readonly label: "Content overridden in code";
|
|
133
|
+
readonly detects: "Content the component says goes to a layer, which the code replaces, so what you set doesn't show.";
|
|
134
|
+
readonly fix: "say what the render does: a prop the render places itself is a slot (or a `string`), and the forward goes; content the layer should take as it is is the forward, and the render's children go";
|
|
135
|
+
};
|
|
136
|
+
readonly 'glyph-in-render': {
|
|
137
|
+
readonly group: "editability";
|
|
138
|
+
readonly label: "Icon chosen in code";
|
|
139
|
+
readonly detects: "An icon the code picks, which Create can't show or swap.";
|
|
140
|
+
readonly fix: "set `name` in a rule on the icon layer, one per value of the prop or state that picks it";
|
|
141
|
+
};
|
|
142
|
+
readonly 'computed-config': {
|
|
143
|
+
readonly group: "editability";
|
|
144
|
+
readonly label: "Styles built by code";
|
|
145
|
+
readonly detects: "Styles or options assembled by code (a shared constant, a spread or a condition). Create can show them but an edit can’t be written back.";
|
|
146
|
+
readonly fix: "write the value in place, as a literal or a `Token.ref`; a list shared with code is written in the config and read from it";
|
|
147
|
+
};
|
|
148
|
+
readonly 'restated-in-every-variant': {
|
|
149
|
+
readonly group: "maintainability";
|
|
150
|
+
readonly label: "Same value in every option";
|
|
151
|
+
readonly detects: "A value set identically under every option of a property. It never varies, so it belongs in the component's base style.";
|
|
152
|
+
readonly fix: "set it once, in the base rule";
|
|
153
|
+
};
|
|
154
|
+
readonly 'variant-passthrough': {
|
|
155
|
+
readonly group: "nursery";
|
|
156
|
+
readonly label: "One rule per option";
|
|
157
|
+
readonly detects: "A separate rule for each option that only passes the option along, so every new option needs a new rule.";
|
|
158
|
+
readonly fix: "forward the prop to the layer: `{ type: 'forward', target: '<layer>/<prop>' }`";
|
|
159
|
+
};
|
|
160
|
+
readonly 'no-op-modifier': {
|
|
161
|
+
readonly group: "maintainability";
|
|
162
|
+
readonly label: "State that changes nothing";
|
|
163
|
+
readonly detects: "A hover, focus or mode style that sets a value to what it already is.";
|
|
164
|
+
readonly fix: "delete it, once no system that links this one relies on it: one that changes the value but not the modifier's keeps the modifier's here, and loses it when it's deleted. The finding carries the deletion for whoever makes it";
|
|
165
|
+
};
|
|
166
|
+
readonly 'inherited-value-restated': {
|
|
167
|
+
readonly group: "maintainability";
|
|
168
|
+
readonly label: "Repeats its parent";
|
|
169
|
+
readonly detects: "A layer set to the same value it already gets from the layer around it.";
|
|
170
|
+
readonly fix: "delete the layer's entry, so it inherits as the base rule says, once no system that links this one relies on it: one that changes the parent's value keeps the layer's here, and the layer follows the parent once it's deleted. The finding carries the deletion for whoever makes it";
|
|
171
|
+
};
|
|
172
|
+
readonly 'hand-forwarded-prop': {
|
|
173
|
+
readonly group: "editability";
|
|
174
|
+
readonly label: "Property passed along in code";
|
|
175
|
+
readonly detects: "A property the code hands to one layer by hand. Declaring where it goes lets Create show it and lets linked systems route it.";
|
|
176
|
+
readonly fix: "declare it as a forward to that layer, `{ type: 'forward', target: '<layer>/<attribute>' }`, and drop it from the render; an element that isn't a layer becomes one first";
|
|
177
|
+
};
|
|
178
|
+
readonly 'literal-matches-token': {
|
|
179
|
+
readonly reads: "both";
|
|
180
|
+
readonly group: "maintainability";
|
|
181
|
+
readonly label: "Value a token holds";
|
|
182
|
+
readonly detects: "A value typed by hand that one of your tokens already holds. Change the token and this spot is left behind.";
|
|
183
|
+
readonly fix: "use the token's name, as the style property takes it (`padding: '2'`)";
|
|
184
|
+
readonly check: {
|
|
185
|
+
readonly value: typeof literalMatchesToken;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
readonly 'layer-bundle-split': {
|
|
189
|
+
readonly group: "editability";
|
|
190
|
+
readonly label: "Layer split apart in code";
|
|
191
|
+
readonly detects: "A layer's styling taken apart in code and partly applied elsewhere, so Create's edits land in the wrong place.";
|
|
192
|
+
readonly fix: "spread each layer's bundle whole on its element, and declare each prop another element takes as a forward to its layer, by name (`{ type: 'forward', target: 'input/onChange' }`); a value read off a bundle to compute with goes in a rule";
|
|
193
|
+
};
|
|
194
|
+
readonly 'context-carried-variant': {
|
|
195
|
+
readonly group: "editability";
|
|
196
|
+
readonly label: "Option passed down invisibly";
|
|
197
|
+
readonly detects: "A size or variant a part inherits from its parent behind the scenes, which Create doesn't know about.";
|
|
198
|
+
readonly fix: "a rule on the parent that sets the part's layer: `{ when: { size: 'sm' }, layers: { item: { size: 'sm' } } }`; parts rendered in a list wait on repeated parts";
|
|
199
|
+
};
|
|
200
|
+
readonly 'forced-prop-in-render': {
|
|
201
|
+
readonly group: "editability";
|
|
202
|
+
readonly label: "Value fixed in code";
|
|
203
|
+
readonly detects: "A style or option the code sets on a nested component, which Create can't change.";
|
|
204
|
+
readonly fix: "set it in a rule on that layer (`layers: { action: { variant: 'ghost' } }`), one per case for a picked value, making the element a layer first if it isn't one";
|
|
205
|
+
};
|
|
206
|
+
readonly 'ref-replaced-by-literal': {
|
|
207
|
+
readonly group: "portability";
|
|
208
|
+
readonly label: "Linked token copied";
|
|
209
|
+
readonly detects: "A linked token replaced by the value it already had, so it stops following the system it came from.";
|
|
210
|
+
readonly fix: "drop the override, or keep the ref the source has";
|
|
211
|
+
};
|
|
212
|
+
readonly 'shadowed-pin-directive': {
|
|
213
|
+
readonly group: "portability";
|
|
214
|
+
readonly label: "Option that does nothing";
|
|
215
|
+
readonly detects: "A linked system's setting for a component this system replaces with its own, so the setting has no effect.";
|
|
216
|
+
readonly fix: "delete the option, or move what it sets onto this system's own component";
|
|
217
|
+
};
|
|
218
|
+
readonly 'implicit-children': {
|
|
219
|
+
readonly group: "compatibility";
|
|
220
|
+
readonly label: "Content not declared";
|
|
221
|
+
readonly detects: "Content the component accepts without declaring it. The old way is going away, and Create can't see it until then.";
|
|
222
|
+
readonly fix: "declare it: `children: { type: 'slot' }`, or a forward to the layer the render places it in, `{ type: 'forward', target: '<layer>/children' }`";
|
|
223
|
+
};
|
|
224
|
+
readonly 'copied-component': {
|
|
225
|
+
readonly group: "nursery";
|
|
226
|
+
readonly label: "Copied component";
|
|
227
|
+
readonly detects: "A component whose styles are another's, word for word, so a change to one doesn't reach the other.";
|
|
228
|
+
readonly fix: "extend the other, `Component.ref('Other').extend({ … })`, and keep only what differs; two near copies extend one component both share";
|
|
229
|
+
};
|
|
230
|
+
readonly 'low-contrast': {
|
|
231
|
+
readonly group: "design";
|
|
232
|
+
readonly reads: "config";
|
|
233
|
+
readonly label: "Low contrast";
|
|
234
|
+
readonly detects: "Text that is hard to read against its background in light or dark mode. Text needs 4.5:1, icons 3:1.";
|
|
235
|
+
readonly fix: "pick a text or background token that clears 4.5:1 in every mode";
|
|
236
|
+
readonly check: {
|
|
237
|
+
readonly layer: typeof lowContrast;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
readonly 'near-token': {
|
|
241
|
+
readonly group: "design";
|
|
242
|
+
readonly reads: "config";
|
|
243
|
+
readonly label: "Almost a token";
|
|
244
|
+
readonly detects: "A value a pixel or so off one of your tokens. Usually a typo; if it's on purpose, it may belong on the scale.";
|
|
245
|
+
readonly fix: "use the token when it was meant; if the value is on purpose, it may belong on the scale";
|
|
246
|
+
readonly check: {
|
|
247
|
+
readonly value: typeof nearToken;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
readonly 'fixed-in-dark-mode': {
|
|
251
|
+
readonly group: "design";
|
|
252
|
+
readonly reads: "config";
|
|
253
|
+
readonly label: "Same in dark mode";
|
|
254
|
+
readonly detects: "A color that doesn't change in dark mode while the rest of the component does.";
|
|
255
|
+
readonly fix: "use a token that has a dark value, or give this one a `_dark` value";
|
|
256
|
+
readonly check: {
|
|
257
|
+
readonly component: typeof fixedInDarkMode;
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
readonly 'small-tap-target': {
|
|
261
|
+
readonly group: "design";
|
|
262
|
+
readonly reads: "config";
|
|
263
|
+
readonly label: "Small tap target";
|
|
264
|
+
readonly detects: "Something you press that is too small to hit reliably: under 24 × 24 px on the web, 44 × 44 pt in a native app.";
|
|
265
|
+
readonly fix: "make it at least that size each way, or grow its hit area with padding";
|
|
266
|
+
readonly check: {
|
|
267
|
+
readonly layer: typeof smallTapTarget;
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
readonly 'duplicate-token': {
|
|
271
|
+
readonly group: "design";
|
|
272
|
+
readonly reads: "config";
|
|
273
|
+
readonly label: "Two tokens, one value";
|
|
274
|
+
readonly detects: "Two steps on a scale that hold the same value, so nobody can tell which to pick.";
|
|
275
|
+
readonly fix: "keep one, or make the other a reference to it (`Token.ref(…)`) so the two are one decision";
|
|
276
|
+
readonly check: {
|
|
277
|
+
readonly system: typeof duplicateToken;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
readonly 'wildcard-forward': {
|
|
281
|
+
readonly group: "nursery";
|
|
282
|
+
readonly label: "Accepts anything";
|
|
283
|
+
readonly detects: "A component that passes along every property it gets. It will soon accept only what it declares.";
|
|
284
|
+
readonly fix: "declare each one as `{ type: 'forward', target: '<layer>/<prop>' }` and drop the entry. A list is ready; a `'*'` waits on what callers outside the files read pass, and on the prop type it names (`type: 'modifier'`, the `as` element forward)";
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* A config check, at the level it reads. The run walks the system once and calls each check with what
|
|
289
|
+
* it already resolved, so a check names a condition and walks nothing:
|
|
290
|
+
*
|
|
291
|
+
* - `value`: every style value a component of the system's own writes;
|
|
292
|
+
* - `layer`: each layer of each variant cell, with the styles it paints by what they do;
|
|
293
|
+
* - `component`: each of the system's own components;
|
|
294
|
+
* - `system`: the system once, for what spans components (its tokens).
|
|
295
|
+
*/
|
|
296
|
+
interface ConfigLintCheck {
|
|
297
|
+
value?(ctx: ConfigLintContext, value: LintValue, report: ConfigLintReport): void;
|
|
298
|
+
layer?(ctx: ConfigLintContext, layer: LintLayer, report: ConfigLintReport): void;
|
|
299
|
+
component?(ctx: ConfigLintContext, component: LintedComponent, report: ConfigLintReport): void;
|
|
300
|
+
system?(ctx: ConfigLintContext, report: ConfigLintReport): void;
|
|
301
|
+
}
|
|
302
|
+
type AuthoringLintRule = keyof typeof AUTHORING_LINT_RULES;
|
|
303
|
+
type LintReads = 'code' | 'config' | 'both';
|
|
304
|
+
/** What a rule checks; see `reads` on {@link AUTHORING_LINT_RULES}. */
|
|
305
|
+
declare const lintReads: (rule: AuthoringLintRule) => LintReads;
|
|
306
|
+
/** The rules whose `reads` takes in the config. */
|
|
307
|
+
type ConfigReadLintRule = { [K in AuthoringLintRule]: (typeof AUTHORING_LINT_RULES)[K] extends {
|
|
308
|
+
reads: 'config' | 'both';
|
|
309
|
+
} ? K : never }[AuthoringLintRule];
|
|
310
|
+
/** The rules that read the config, which `lintConfig` runs wherever a config is loaded. */
|
|
311
|
+
declare const CONFIG_LINT_RULES: ConfigReadLintRule[];
|
|
312
|
+
type AuthoringLintSeverity = 'off' | 'warn' | 'error';
|
|
313
|
+
/**
|
|
314
|
+
* How a finding gets fixed: `auto`, `uds lint --fix` rewrites it; `agent`, it needs judgment, which
|
|
315
|
+
* `--reporter json` hands to a person or an agent; `blocked`, it waits on a platform feature the
|
|
316
|
+
* finding names.
|
|
317
|
+
*/
|
|
318
|
+
type AuthoringLintFix = 'auto' | 'agent' | 'blocked';
|
|
319
|
+
/** A rule's severity as `settings.lint.rules` sets it: its own entry, else its group's, else the
|
|
320
|
+
* group's default. */
|
|
321
|
+
declare function ruleSeverity(rule: AuthoringLintRule, severities: Readonly<Record<string, AuthoringLintSeverity>>): AuthoringLintSeverity;
|
|
322
|
+
/** literal-matches-token: the same text a token holds. */
|
|
323
|
+
declare function literalMatchesToken(ctx: ConfigLintContext, value: LintValue, report: ConfigLintReport): void;
|
|
324
|
+
/** number-in-brackets: a property that reads bare numbers, written in brackets. */
|
|
325
|
+
declare function numberInBrackets(ctx: ConfigLintContext, value: LintValue, report: ConfigLintReport): void;
|
|
326
|
+
/** near-token: off a token by a pixel or so. */
|
|
327
|
+
declare function nearToken(ctx: ConfigLintContext, value: LintValue, report: ConfigLintReport): void;
|
|
328
|
+
/** fixed-in-dark-mode: colors that hold still while the component's others change. */
|
|
329
|
+
declare function fixedInDarkMode(ctx: ConfigLintContext, component: LintedComponent, report: ConfigLintReport): void;
|
|
330
|
+
/** low-contrast: a layer's text over its background, in each mode. */
|
|
331
|
+
declare function lowContrast(ctx: ConfigLintContext, layer: LintLayer, report: ConfigLintReport): void;
|
|
332
|
+
/** small-tap-target: the root of something you press, under the platform's minimum. */
|
|
333
|
+
declare function smallTapTarget(ctx: ConfigLintContext, layer: LintLayer, report: ConfigLintReport): void;
|
|
334
|
+
/** duplicate-token: two tokens a property offers, written with one value in every mode. */
|
|
335
|
+
declare function duplicateToken(ctx: ConfigLintContext, report: ConfigLintReport): void;
|
|
336
|
+
//#endregion
|
|
337
|
+
export { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, AuthoringLintFix, AuthoringLintGroup, AuthoringLintRule, AuthoringLintSeverity, CONFIG_LINT_RULES, ConfigLintCheck, ConfigReadLintRule, LintReads, lintReads, ruleSeverity };
|