npm-pkg-lint 3.10.3 → 3.10.5

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/index.js CHANGED
@@ -6440,6 +6440,12 @@ var DEFAULT_OPTIONS = {
6440
6440
  tokens: false,
6441
6441
  allowTrailingCommas: false
6442
6442
  };
6443
+ var UNICODE_SEQUENCE = /\\u[\da-z]{4}/gu;
6444
+ function normalizeIdentifier(identifier) {
6445
+ return identifier.replace(UNICODE_SEQUENCE, (unicodeEscape) => {
6446
+ return String.fromCharCode(parseInt(unicodeEscape.slice(2), 16));
6447
+ });
6448
+ }
6443
6449
  function getStringValue(value, token, json5 = false) {
6444
6450
  let result = "";
6445
6451
  let escapeIndex = value.indexOf("\\");
@@ -6635,7 +6641,7 @@ function parse(text, options) {
6635
6641
  parts
6636
6642
  );
6637
6643
  }
6638
- return types.identifier(identifier, parts);
6644
+ return types.identifier(normalizeIdentifier(identifier), parts);
6639
6645
  }
6640
6646
  function createNullNode(token) {
6641
6647
  const range = createRange(token.loc.start, token.loc.end);
@@ -16552,11 +16558,11 @@ function verifyDependencies(pkg, pkgAst, options) {
16552
16558
  }
16553
16559
  if (isDisallowedDependency(pkg, dependency)) {
16554
16560
  const { line, column } = jsonLocation(pkgAst, "member", "dependencies", key);
16555
- const name2 = key === dependency ? dependency : `"${key}" ("npm:${dependency}")`;
16561
+ const name2 = key === dependency ? `"${dependency}"` : `"${key}" ("npm:${dependency}")`;
16556
16562
  messages.push({
16557
16563
  ruleId: "disallowed-dependency",
16558
16564
  severity: 2,
16559
- message: `"${name2}" should be a devDependency`,
16565
+ message: `${name2} should be a devDependency`,
16560
16566
  line,
16561
16567
  column
16562
16568
  });