@plumeria/eslint-plugin 0.2.3 → 0.2.4

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.
@@ -73,14 +73,17 @@ module.exports = {
73
73
  node.object.type === 'Identifier' &&
74
74
  node.property.type === 'Identifier'
75
75
  ) {
76
- const fullKey = `${node.object.name}.${node.property.name}`;
77
- referencedKeys.add(fullKey);
76
+ const normalKey = `${node.object.name}.${node.property.name}`;
77
+ const dollerKey = `${node.object.name}.$${node.property.name}`;
78
+ referencedKeys.add(normalKey);
79
+ referencedKeys.add(dollerKey);
78
80
 
79
81
  if (parserServices && checker) {
80
82
  const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
81
83
  const symbol = checker.getSymbolAtLocation(tsNode);
82
84
  if (symbol) {
83
- referencedKeys.add(fullKey);
85
+ referencedKeys.add(normalKey);
86
+ referencedKeys.add(dollerKey);
84
87
  }
85
88
  }
86
89
  }
@@ -88,8 +91,12 @@ module.exports = {
88
91
  'Program:exit'() {
89
92
  definedKeys.forEach((keyMap, variableName) => {
90
93
  keyMap.forEach((keyNode, keyName) => {
91
- const fullKey = `${variableName}.${keyName}`;
92
- if (!referencedKeys.has(fullKey)) {
94
+ const normalKey = `${variableName}.${keyName}`;
95
+ const dollerKey = `${variableName}.$${keyName}`;
96
+ if (
97
+ !referencedKeys.has(normalKey) &&
98
+ !referencedKeys.has(dollerKey)
99
+ ) {
93
100
  context.report({
94
101
  node: keyNode,
95
102
  messageId: 'unusedKey',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/eslint-plugin",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Zero-runtime, expressive CSS-in-JS library for TypeScript.",
5
5
  "repository": "github:zss-in-js/plumeria",
6
6
  "license": "MIT",