@plumeria/eslint-plugin 19.8.2 → 19.9.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/README.md CHANGED
@@ -139,6 +139,8 @@ Accepts `{ styleProp }`; see [Configuring the styling prop](#configuring-the-sty
139
139
 
140
140
  Disallow unknown CSS properties in camelCase within `css.create`, `css.keyframes`, and `css.viewTransition`.
141
141
 
142
+ In `css.create`, a key that holds an object is reported with a hint that nested selectors start with `:`, `[` or `@`.
143
+
142
144
  ### no-unresolved-composition
143
145
 
144
146
  A safety net for `css.use()`. Warns when its result is combined with other class names or passed to another function, or when a function key is passed to it. Pass every style to one `css.use()` call, and apply function keys to the styling prop.
@@ -13,6 +13,7 @@ exports.noUnknownCssProperties = {
13
13
  },
14
14
  messages: {
15
15
  unknownProperty: "Unknown CSS property '{{ name }}'.",
16
+ unknownNestedProperty: "Unknown CSS property '{{ name }}'. Nested selectors start with ':', '[' or '@'.",
16
17
  },
17
18
  schema: [],
18
19
  },
@@ -38,6 +39,7 @@ exports.noUnknownCssProperties = {
38
39
  },
39
40
  CallExpression(node) {
40
41
  let isCssProperties = false;
42
+ let isCreate = false;
41
43
  if (node.callee.type === 'MemberExpression') {
42
44
  if (node.callee.object.type === 'Identifier' &&
43
45
  plumeriaAliases[node.callee.object.name] === 'NAMESPACE') {
@@ -48,6 +50,7 @@ exports.noUnknownCssProperties = {
48
50
  propertyName === 'keyframes' ||
49
51
  propertyName === 'viewTransition') {
50
52
  isCssProperties = true;
53
+ isCreate = propertyName === 'create';
51
54
  }
52
55
  }
53
56
  }
@@ -57,6 +60,7 @@ exports.noUnknownCssProperties = {
57
60
  alias === 'keyframes' ||
58
61
  alias === 'viewTransition') {
59
62
  isCssProperties = true;
63
+ isCreate = alias === 'create';
60
64
  }
61
65
  }
62
66
  if (isCssProperties) {
@@ -67,18 +71,18 @@ exports.noUnknownCssProperties = {
67
71
  return;
68
72
  const style = (0, styleObject_1.styleObjectFromValue)(prop.value);
69
73
  if (style)
70
- checkStyleObject(style);
74
+ checkStyleObject(style, isCreate);
71
75
  });
72
76
  }
73
77
  });
74
78
  }
75
79
  },
76
80
  };
77
- function checkStyleObject(node) {
81
+ function checkStyleObject(node, isCreate) {
78
82
  node.properties.forEach((prop) => {
79
83
  if (prop.type === 'Property') {
80
84
  if (prop.value.type === 'ObjectExpression') {
81
- checkStyleObject(prop.value);
85
+ checkStyleObject(prop.value, isCreate);
82
86
  }
83
87
  let isCheckable = false;
84
88
  let keyName = '';
@@ -103,7 +107,9 @@ exports.noUnknownCssProperties = {
103
107
  if (!knownProperties.has(kebabName)) {
104
108
  context.report({
105
109
  node: prop.key,
106
- messageId: 'unknownProperty',
110
+ messageId: isCreate && prop.value.type === 'ObjectExpression'
111
+ ? 'unknownNestedProperty'
112
+ : 'unknownProperty',
107
113
  data: {
108
114
  name: keyName,
109
115
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/eslint-plugin",
3
- "version": "19.8.2",
3
+ "version": "19.9.1",
4
4
  "description": "Plumeria ESLint plugin",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -54,7 +54,7 @@
54
54
  "dependencies": {
55
55
  "known-css-properties": "^0.37.0",
56
56
  "zss-engine": "2.9.1",
57
- "@plumeria/compiler": "19.8.2"
57
+ "@plumeria/compiler": "19.9.1"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "rimraf dist && pnpm cjs",