@greenharness/greenrack-eslint-plugin 0.0.0-stage → 7.0.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/LICENSE +21 -0
- package/README.md +195 -2
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/rules/index.d.ts +36 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +23 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/no-deprecated-table-parts.d.ts +17 -0
- package/dist/rules/no-deprecated-table-parts.d.ts.map +1 -0
- package/dist/rules/no-deprecated-table-parts.js +92 -0
- package/dist/rules/no-deprecated-table-parts.js.map +1 -0
- package/dist/rules/no-flex-grow-web.d.ts +22 -0
- package/dist/rules/no-flex-grow-web.d.ts.map +1 -0
- package/dist/rules/no-flex-grow-web.js +38 -0
- package/dist/rules/no-flex-grow-web.js.map +1 -0
- package/dist/rules/no-raw-breakpoint-query.d.ts +16 -0
- package/dist/rules/no-raw-breakpoint-query.d.ts.map +1 -0
- package/dist/rules/no-raw-breakpoint-query.js +78 -0
- package/dist/rules/no-raw-breakpoint-query.js.map +1 -0
- package/dist/rules/no-raw-design-values.d.ts +60 -0
- package/dist/rules/no-raw-design-values.d.ts.map +1 -0
- package/dist/rules/no-raw-design-values.js +657 -0
- package/dist/rules/no-raw-design-values.js.map +1 -0
- package/dist/rules/no-raw-html-element.d.ts +24 -0
- package/dist/rules/no-raw-html-element.d.ts.map +1 -0
- package/dist/rules/no-raw-html-element.js +112 -0
- package/dist/rules/no-raw-html-element.js.map +1 -0
- package/dist/rules/no-raw-layer-values.d.ts +28 -0
- package/dist/rules/no-raw-layer-values.d.ts.map +1 -0
- package/dist/rules/no-raw-layer-values.js +185 -0
- package/dist/rules/no-raw-layer-values.js.map +1 -0
- package/dist/rules/no-tokens-barrel-import.d.ts +17 -0
- package/dist/rules/no-tokens-barrel-import.d.ts.map +1 -0
- package/dist/rules/no-tokens-barrel-import.js +0 -0
- package/dist/rules/no-tokens-barrel-import.js.map +1 -0
- package/dist/rules/prefer-ds-form-components.d.ts +11 -0
- package/dist/rules/prefer-ds-form-components.d.ts.map +1 -0
- package/dist/rules/prefer-ds-form-components.js +92 -0
- package/dist/rules/prefer-ds-form-components.js.map +1 -0
- package/dist/util/glob.d.ts +5 -0
- package/dist/util/glob.d.ts.map +1 -0
- package/dist/util/glob.js +55 -0
- package/dist/util/glob.js.map +1 -0
- package/dist/util/imports.d.ts +20 -0
- package/dist/util/imports.d.ts.map +1 -0
- package/dist/util/imports.js +74 -0
- package/dist/util/imports.js.map +1 -0
- package/dist/util/jsx.d.ts +14 -0
- package/dist/util/jsx.d.ts.map +1 -0
- package/dist/util/jsx.js +121 -0
- package/dist/util/jsx.js.map +1 -0
- package/dist/util/tokens.d.ts +74 -0
- package/dist/util/tokens.d.ts.map +1 -0
- package/dist/util/tokens.js +510 -0
- package/dist/util/tokens.js.map +1 -0
- package/package.json +57 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Frederic Rousseau
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,196 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @greenharness/greenrack-eslint-plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
ESLint rules that enforce the greenrack design system conventions mechanically —
|
|
4
|
+
what CLAUDE.md can only suggest, these rules gate.
|
|
5
|
+
|
|
6
|
+
Requires ESLint 9 (flat config). The plugin has zero runtime dependencies.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
// eslint.config.js
|
|
12
|
+
import greenrack from '@greenharness/greenrack-eslint-plugin'
|
|
13
|
+
import tseslint from 'typescript-eslint'
|
|
14
|
+
|
|
15
|
+
export default [
|
|
16
|
+
...tseslint.configs.recommended,
|
|
17
|
+
greenrack.configs.recommended,
|
|
18
|
+
{
|
|
19
|
+
rules: {
|
|
20
|
+
// Example: a data grid the design system doesn't cover yet.
|
|
21
|
+
'greenrack/no-raw-html-element': [
|
|
22
|
+
'error',
|
|
23
|
+
{allow: ['table', 'thead', 'tbody', 'tr', 'th', 'td']},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The `recommended` preset registers the plugin under the `greenrack` namespace, so
|
|
31
|
+
you never have to register it yourself. Don't also register it manually under
|
|
32
|
+
another key — you'd get two live namespaces and confusing config.
|
|
33
|
+
|
|
34
|
+
## Rules
|
|
35
|
+
|
|
36
|
+
| Rule | Preset | Fix |
|
|
37
|
+
| ------------------------------------- | ------ | -------------------- |
|
|
38
|
+
| `greenrack/no-raw-html-element` | error | suggestion |
|
|
39
|
+
| `greenrack/no-tokens-barrel-import` | error | autofix |
|
|
40
|
+
| `greenrack/no-deprecated-table-parts` | error | autofix / suggestion |
|
|
41
|
+
| `greenrack/no-raw-design-values` | error | suggestion |
|
|
42
|
+
| `greenrack/no-raw-layer-values` | warn | suggestion |
|
|
43
|
+
| `greenrack/no-raw-breakpoint-query` | error | autofix |
|
|
44
|
+
|
|
45
|
+
### no-raw-html-element
|
|
46
|
+
|
|
47
|
+
Raw lowercase JSX intrinsics (`<div>`, `<span>`, …) must be react-strict-dom
|
|
48
|
+
`html.*` elements. SVG subtrees are exempt (RSD has no SVG primitives).
|
|
49
|
+
Elements RSD doesn't export (`<table>`, `<canvas>`, …) report as non-portable;
|
|
50
|
+
allow them explicitly per-project via `allow`. The rewrite is a suggestion,
|
|
51
|
+
not an autofix, because `html.*` props are stricter than raw DOM props — a
|
|
52
|
+
mechanical `--fix` would trade lint errors for type errors.
|
|
53
|
+
|
|
54
|
+
Options: `{allow?: string[], reportUnsupported?: boolean, htmlModule?: string}`
|
|
55
|
+
|
|
56
|
+
### no-tokens-barrel-import
|
|
57
|
+
|
|
58
|
+
`import {colors} from '@greenharness/greenrack-tokens'` breaks the StyleX babel plugin. The
|
|
59
|
+
autofix splits the barrel import into the right deep imports
|
|
60
|
+
(`@greenharness/greenrack-tokens/tokens/colors.css`, …), preserving aliases and inline
|
|
61
|
+
`type` specifiers. Imports with any unmapped specifier report without a fix.
|
|
62
|
+
|
|
63
|
+
Options: `{packages?: string[]}`
|
|
64
|
+
|
|
65
|
+
### no-deprecated-table-parts
|
|
66
|
+
|
|
67
|
+
Flags `<Table.Container>` (Root owns the container query now; report-only —
|
|
68
|
+
unwrapping is layout-unsafe to automate) and the no-op `isActions` prop on
|
|
69
|
+
`<Table.HeaderCell>` (autofixed away for literal values; suggestion when the
|
|
70
|
+
value is an expression). Matches by identifier name (`Table`, `TableCore` by
|
|
71
|
+
default) — configure via `tableIdentifiers`.
|
|
72
|
+
|
|
73
|
+
### no-raw-design-values
|
|
74
|
+
|
|
75
|
+
Inside `css.create()` objects, a raw design value is the finding — anything
|
|
76
|
+
with a token equivalent, and anything on a tokenised property that is off the
|
|
77
|
+
scale:
|
|
78
|
+
|
|
79
|
+
- **colors** — a hex / `rgb()` / `hsl()` literal anywhere. A palette value
|
|
80
|
+
suggests its `colors.*` token; an off-palette one reports without a fix.
|
|
81
|
+
- **spacing and radius** — a number or `'Npx'` on the padding/margin/gap
|
|
82
|
+
families → `spacing.*`, on the border-radius family → `radii.*`. On the
|
|
83
|
+
scale it suggests the token; off the scale (`marginTop: 23`) it reports —
|
|
84
|
+
"not a token" is the point.
|
|
85
|
+
- **breakpoints** — a px inside a `'@media …'` / `'@container …'` condition
|
|
86
|
+
key. On the scale it suggests the computed key
|
|
87
|
+
``[`@media (min-width: ${breakpoints.md})`]`` and the import.
|
|
88
|
+
- **font size** (number, `px` or `rem`) → `typography.fontSize*` or, for the
|
|
89
|
+
steps typography lacks, `typeScale.fontSizeN`; **font weight** 400–700 →
|
|
90
|
+
`typography.fontWeight*`; **`boxShadow`** → `shadows.*` on an exact match,
|
|
91
|
+
otherwise a report; **`transitionDuration` / `animationDuration`** `'Nms'` →
|
|
92
|
+
`duration.*`; **timing functions** → `easing.*`.
|
|
93
|
+
|
|
94
|
+
- **sizes and border widths** (since 5.0, ADR-0027) — a number, `'Npx'` or
|
|
95
|
+
negative on `width`/`height` and their min/max, `flexBasis`, block/inline
|
|
96
|
+
size; on `border*Width`, `outlineWidth`, `outlineOffset`; and the width
|
|
97
|
+
inside a `border*` or `outline` shorthand string. Each property draws from
|
|
98
|
+
its own candidates: sizes → `sizes.*`; border widths → `borders.hairline /
|
|
99
|
+
strong / accent`; outline width → `borders.focusRing`; outline offset →
|
|
100
|
+
`borders.focusOffset / focusOffsetSm`. Since 5.2 the size candidates follow
|
|
101
|
+
the property's axis: a `…W` / `…MinW` / `…MaxW` token is only offered on a
|
|
102
|
+
width property, a `…H` / `…MinH` / `…MaxH` token only on a height one, and
|
|
103
|
+
an unsuffixed token on both (`flexBasis` takes either). One match suggests it
|
|
104
|
+
(a negative as `calc(-1 * …)`); several give one suggestion each. When none
|
|
105
|
+
matches, the message names the **nearest role**: every same-axis token at
|
|
106
|
+
the nearest value within ±10% (`width: 232` → `sizes.gridColSm`,
|
|
107
|
+
`sizes.sidebarW`, `sizes.popoverWSm` (240)); when two values are equally
|
|
108
|
+
near, both are listed, smaller first. Only when nothing is that close does
|
|
109
|
+
it say to add a token. A `calc()` or template literal whose static text
|
|
110
|
+
holds a px is reported too.
|
|
111
|
+
- **`boxShadow` in a template literal** (since 5.2) — a px length in its
|
|
112
|
+
static text (`` `inset 0 0 0 1px ${colors.border}` ``) is a raw shadow; use
|
|
113
|
+
a `shadows.*` token.
|
|
114
|
+
- **micro spacing** — an off-scale spacing of 1/2/3/5/6px suggests
|
|
115
|
+
`microSpacing.pxN`.
|
|
116
|
+
|
|
117
|
+
Allowed: `0`, relative units (`%`, `vh`, `fr`, `em`, `rem`, `ch`…), keywords
|
|
118
|
+
(`auto`, `max-content`…), identifiers and member expressions (tokens), a
|
|
119
|
+
`calc()` of tokens. Skipped on purpose: negatives on spacing properties,
|
|
120
|
+
`'opacity 150ms'`-style transitions, and positions (`top`, `left`) and
|
|
121
|
+
`lineHeight`. Since 3.0 it ships as `error`: a raw value is the drift the
|
|
122
|
+
design system exists to stop.
|
|
123
|
+
|
|
124
|
+
**Shorthands** (since 5.7). A spacing or radius string with several words
|
|
125
|
+
(`padding: '4px 8px'`, `gap: '8px 16px'`) is split on whitespace and every
|
|
126
|
+
nonzero px word is checked as a single value would be: `'4px 8px'` gives two
|
|
127
|
+
reports, `'6px 14px'` gives `rawMicroSpacing` and `offScaleSpacing`. `0`,
|
|
128
|
+
`auto`, `%`, `rem`, `em`, `var(...)` and `calc(...)` words pass. A shorthand
|
|
129
|
+
report carries **no suggestion**, because swapping one word would rewrite the
|
|
130
|
+
whole string; the message names the token for each word.
|
|
131
|
+
|
|
132
|
+
**Inline styles** (since 5.7). A `style={{ ... }}` object literal on any JSX
|
|
133
|
+
element is read like a `css.create` style, so a raw colour, font size, weight,
|
|
134
|
+
measure or px in a shorthand is reported. These reports carry **no
|
|
135
|
+
suggestion**, since plain-React code has no `.css.ts` token imports; the
|
|
136
|
+
message still names the token. `style={styles.x}`, arrays, identifiers and
|
|
137
|
+
spreads are ignored, and so are custom-property keys (`'--wb-vw': '12px'`) and
|
|
138
|
+
computed keys. Set `inlineStyle: false` to turn this off.
|
|
139
|
+
|
|
140
|
+
Options: `{factories?: string[], spacingProperties?: string[], radiiProperties?: string[], exemptFiles?: string[], inlineStyle?: boolean}`
|
|
141
|
+
(property lists replace the defaults, they don't merge). `inlineStyle`
|
|
142
|
+
defaults to `true`. `exemptFiles` takes
|
|
143
|
+
globs (`**`, `*`, `?`, `{a,b}`), matched against the path relative to the
|
|
144
|
+
working directory and the absolute path; a matching file is not checked. Name
|
|
145
|
+
only a file whose literals are a technique, not a design value — greenrack names
|
|
146
|
+
its visually-hidden module.
|
|
147
|
+
|
|
148
|
+
### no-raw-layer-values
|
|
149
|
+
|
|
150
|
+
Since 5.3. Inside `css.create()` objects:
|
|
151
|
+
|
|
152
|
+
- **`zIndex`** — a number or numeric string other than `0` and negatives. A
|
|
153
|
+
layers value suggests its token (`zIndex: 1000` → `layers.overlay`, `1050` →
|
|
154
|
+
`layers.popup`); any other value names the layers it sits between, without a
|
|
155
|
+
fix (`zIndex: 16` → between `layers.raised` (1) and `layers.floating` (50)).
|
|
156
|
+
Since 5.4, a value from `2` up to `localMax` (default `9`) is not reported:
|
|
157
|
+
it orders children inside one component, which is not a layer (`1` is
|
|
158
|
+
`layers.raised` and keeps its suggestion).
|
|
159
|
+
- **`backdropFilter` / `filter`** — a `blur(...)` literal. `blur(2px)`
|
|
160
|
+
suggests `effects.overlayBlur`, `blur(6px)` (5.4) `effects.surfaceBlur`;
|
|
161
|
+
another blur reports without a fix.
|
|
162
|
+
|
|
163
|
+
It ships as **`warn` for the 5.x line**, so no consumer's lint turns red on a
|
|
164
|
+
minor, and becomes **`error` in the next major**. It is its own rule, apart
|
|
165
|
+
from `no-raw-design-values`, because ESLint sets severity per rule.
|
|
166
|
+
|
|
167
|
+
Leaving local stacking unreported is this rule's scope, not an exemption from
|
|
168
|
+
ADR-0027: a z-index is not one of the measures
|
|
169
|
+
`design-system.every-measure-is-a-token` makes a token (spacing, radius, size,
|
|
170
|
+
border width). `localMax` is capped at `49`, below `layers.floating` (50), so
|
|
171
|
+
the skip never reaches a layer; `{localMax: 0}` reports every positive value.
|
|
172
|
+
|
|
173
|
+
Options: `{factories?: string[], exemptFiles?: string[], localMax?: number}`
|
|
174
|
+
|
|
175
|
+
### no-raw-breakpoint-query
|
|
176
|
+
|
|
177
|
+
A media-query string anywhere in a file — `useMediaQuery('(min-width:
|
|
178
|
+
768px)')`, `matchMedia(...)`, a constant — carries a raw breakpoint that
|
|
179
|
+
`no-raw-design-values` never sees (it only reads `css.create`). On the scale
|
|
180
|
+
the autofix rewrites the literal to `` `(min-width: ${breakpoints.md})` `` and
|
|
181
|
+
adds the import (a `css.defineConsts` string, so it interpolates to
|
|
182
|
+
`'768px'`); off the scale it reports. Skips `css.create` keys, and skips the
|
|
183
|
+
fix when a local `breakpoints` binding would shadow the import.
|
|
184
|
+
|
|
185
|
+
## Token data
|
|
186
|
+
|
|
187
|
+
The rule data (deep-path map, spacing/radius/breakpoint px values, font
|
|
188
|
+
sizes and weights, shadows, durations, easings, color palette) is mirrored
|
|
189
|
+
from `@greenharness/greenrack-tokens` as literals so the published plugin stays
|
|
190
|
+
dependency-free. `test/token-drift.test.ts` rebuilds every table from the real
|
|
191
|
+
tokens package and fails CI when they drift.
|
|
192
|
+
|
|
193
|
+
Only `test/` imports `@greenharness/greenrack-tokens`; `src/` never does. The root `prepare`
|
|
194
|
+
script relies on that: it builds this plugin and the tokens package in parallel
|
|
195
|
+
(`pnpm --no-sort`). If `src/` ever imports `@greenharness/greenrack-tokens`, drop `--no-sort`
|
|
196
|
+
there, or a fresh install can build the plugin before the tokens it reads.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
import { rules } from './rules/index.js';
|
|
3
|
+
declare const plugin: {
|
|
4
|
+
meta: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
rules: {
|
|
8
|
+
'no-raw-html-element': TSESLint.RuleModule<"useHtml" | "noEquivalent" | "suggestReplace", [({
|
|
9
|
+
allow?: string[];
|
|
10
|
+
reportUnsupported?: boolean;
|
|
11
|
+
htmlModule?: string;
|
|
12
|
+
svgExempt?: boolean;
|
|
13
|
+
} | undefined)?], unknown, TSESLint.RuleListener>;
|
|
14
|
+
'no-tokens-barrel-import': TSESLint.RuleModule<"barrelImport" | "barrelNamespace" | "barrelSideEffect" | "unknownSpecifiers", [({
|
|
15
|
+
packages?: string[];
|
|
16
|
+
} | undefined)?], unknown, TSESLint.RuleListener>;
|
|
17
|
+
'no-deprecated-table-parts': TSESLint.RuleModule<"deprecatedContainer" | "deprecatedIsActions" | "removeIsActions", [({
|
|
18
|
+
tableIdentifiers?: string[];
|
|
19
|
+
} | undefined)?], unknown, TSESLint.RuleListener>;
|
|
20
|
+
'no-raw-design-values': TSESLint.RuleModule<"rawColorToken" | "rawColor" | "rawSpacing" | "rawMicroSpacing" | "rawRadius" | "offScaleSpacing" | "offScaleRadius" | "rawBreakpoint" | "rawFontSize" | "rawFontWeight" | "rawShadow" | "rawDuration" | "rawEasing" | "rawMeasure" | "ambiguousMeasure" | "missingMeasureToken" | "nearestMeasureRole" | "rawShadowLength" | "rawTrack" | "replaceWithToken", [({
|
|
21
|
+
factories?: string[];
|
|
22
|
+
spacingProperties?: string[];
|
|
23
|
+
radiiProperties?: string[];
|
|
24
|
+
exemptFiles?: string[];
|
|
25
|
+
inlineStyle?: boolean;
|
|
26
|
+
} | undefined)?], unknown, TSESLint.RuleListener>;
|
|
27
|
+
'no-raw-layer-values': TSESLint.RuleModule<"replaceWithToken" | "rawZIndex" | "offScaleZIndex" | "rawEffect", [({
|
|
28
|
+
factories?: string[];
|
|
29
|
+
exemptFiles?: string[];
|
|
30
|
+
localMax?: number;
|
|
31
|
+
} | undefined)?], unknown, TSESLint.RuleListener>;
|
|
32
|
+
'no-raw-breakpoint-query': TSESLint.RuleModule<"rawBreakpointQuery", [], unknown, TSESLint.RuleListener>;
|
|
33
|
+
'no-flex-grow-web': TSESLint.RuleModule<"flexGrowForced", [({
|
|
34
|
+
factories?: string[];
|
|
35
|
+
} | undefined)?], unknown, TSESLint.RuleListener>;
|
|
36
|
+
'prefer-ds-form-components': TSESLint.RuleModule<"useFormKit", [({
|
|
37
|
+
allow?: string[];
|
|
38
|
+
htmlObjects?: string[];
|
|
39
|
+
} | undefined)?], unknown, TSESLint.RuleListener>;
|
|
40
|
+
'no-restricted-imports': TSESLint.RuleModuleWithMetaDocs<string, unknown[], import("@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules").ESLintPluginDocs, TSESLint.RuleListener>;
|
|
41
|
+
};
|
|
42
|
+
configs: Record<string, TSESLint.FlatConfig.Config>;
|
|
43
|
+
};
|
|
44
|
+
export default plugin;
|
|
45
|
+
export { rules };
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAC,KAAK,EAAC,MAAM,kBAAkB,CAAA;AAEtC,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAGK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC;CAC1D,CAAA;AA0BD,eAAe,MAAM,CAAA;AACrB,OAAO,EAAC,KAAK,EAAC,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { rules } from './rules/index.js';
|
|
2
|
+
const plugin = {
|
|
3
|
+
meta: { name: 'greenrack' },
|
|
4
|
+
rules,
|
|
5
|
+
configs: {},
|
|
6
|
+
};
|
|
7
|
+
// Assigned after construction because the config must reference the plugin
|
|
8
|
+
// object that contains it — the standard ESLint 9 self-referential shape.
|
|
9
|
+
Object.assign(plugin.configs, {
|
|
10
|
+
recommended: {
|
|
11
|
+
name: 'greenrack/recommended',
|
|
12
|
+
plugins: { greenrack: plugin },
|
|
13
|
+
rules: {
|
|
14
|
+
'greenrack/no-raw-html-element': 'error',
|
|
15
|
+
'greenrack/no-tokens-barrel-import': 'error',
|
|
16
|
+
'greenrack/no-deprecated-table-parts': 'error',
|
|
17
|
+
// Errors since 3.0: a raw design value is the drift the system exists
|
|
18
|
+
// to prevent. Consumers with debt ratchet with an explicit-file
|
|
19
|
+
// baseline block (see @greenharness/greenrack-eslint-config README), never a glob
|
|
20
|
+
// and never --max-warnings.
|
|
21
|
+
'greenrack/no-raw-design-values': 'error',
|
|
22
|
+
// New in 5.3: raw z-index and blur values. A warning for the 5.x line,
|
|
23
|
+
// so no consumer's lint turns red on a minor; an error in the next major.
|
|
24
|
+
'greenrack/no-raw-layer-values': 'warn',
|
|
25
|
+
'greenrack/no-raw-breakpoint-query': 'error',
|
|
26
|
+
'greenrack/prefer-ds-form-components': 'error',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
export default plugin;
|
|
31
|
+
export { rules };
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,EAAC,MAAM,kBAAkB,CAAA;AAEtC,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,EAAC,IAAI,EAAE,WAAW,EAAC;IACzB,KAAK;IACL,OAAO,EAAE,EAAgD;CAC1D,CAAA;AAED,2EAA2E;AAC3E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;IAC5B,WAAW,EAAE;QACX,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,EAAC,SAAS,EAAE,MAAM,EAAC;QAC5B,KAAK,EAAE;YACL,+BAA+B,EAAE,OAAO;YACxC,mCAAmC,EAAE,OAAO;YAC5C,qCAAqC,EAAE,OAAO;YAC9C,sEAAsE;YACtE,gEAAgE;YAChE,kFAAkF;YAClF,4BAA4B;YAC5B,gCAAgC,EAAE,OAAO;YACzC,uEAAuE;YACvE,0EAA0E;YAC1E,+BAA+B,EAAE,MAAM;YACvC,mCAAmC,EAAE,OAAO;YAC5C,qCAAqC,EAAE,OAAO;SAC/C;KACmC;CACvC,CAAC,CAAA;AAEF,eAAe,MAAM,CAAA;AACrB,OAAO,EAAC,KAAK,EAAC,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const rules: {
|
|
2
|
+
'no-raw-html-element': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useHtml" | "noEquivalent" | "suggestReplace", [({
|
|
3
|
+
allow?: string[];
|
|
4
|
+
reportUnsupported?: boolean;
|
|
5
|
+
htmlModule?: string;
|
|
6
|
+
svgExempt?: boolean;
|
|
7
|
+
} | undefined)?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
8
|
+
'no-tokens-barrel-import': import("@typescript-eslint/utils/ts-eslint").RuleModule<"barrelImport" | "barrelNamespace" | "barrelSideEffect" | "unknownSpecifiers", [({
|
|
9
|
+
packages?: string[];
|
|
10
|
+
} | undefined)?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
11
|
+
'no-deprecated-table-parts': import("@typescript-eslint/utils/ts-eslint").RuleModule<"deprecatedContainer" | "deprecatedIsActions" | "removeIsActions", [({
|
|
12
|
+
tableIdentifiers?: string[];
|
|
13
|
+
} | undefined)?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
14
|
+
'no-raw-design-values': import("@typescript-eslint/utils/ts-eslint").RuleModule<"rawColorToken" | "rawColor" | "rawSpacing" | "rawMicroSpacing" | "rawRadius" | "offScaleSpacing" | "offScaleRadius" | "rawBreakpoint" | "rawFontSize" | "rawFontWeight" | "rawShadow" | "rawDuration" | "rawEasing" | "rawMeasure" | "ambiguousMeasure" | "missingMeasureToken" | "nearestMeasureRole" | "rawShadowLength" | "rawTrack" | "replaceWithToken", [({
|
|
15
|
+
factories?: string[];
|
|
16
|
+
spacingProperties?: string[];
|
|
17
|
+
radiiProperties?: string[];
|
|
18
|
+
exemptFiles?: string[];
|
|
19
|
+
inlineStyle?: boolean;
|
|
20
|
+
} | undefined)?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
21
|
+
'no-raw-layer-values': import("@typescript-eslint/utils/ts-eslint").RuleModule<"replaceWithToken" | "rawZIndex" | "offScaleZIndex" | "rawEffect", [({
|
|
22
|
+
factories?: string[];
|
|
23
|
+
exemptFiles?: string[];
|
|
24
|
+
localMax?: number;
|
|
25
|
+
} | undefined)?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
26
|
+
'no-raw-breakpoint-query': import("@typescript-eslint/utils/ts-eslint").RuleModule<"rawBreakpointQuery", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
27
|
+
'no-flex-grow-web': import("@typescript-eslint/utils/ts-eslint").RuleModule<"flexGrowForced", [({
|
|
28
|
+
factories?: string[];
|
|
29
|
+
} | undefined)?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
30
|
+
'prefer-ds-form-components': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useFormKit", [({
|
|
31
|
+
allow?: string[];
|
|
32
|
+
htmlObjects?: string[];
|
|
33
|
+
} | undefined)?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
34
|
+
'no-restricted-imports': import("@typescript-eslint/utils/ts-eslint").RuleModuleWithMetaDocs<string, unknown[], import("@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYjB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import tseslintPlugin from '@typescript-eslint/eslint-plugin';
|
|
2
|
+
import { noRawHtmlElement } from './no-raw-html-element.js';
|
|
3
|
+
import { noTokensBarrelImport } from './no-tokens-barrel-import.js';
|
|
4
|
+
import { noDeprecatedTableParts } from './no-deprecated-table-parts.js';
|
|
5
|
+
import { noRawDesignValues } from './no-raw-design-values.js';
|
|
6
|
+
import { noRawLayerValues } from './no-raw-layer-values.js';
|
|
7
|
+
import { noRawBreakpointQuery } from './no-raw-breakpoint-query.js';
|
|
8
|
+
import { noFlexGrowWeb } from './no-flex-grow-web.js';
|
|
9
|
+
import { preferDsFormComponents } from './prefer-ds-form-components.js';
|
|
10
|
+
export const rules = {
|
|
11
|
+
'no-raw-html-element': noRawHtmlElement,
|
|
12
|
+
'no-tokens-barrel-import': noTokensBarrelImport,
|
|
13
|
+
'no-deprecated-table-parts': noDeprecatedTableParts,
|
|
14
|
+
'no-raw-design-values': noRawDesignValues,
|
|
15
|
+
'no-raw-layer-values': noRawLayerValues,
|
|
16
|
+
'no-raw-breakpoint-query': noRawBreakpointQuery,
|
|
17
|
+
'no-flex-grow-web': noFlexGrowWeb,
|
|
18
|
+
'prefer-ds-form-components': preferDsFormComponents,
|
|
19
|
+
// typescript-eslint's rule under the greenrack prefix: the UI bans keep `allowTypeImports`
|
|
20
|
+
// and report as `greenrack/no-restricted-imports`, apart from the harness's own ban.
|
|
21
|
+
'no-restricted-imports': tseslintPlugin.rules['no-restricted-imports'],
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kCAAkC,CAAA;AAC7D,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAC,sBAAsB,EAAC,MAAM,gCAAgC,CAAA;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAC,sBAAsB,EAAC,MAAM,gCAAgC,CAAA;AAErE,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,qBAAqB,EAAE,gBAAgB;IACvC,yBAAyB,EAAE,oBAAoB;IAC/C,2BAA2B,EAAE,sBAAsB;IACnD,sBAAsB,EAAE,iBAAiB;IACzC,qBAAqB,EAAE,gBAAgB;IACvC,yBAAyB,EAAE,oBAAoB;IAC/C,kBAAkB,EAAE,aAAa;IACjC,2BAA2B,EAAE,sBAAsB;IACnD,2FAA2F;IAC3F,qFAAqF;IACrF,uBAAuB,EAAE,cAAc,CAAC,KAAK,CAAC,uBAAuB,CAAC;CACvE,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
type MessageIds = 'deprecatedContainer' | 'deprecatedIsActions' | 'removeIsActions';
|
|
3
|
+
type Options = [
|
|
4
|
+
{
|
|
5
|
+
tableIdentifiers?: string[];
|
|
6
|
+
}?
|
|
7
|
+
];
|
|
8
|
+
/**
|
|
9
|
+
* Flag the deprecated Table API surface: <Table.Container> (Root owns the
|
|
10
|
+
* container query now) and the no-op `isActions` prop on <Table.HeaderCell>
|
|
11
|
+
* (it belongs on Table.Cell). Container is report-only — unwrapping children
|
|
12
|
+
* mechanically is layout-unsafe. isActions removal autofixes for literal
|
|
13
|
+
* values and falls back to a suggestion when the value is an expression.
|
|
14
|
+
*/
|
|
15
|
+
export declare const noDeprecatedTableParts: TSESLint.RuleModule<MessageIds, Options>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=no-deprecated-table-parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-deprecated-table-parts.d.ts","sourceRoot":"","sources":["../../src/rules/no-deprecated-table-parts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAW,MAAM,0BAA0B,CAAA;AAEhE,KAAK,UAAU,GAAG,qBAAqB,GAAG,qBAAqB,GAAG,iBAAiB,CAAA;AACnF,KAAK,OAAO,GAAG;IACb;QACE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;KAC5B,CAAC;CACH,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CA0F3E,CAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flag the deprecated Table API surface: <Table.Container> (Root owns the
|
|
3
|
+
* container query now) and the no-op `isActions` prop on <Table.HeaderCell>
|
|
4
|
+
* (it belongs on Table.Cell). Container is report-only — unwrapping children
|
|
5
|
+
* mechanically is layout-unsafe. isActions removal autofixes for literal
|
|
6
|
+
* values and falls back to a suggestion when the value is an expression.
|
|
7
|
+
*/
|
|
8
|
+
export const noDeprecatedTableParts = {
|
|
9
|
+
defaultOptions: [{}],
|
|
10
|
+
meta: {
|
|
11
|
+
type: 'problem',
|
|
12
|
+
docs: {
|
|
13
|
+
description: 'Disallow deprecated Table parts (Table.Container, HeaderCell isActions)',
|
|
14
|
+
},
|
|
15
|
+
fixable: 'code',
|
|
16
|
+
hasSuggestions: true,
|
|
17
|
+
schema: [
|
|
18
|
+
{
|
|
19
|
+
type: 'object',
|
|
20
|
+
properties: {
|
|
21
|
+
tableIdentifiers: { type: 'array', items: { type: 'string' }, uniqueItems: true },
|
|
22
|
+
},
|
|
23
|
+
additionalProperties: false,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
messages: {
|
|
27
|
+
deprecatedContainer: '{{table}}.Container is deprecated — {{table}}.Root sets up its own container query. Remove the wrapper.',
|
|
28
|
+
deprecatedIsActions: '`isActions` has no effect on {{table}}.HeaderCell. Pass it on the matching {{table}}.Cell instead.',
|
|
29
|
+
removeIsActions: 'Remove the `isActions` attribute',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
create(context) {
|
|
33
|
+
const tableIdentifiers = new Set(context.options[0]?.tableIdentifiers ?? ['Table', 'TableCore']);
|
|
34
|
+
const sourceCode = context.sourceCode;
|
|
35
|
+
function removeAttribute(fixer, attr) {
|
|
36
|
+
const before = sourceCode.getTokenBefore(attr);
|
|
37
|
+
const start = before ? before.range[1] : attr.range[0];
|
|
38
|
+
return fixer.removeRange([start, attr.range[1]]);
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
JSXOpeningElement(node) {
|
|
42
|
+
if (node.name.type !== 'JSXMemberExpression')
|
|
43
|
+
return;
|
|
44
|
+
const { object, property } = node.name;
|
|
45
|
+
if (object.type !== 'JSXIdentifier' || !tableIdentifiers.has(object.name))
|
|
46
|
+
return;
|
|
47
|
+
if (property.name === 'Container') {
|
|
48
|
+
context.report({
|
|
49
|
+
node: node.name,
|
|
50
|
+
messageId: 'deprecatedContainer',
|
|
51
|
+
data: { table: object.name },
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (property.name !== 'HeaderCell')
|
|
56
|
+
return;
|
|
57
|
+
const attr = node.attributes.find((a) => a.type === 'JSXAttribute' &&
|
|
58
|
+
a.name.type === 'JSXIdentifier' &&
|
|
59
|
+
a.name.name === 'isActions');
|
|
60
|
+
if (!attr)
|
|
61
|
+
return;
|
|
62
|
+
const value = attr.value;
|
|
63
|
+
const isLiteral = value === null ||
|
|
64
|
+
(value?.type === 'JSXExpressionContainer' &&
|
|
65
|
+
value.expression.type === 'Literal' &&
|
|
66
|
+
typeof value.expression.value === 'boolean');
|
|
67
|
+
if (isLiteral) {
|
|
68
|
+
context.report({
|
|
69
|
+
node: attr,
|
|
70
|
+
messageId: 'deprecatedIsActions',
|
|
71
|
+
data: { table: object.name },
|
|
72
|
+
fix: (fixer) => removeAttribute(fixer, attr),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
context.report({
|
|
77
|
+
node: attr,
|
|
78
|
+
messageId: 'deprecatedIsActions',
|
|
79
|
+
data: { table: object.name },
|
|
80
|
+
suggest: [
|
|
81
|
+
{
|
|
82
|
+
messageId: 'removeIsActions',
|
|
83
|
+
fix: (fixer) => removeAttribute(fixer, attr),
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=no-deprecated-table-parts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-deprecated-table-parts.js","sourceRoot":"","sources":["../../src/rules/no-deprecated-table-parts.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
type MessageIds = 'flexGrowForced';
|
|
3
|
+
type Options = [
|
|
4
|
+
{
|
|
5
|
+
factories?: string[];
|
|
6
|
+
}?
|
|
7
|
+
];
|
|
8
|
+
/**
|
|
9
|
+
* Retired in 5.2: reports nothing.
|
|
10
|
+
*
|
|
11
|
+
* The rule assumed react-strict-dom's web runtime forces computed
|
|
12
|
+
* `flex-grow: 0`, so a growing child collapses. It does not: the
|
|
13
|
+
* `Foundations/flexGrow on web` stories (packages/ui/src/docs/FlexGrow.stories.tsx)
|
|
14
|
+
* render a growing child in a row and in a column and assert computed
|
|
15
|
+
* `flex-grow: 1` and the filled size, and ticket-vision measured the same in
|
|
16
|
+
* its app. The rule stays registered, deprecated, so a config that names it
|
|
17
|
+
* (`'greenrack/no-flex-grow-web': 'off'`) keeps loading; it is out of the
|
|
18
|
+
* recommended preset.
|
|
19
|
+
*/
|
|
20
|
+
export declare const noFlexGrowWeb: TSESLint.RuleModule<MessageIds, Options>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=no-flex-grow-web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-flex-grow-web.d.ts","sourceRoot":"","sources":["../../src/rules/no-flex-grow-web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AAEtD,KAAK,UAAU,GAAG,gBAAgB,CAAA;AAClC,KAAK,OAAO,GAAG;IACb;QACE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;KACrB,CAAC;CACH,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CAyBlE,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retired in 5.2: reports nothing.
|
|
3
|
+
*
|
|
4
|
+
* The rule assumed react-strict-dom's web runtime forces computed
|
|
5
|
+
* `flex-grow: 0`, so a growing child collapses. It does not: the
|
|
6
|
+
* `Foundations/flexGrow on web` stories (packages/ui/src/docs/FlexGrow.stories.tsx)
|
|
7
|
+
* render a growing child in a row and in a column and assert computed
|
|
8
|
+
* `flex-grow: 1` and the filled size, and ticket-vision measured the same in
|
|
9
|
+
* its app. The rule stays registered, deprecated, so a config that names it
|
|
10
|
+
* (`'greenrack/no-flex-grow-web': 'off'`) keeps loading; it is out of the
|
|
11
|
+
* recommended preset.
|
|
12
|
+
*/
|
|
13
|
+
export const noFlexGrowWeb = {
|
|
14
|
+
defaultOptions: [{}],
|
|
15
|
+
meta: {
|
|
16
|
+
type: 'problem',
|
|
17
|
+
deprecated: true,
|
|
18
|
+
docs: {
|
|
19
|
+
description: 'Retired: react-strict-dom honours flexGrow on web, so this rule reports nothing',
|
|
20
|
+
},
|
|
21
|
+
schema: [
|
|
22
|
+
{
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
factories: { type: 'array', items: { type: 'string' }, uniqueItems: true },
|
|
26
|
+
},
|
|
27
|
+
additionalProperties: false,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
messages: {
|
|
31
|
+
flexGrowForced: 'Retired: react-strict-dom honours flexGrow on web.',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
create() {
|
|
35
|
+
return {};
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=no-flex-grow-web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-flex-grow-web.js","sourceRoot":"","sources":["../../src/rules/no-flex-grow-web.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,aAAa,GAA6C;IACrE,cAAc,EAAE,CAAC,EAAE,CAAC;IACpB,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE;YACJ,WAAW,EACT,iFAAiF;SACpF;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,SAAS,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC,EAAE,WAAW,EAAE,IAAI,EAAC;iBACvE;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;QACD,QAAQ,EAAE;YACR,cAAc,EAAE,oDAAoD;SACrE;KACF;IACD,MAAM;QACJ,OAAO,EAAE,CAAA;IACX,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
type MessageIds = 'rawBreakpointQuery';
|
|
3
|
+
type Options = [];
|
|
4
|
+
/**
|
|
5
|
+
* A media-query string anywhere in a file — `useMediaQuery("(min-width:
|
|
6
|
+
* 768px)")`, `matchMedia(...)`, a hook's constant — carries a raw breakpoint.
|
|
7
|
+
* `no-raw-design-values` covers the `@media` keys inside css.create; this
|
|
8
|
+
* covers the strings that never reach a style object and so slipped past it.
|
|
9
|
+
*
|
|
10
|
+
* On the scale the fix rewrites the literal to a template literal reading
|
|
11
|
+
* `breakpoints.<key>` (a css.defineConsts string, so `${breakpoints.md}`
|
|
12
|
+
* interpolates to '768px') and adds the import. Off the scale it reports.
|
|
13
|
+
*/
|
|
14
|
+
export declare const noRawBreakpointQuery: TSESLint.RuleModule<MessageIds, Options>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=no-raw-breakpoint-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-raw-breakpoint-query.d.ts","sourceRoot":"","sources":["../../src/rules/no-raw-breakpoint-query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAW,MAAM,0BAA0B,CAAA;AAIhE,KAAK,UAAU,GAAG,oBAAoB,CAAA;AACtC,KAAK,OAAO,GAAG,EAAE,CAAA;AAUjB;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CA+DzE,CAAA"}
|