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.
@@ -86,8 +86,9 @@ function findInsertionPoint(node, source) {
86
86
  if (node.typeParameters) {
87
87
  insertPos = node.typeParameters.end;
88
88
  }
89
- if (node.attributes && node.attributes.length > 0) {
90
- const firstAttr = node.attributes[0];
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
- if (node.attributes && node.attributes.length > 0) {
126
- const firstAttr = node.attributes[0];
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?: any) => void;
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?: any) => void;
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
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  shouldProcessFile,
3
3
  transformJsxCode
4
- } from "./chunk-QKGIN5XY.js";
4
+ } from "./chunk-UG3O567Q.js";
5
5
 
6
6
  // src/loader.ts
7
7
  import fs from "fs";
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
- if (node.attributes && node.attributes.length > 0) {
127
- const firstAttr = node.attributes[0];
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
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  shouldProcessFile,
3
3
  transformJsxCode
4
- } from "./chunk-QKGIN5XY.js";
4
+ } from "./chunk-UG3O567Q.js";
5
5
 
6
6
  // src/vite.ts
7
7
  function stripQuery(id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsx-loc-plugin",
3
- "version": "0.2.140",
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
  }