@plumeria/eslint-plugin 19.6.0 → 19.6.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.
Files changed (2) hide show
  1. package/README.md +5 -44
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -16,8 +16,8 @@ The `plugin:@plumeria/recommended` config enables the following:
16
16
  - `@plumeria/no-mixed-styling-props`: **error**
17
17
  - `@plumeria/no-order-dependent-overlap`: **warn**
18
18
  - `@plumeria/no-unknown-css-properties`: **error**
19
- - `@plumeria/no-unused-keys`: **warn**
20
19
  - `@plumeria/no-unresolved-composition`: **warn**
20
+ - `@plumeria/no-unused-keys`: **warn**
21
21
  - `@plumeria/sort-properties`: **warn**
22
22
  - `@plumeria/format-properties`: **warn**
23
23
  - `@plumeria/validate-values`: **warn**
@@ -131,6 +131,10 @@ is known to be vertical.
131
131
 
132
132
  Disallow unknown CSS properties in camelCase within `css.create`, `css.keyframes`, and `css.viewTransition`.
133
133
 
134
+ ### no-unresolved-composition
135
+
136
+ A safety net for `css.use()`. Warns when its result is combined with other class names or passed to another function; pass every style to one `css.use()` call instead.
137
+
134
138
  ### no-unused-keys
135
139
 
136
140
  Warns when object keys are defined but not used, mainly in component files.
@@ -158,49 +162,6 @@ Validates CSS pseudo-classes and pseudo-elements inside `css.create()`. It check
158
162
 
159
163
  Validates at-rules inside `css.create()`. It accepts `@media`, `@container`, `@supports`, `@layer`, and `@scope`, each with a prelude, whether or not a space separates it from the keyword, and supports validation of computed keys when TypeScript is available.
160
164
 
161
- ### no-unresolved-composition
162
-
163
- Warns when a `css.use()` result is combined with other class names using `+`,
164
- a template literal, or an inline array's `.join()`, or passed to a function such
165
- as `clsx` or `css.use()` itself. Enabled by `recommended` as `warn`:
166
-
167
- ```js
168
- '@plumeria/no-unresolved-composition': 'warn'
169
- ```
170
-
171
- ```js
172
- // Warns: merge separate css.use() calls.
173
- `${css.use(styles.base)} ${css.use(styles.active)}`
174
- css.use(styles.base) + ' ' + (active ? css.use(styles.active) : '')
175
-
176
- // Warns: pass styles, not css.use() results, to one call.
177
- clsx(css.use(styles.base), className)
178
- css.use(css.use(styles.base), styles.active)
179
-
180
- // Warns: rewrite external classes with css.create().
181
- css.use(styles.base) + ' external'
182
- [css.use(styles.base), 'external'].join(' ')
183
-
184
- // Compose everything in one call; nested arrays are allowed.
185
- css.use(styles.base, [active && styles.active, styles.external])
186
- ```
187
-
188
- When a `css.use()` result is a function argument, directly, inside an array or
189
- spread, or in a conditional branch, the rule reports that the styles should be
190
- passed to one `css.use()` call instead; this is reported before the other two.
191
- When two or more `css.use()` results are combined, the rule reports that they
192
- should be merged into one call; this is reported first, even if external classes
193
- are also present. When a `css.use()` result is combined with external class
194
- names, it lists them as written in the source and reports that their precedence is left to the CSS cascade and that they
195
- should be rewritten as styles with `css.create()` and passed into the same
196
- `css.use()` call. It offers no automatic fix. Whitespace-only
197
- additions are allowed. Imports and their aliases are resolved with scope, so
198
- unrelated or shadowed `use` functions are ignored. Detection covers calls within
199
- these expressions, including conditional branches, and follows results through
200
- local variables, `+=` assignments, arrays joined through a variable, and object
201
- properties. It does not follow values returned from functions or imported from
202
- other modules.
203
-
204
165
  ## Optional rules
205
166
 
206
167
  These rules are not enabled by `plumeria.configs.recommended`. Enable only the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/eslint-plugin",
3
- "version": "19.6.0",
3
+ "version": "19.6.1",
4
4
  "description": "Plumeria ESLint plugin",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -55,7 +55,7 @@
55
55
  "dependencies": {
56
56
  "known-css-properties": "^0.37.0",
57
57
  "zss-engine": "2.8.0",
58
- "@plumeria/compiler": "19.6.0"
58
+ "@plumeria/compiler": "19.6.1"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "rimraf dist && pnpm cjs",