@plumeria/eslint-plugin 0.15.0 → 0.15.2

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.
@@ -20,26 +20,24 @@ module.exports = {
20
20
  schema: [],
21
21
  },
22
22
  create(context) {
23
- const isCssIdentifier = (node) =>
24
- node.type === 'Identifier' && node.name === 'css';
25
-
26
23
  return {
27
24
  VariableDeclarator(node) {
28
25
  if (
29
26
  node.id.type === 'ObjectPattern' &&
30
27
  node.init &&
31
- isCssIdentifier(node.init)
28
+ node.init.type === 'Identifier' &&
29
+ node.init.name === 'css'
32
30
  ) {
33
- const forbiddenKeys = ['props', 'global'];
34
- const violated = node.id.properties.filter(
35
- (prop) =>
31
+ for (const prop of node.id.properties) {
32
+ if (
36
33
  prop.type === 'Property' &&
37
34
  prop.key.type === 'Identifier' &&
38
- forbiddenKeys.includes(prop.key.name),
39
- );
40
-
41
- if (violated.length > 0) {
42
- for (const prop of violated) {
35
+ (prop.key.name.startsWith('create') ||
36
+ prop.key.name.startsWith('props') ||
37
+ prop.key.name.startsWith('define') ||
38
+ prop.key.name.startsWith('keyframes') ||
39
+ prop.key.name.startsWith('global'))
40
+ ) {
43
41
  context.report({
44
42
  node: prop,
45
43
  messageId: 'noDestructure',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/eslint-plugin",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "description": "Plumeria ESLint plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,13 +13,13 @@
13
13
  "files": [
14
14
  "lib/"
15
15
  ],
16
- "scripts": {
17
- "build": "echo 'No build necessary'"
18
- },
19
16
  "devDependencies": {
20
17
  "eslint": "^9.15.0"
21
18
  },
22
19
  "publishConfig": {
23
20
  "access": "public"
21
+ },
22
+ "scripts": {
23
+ "build": "echo 'No build necessary'"
24
24
  }
25
- }
25
+ }