@plumeria/eslint-plugin 10.2.0 → 10.2.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 +7 -2
- package/dist/rules/no-unknown-css-properties.js +11 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ The `plugin:@plumeria/recommended` config enables the following:
|
|
|
11
11
|
- `@plumeria/no-combinator`: **error**
|
|
12
12
|
- `@plumeria/no-destructure`: **error**
|
|
13
13
|
- `@plumeria/no-inner-call`: **error**
|
|
14
|
+
- `@plumeria/no-unknown-css-properties`: **error**
|
|
14
15
|
- `@plumeria/no-unused-keys`: **warn**
|
|
15
16
|
- `@plumeria/sort-properties`: **warn**
|
|
16
17
|
- `@plumeria/format-properties`: **warn**
|
|
@@ -35,11 +36,15 @@ Disallow combinators `>`, `+`, `~` and descendant combinator (space) unless insi
|
|
|
35
36
|
|
|
36
37
|
### no-destructure
|
|
37
38
|
|
|
38
|
-
Disallow destructuring
|
|
39
|
+
Disallow destructuring APIs.
|
|
39
40
|
|
|
40
41
|
### no-inner-call
|
|
41
42
|
|
|
42
|
-
Disallow calling
|
|
43
|
+
Disallow calling APIs inside functions.
|
|
44
|
+
|
|
45
|
+
### no-unknown-css-properties
|
|
46
|
+
|
|
47
|
+
Disallow unknown CSS properties in camelCase within `css.create`, `css.keyframes`, and `css.viewTransition`.
|
|
43
48
|
|
|
44
49
|
### no-unused-keys
|
|
45
50
|
|
|
@@ -10,7 +10,7 @@ exports.noUnknownCssProperties = {
|
|
|
10
10
|
meta: {
|
|
11
11
|
type: 'problem',
|
|
12
12
|
docs: {
|
|
13
|
-
description: 'Disallow unknown CSS properties in camelCase within css.create',
|
|
13
|
+
description: 'Disallow unknown CSS properties in camelCase within css.create, css.keyframes, and css.viewTransition',
|
|
14
14
|
},
|
|
15
15
|
messages: {
|
|
16
16
|
unknownProperty: "Unknown CSS property '{{ name }}'.",
|
|
@@ -35,25 +35,29 @@ exports.noUnknownCssProperties = {
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
CallExpression(node) {
|
|
38
|
-
let
|
|
38
|
+
let isCssProperties = false;
|
|
39
39
|
if (node.callee.type === 'MemberExpression') {
|
|
40
40
|
if (node.callee.object.type === 'Identifier' &&
|
|
41
41
|
plumeriaAliases[node.callee.object.name] === 'NAMESPACE') {
|
|
42
42
|
const propertyName = node.callee.property.type === 'Identifier'
|
|
43
43
|
? node.callee.property.name
|
|
44
44
|
: null;
|
|
45
|
-
if (propertyName === 'create'
|
|
46
|
-
|
|
45
|
+
if (propertyName === 'create' ||
|
|
46
|
+
propertyName === 'keyframes' ||
|
|
47
|
+
propertyName === 'viewTransition') {
|
|
48
|
+
isCssProperties = true;
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
else if (node.callee.type === 'Identifier') {
|
|
51
53
|
const alias = plumeriaAliases[node.callee.name];
|
|
52
|
-
if (alias === 'create'
|
|
53
|
-
|
|
54
|
+
if (alias === 'create' ||
|
|
55
|
+
alias === 'keyframes' ||
|
|
56
|
+
alias === 'viewTransition') {
|
|
57
|
+
isCssProperties = true;
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
|
-
if (
|
|
60
|
+
if (isCssProperties) {
|
|
57
61
|
node.arguments.forEach((arg) => {
|
|
58
62
|
if (arg.type === 'ObjectExpression') {
|
|
59
63
|
arg.properties.forEach((prop) => {
|