jsx-loc-plugin 0.2.140 → 0.2.142
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/dist/{chunk-QKGIN5XY.js → chunk-UG3O567Q.js} +3 -2
- package/dist/loader.cjs +3 -2
- package/dist/loader.d.cts +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +1 -1
- package/dist/vite.cjs +3 -2
- package/dist/vite.js +1 -1
- package/package.json +3 -1
|
@@ -86,8 +86,9 @@ function findInsertionPoint(node, source) {
|
|
|
86
86
|
if (node.typeParameters) {
|
|
87
87
|
insertPos = node.typeParameters.end;
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
const attributes = node.attributes;
|
|
90
|
+
if (attributes && attributes.length > 0) {
|
|
91
|
+
const firstAttr = attributes[0];
|
|
91
92
|
const nameEnd = node.typeParameters ? node.typeParameters.end : node.name.end;
|
|
92
93
|
let pos = nameEnd;
|
|
93
94
|
while (pos < firstAttr.start && /\s/.test(source[pos])) {
|
package/dist/loader.cjs
CHANGED
|
@@ -122,8 +122,9 @@ function findInsertionPoint(node, source) {
|
|
|
122
122
|
if (node.typeParameters) {
|
|
123
123
|
insertPos = node.typeParameters.end;
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
const attributes = node.attributes;
|
|
126
|
+
if (attributes && attributes.length > 0) {
|
|
127
|
+
const firstAttr = attributes[0];
|
|
127
128
|
const nameEnd = node.typeParameters ? node.typeParameters.end : node.name.end;
|
|
128
129
|
let pos = nameEnd;
|
|
129
130
|
while (pos < firstAttr.start && /\s/.test(source[pos])) {
|
package/dist/loader.d.cts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Webpack/Turbopack loader that transforms JSX to add data-loc attributes
|
|
3
3
|
*/
|
|
4
4
|
interface LoaderContext {
|
|
5
|
-
async(): (err: Error | null, content?: string, map?:
|
|
5
|
+
async(): (err: Error | null, content?: string, map?: unknown) => void;
|
|
6
6
|
resourcePath: string;
|
|
7
7
|
}
|
|
8
8
|
declare function jsxLocLoader(this: LoaderContext, source: string): Promise<void>;
|
package/dist/loader.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Webpack/Turbopack loader that transforms JSX to add data-loc attributes
|
|
3
3
|
*/
|
|
4
4
|
interface LoaderContext {
|
|
5
|
-
async(): (err: Error | null, content?: string, map?:
|
|
5
|
+
async(): (err: Error | null, content?: string, map?: unknown) => void;
|
|
6
6
|
resourcePath: string;
|
|
7
7
|
}
|
|
8
8
|
declare function jsxLocLoader(this: LoaderContext, source: string): Promise<void>;
|
package/dist/loader.js
CHANGED
package/dist/vite.cjs
CHANGED
|
@@ -123,8 +123,9 @@ function findInsertionPoint(node, source) {
|
|
|
123
123
|
if (node.typeParameters) {
|
|
124
124
|
insertPos = node.typeParameters.end;
|
|
125
125
|
}
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
const attributes = node.attributes;
|
|
127
|
+
if (attributes && attributes.length > 0) {
|
|
128
|
+
const firstAttr = attributes[0];
|
|
128
129
|
const nameEnd = node.typeParameters ? node.typeParameters.end : node.name.end;
|
|
129
130
|
let pos = nameEnd;
|
|
130
131
|
while (pos < firstAttr.start && /\s/.test(source[pos])) {
|
package/dist/vite.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsx-loc-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.142",
|
|
4
4
|
"description": "Next.js plugin that adds data-loc attributes to JSX elements for UILint inspection",
|
|
5
5
|
"author": "Peter Suggate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,6 +58,8 @@
|
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsup",
|
|
60
60
|
"dev": "tsup --watch",
|
|
61
|
+
"lint": "eslint src/",
|
|
62
|
+
"lint:strict": "eslint src/ --max-warnings 0",
|
|
61
63
|
"typecheck": "tsc --noEmit"
|
|
62
64
|
}
|
|
63
65
|
}
|