@idomatic/parser-js 1.1.0 → 1.2.0

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/index.js +7 -3
  2. package/package.json +10 -1
package/index.js CHANGED
@@ -78,7 +78,7 @@ export default function parseJS(filePath, config, dry = false) {
78
78
  visitJSXOpeningElement(path) {
79
79
  const value = getStringAttr(path.node.attributes, attributeName);
80
80
  if (value) existingIds.push(value);
81
- return false;
81
+ this.traverse(path);
82
82
  },
83
83
  });
84
84
 
@@ -89,7 +89,11 @@ export default function parseJS(filePath, config, dry = false) {
89
89
  const opening = path.node;
90
90
  const tag = getTagName(opening.name);
91
91
 
92
- if (tagsToExclude.includes(tag)) return false;
92
+ if (tagsToExclude.includes(tag)) {
93
+ // Still visit JSX passed through props, e.g. fallback={<p>...</p>}.
94
+ this.traverse(path);
95
+ return;
96
+ }
93
97
 
94
98
  const hasId = opening.attributes.some(
95
99
  (attr) => attr.name?.name === attributeName
@@ -107,7 +111,7 @@ export default function parseJS(filePath, config, dry = false) {
107
111
  changed = true;
108
112
  }
109
113
 
110
- return false;
114
+ this.traverse(path);
111
115
  },
112
116
  });
113
117
 
package/package.json CHANGED
@@ -1,8 +1,17 @@
1
1
  {
2
2
  "name": "@idomatic/parser-js",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "JS/TSX parser for idomatic CLI",
5
5
  "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/AmarSmajlovic/idomatic.git",
9
+ "directory": "packages/parser-js"
10
+ },
11
+ "homepage": "https://www.idomatic.dev",
12
+ "bugs": {
13
+ "url": "https://github.com/AmarSmajlovic/idomatic/issues"
14
+ },
6
15
  "main": "index.js",
7
16
  "files": [
8
17
  "index.js",