pickier 0.1.19 → 0.1.20

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/bin/cli.js CHANGED
@@ -16084,9 +16084,9 @@ var init_no_unused_vars = __esm(() => {
16084
16084
  inString = "double";
16085
16085
  } else if (ch === "`") {
16086
16086
  inString = "template";
16087
- } else if (ch === "/" && i > 0) {
16088
- const before = str.slice(0, i).trimEnd();
16089
- if (/[=([{,:;!&|?]$/.test(before) || before.endsWith("return")) {
16087
+ } else if (ch === "/") {
16088
+ const before = i > 0 ? str.slice(0, i).trimEnd() : "";
16089
+ if (!before || /[=([{,:;!&|?]$/.test(before) || before.endsWith("return")) {
16090
16090
  i++;
16091
16091
  while (i < str.length) {
16092
16092
  if (str[i] === "\\") {
@@ -16318,9 +16318,9 @@ var init_no_unused_vars = __esm(() => {
16318
16318
  let result = "";
16319
16319
  let i2 = 0;
16320
16320
  while (i2 < str.length) {
16321
- if (str[i2] === "/" && i2 > 0) {
16322
- const before = str.slice(0, i2).trimEnd();
16323
- if (/[=([{,:;!&|?]$/.test(before) || before.endsWith("return")) {
16321
+ if (str[i2] === "/") {
16322
+ const before = i2 > 0 ? str.slice(0, i2).trimEnd() : "";
16323
+ if (!before || /[=([{,:;!&|?]$/.test(before) || before.endsWith("return")) {
16324
16324
  i2++;
16325
16325
  while (i2 < str.length) {
16326
16326
  if (str[i2] === "\\") {
@@ -29598,7 +29598,8 @@ function parseDisableDirectives(content) {
29598
29598
  const lineNo = i + 1;
29599
29599
  const nextLineMatch = t.match(/^\/\/\s*(?:eslint|pickier)-disable-next-line\s+(\S.*)$/);
29600
29600
  if (nextLineMatch) {
29601
- const list = nextLineMatch[1].split(",").map((s) => s.trim()).filter(Boolean);
29601
+ const ruleText = nextLineMatch[1].replace(/\s+--\s.*$/, "");
29602
+ const list = ruleText.split(",").map((s) => s.trim()).filter(Boolean);
29602
29603
  if (list.length > 0) {
29603
29604
  const target = lineNo + 1;
29604
29605
  const set = nextLine.get(target) || new Set;
@@ -29610,7 +29611,7 @@ function parseDisableDirectives(content) {
29610
29611
  }
29611
29612
  const blockDisableMatch = t.match(/^\/\*\s*(?:eslint|pickier)-disable(?:\s+([^*]+))?\s*\*\//);
29612
29613
  if (blockDisableMatch) {
29613
- const ruleList = blockDisableMatch[1]?.trim();
29614
+ const ruleList = blockDisableMatch[1]?.trim().replace(/\s+--\s.*$/, "");
29614
29615
  if (!ruleList || ruleList === "") {
29615
29616
  rangeDisable.set(lineNo, new Set(["*"]));
29616
29617
  currentlyDisabled.add("*");
@@ -29653,7 +29654,7 @@ function parseDisableDirectives(content) {
29653
29654
  }
29654
29655
  const inlineDisableMatch = t.match(/^\/\/\s*(?:eslint|pickier)-disable(?:\s+(\S.*))?$/);
29655
29656
  if (inlineDisableMatch) {
29656
- const ruleList = inlineDisableMatch[1]?.trim();
29657
+ const ruleList = inlineDisableMatch[1]?.trim().replace(/\s+--\s.*$/, "");
29657
29658
  if (!ruleList || ruleList === "") {
29658
29659
  rangeDisable.set(lineNo, new Set(["*"]));
29659
29660
  currentlyDisabled.add("*");
@@ -32634,7 +32635,7 @@ var prefix = getPrefix();
32634
32635
  var color18 = __toESM2(require_picocolors(), 1);
32635
32636
  var import_picocolors19 = __toESM2(require_picocolors(), 1);
32636
32637
  // package.json
32637
- var version = "0.1.19";
32638
+ var version = "0.1.20";
32638
32639
 
32639
32640
  // src/run.ts
32640
32641
  init_format();
package/dist/src/index.js CHANGED
@@ -15706,9 +15706,9 @@ var init_no_unused_vars = __esm(() => {
15706
15706
  inString = "double";
15707
15707
  } else if (ch === "`") {
15708
15708
  inString = "template";
15709
- } else if (ch === "/" && i > 0) {
15710
- const before = str.slice(0, i).trimEnd();
15711
- if (/[=([{,:;!&|?]$/.test(before) || before.endsWith("return")) {
15709
+ } else if (ch === "/") {
15710
+ const before = i > 0 ? str.slice(0, i).trimEnd() : "";
15711
+ if (!before || /[=([{,:;!&|?]$/.test(before) || before.endsWith("return")) {
15712
15712
  i++;
15713
15713
  while (i < str.length) {
15714
15714
  if (str[i] === "\\") {
@@ -15940,9 +15940,9 @@ var init_no_unused_vars = __esm(() => {
15940
15940
  let result = "";
15941
15941
  let i2 = 0;
15942
15942
  while (i2 < str.length) {
15943
- if (str[i2] === "/" && i2 > 0) {
15944
- const before = str.slice(0, i2).trimEnd();
15945
- if (/[=([{,:;!&|?]$/.test(before) || before.endsWith("return")) {
15943
+ if (str[i2] === "/") {
15944
+ const before = i2 > 0 ? str.slice(0, i2).trimEnd() : "";
15945
+ if (!before || /[=([{,:;!&|?]$/.test(before) || before.endsWith("return")) {
15946
15946
  i2++;
15947
15947
  while (i2 < str.length) {
15948
15948
  if (str[i2] === "\\") {
@@ -29597,7 +29597,8 @@ function parseDisableDirectives(content) {
29597
29597
  const lineNo = i + 1;
29598
29598
  const nextLineMatch = t.match(/^\/\/\s*(?:eslint|pickier)-disable-next-line\s+(\S.*)$/);
29599
29599
  if (nextLineMatch) {
29600
- const list = nextLineMatch[1].split(",").map((s) => s.trim()).filter(Boolean);
29600
+ const ruleText = nextLineMatch[1].replace(/\s+--\s.*$/, "");
29601
+ const list = ruleText.split(",").map((s) => s.trim()).filter(Boolean);
29601
29602
  if (list.length > 0) {
29602
29603
  const target = lineNo + 1;
29603
29604
  const set = nextLine.get(target) || new Set;
@@ -29609,7 +29610,7 @@ function parseDisableDirectives(content) {
29609
29610
  }
29610
29611
  const blockDisableMatch = t.match(/^\/\*\s*(?:eslint|pickier)-disable(?:\s+([^*]+))?\s*\*\//);
29611
29612
  if (blockDisableMatch) {
29612
- const ruleList = blockDisableMatch[1]?.trim();
29613
+ const ruleList = blockDisableMatch[1]?.trim().replace(/\s+--\s.*$/, "");
29613
29614
  if (!ruleList || ruleList === "") {
29614
29615
  rangeDisable.set(lineNo, new Set(["*"]));
29615
29616
  currentlyDisabled.add("*");
@@ -29652,7 +29653,7 @@ function parseDisableDirectives(content) {
29652
29653
  }
29653
29654
  const inlineDisableMatch = t.match(/^\/\/\s*(?:eslint|pickier)-disable(?:\s+(\S.*))?$/);
29654
29655
  if (inlineDisableMatch) {
29655
- const ruleList = inlineDisableMatch[1]?.trim();
29656
+ const ruleList = inlineDisableMatch[1]?.trim().replace(/\s+--\s.*$/, "");
29656
29657
  if (!ruleList || ruleList === "") {
29657
29658
  rangeDisable.set(lineNo, new Set(["*"]));
29658
29659
  currentlyDisabled.add("*");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pickier",
3
3
  "type": "module",
4
- "version": "0.1.19",
4
+ "version": "0.1.20",
5
5
  "description": "Format, lint and more in a fraction of seconds.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",