eslint-mdx
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -48,3 +48,5 @@ "use strict"; | ||
catch (err) { | ||
if (err.code === 'ERR_REQUIRE_ESM') { | ||
const code = err.code; | ||
if (code === 'ERR_REQUIRE_ESM' || | ||
code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') { | ||
return (yield (0, exports.loadEsmModule)(esModulePath)).default; | ||
@@ -51,0 +53,0 @@ } |
@@ -34,2 +34,3 @@ "use strict"; | ||
const nodeEnd = nodePos.end.offset; | ||
const lastCharOffset = prevCharOffset(nodeEnd - 2); | ||
(0, assert_1.ok)(nodeStart != null); | ||
@@ -48,2 +49,3 @@ (0, assert_1.ok)(nodeEnd != null); | ||
const nodeNameLength = (_a = nodeName === null || nodeName === void 0 ? void 0 : nodeName.length) !== null && _a !== void 0 ? _a : 0; | ||
const selfClosing = text[lastCharOffset] === '/'; | ||
let nodeNameStart = nodeStart + 1; | ||
@@ -101,9 +103,14 @@ if (nodeName) { | ||
} | ||
const nextOffset = nextCharOffset(lastAttrOffset + 1); | ||
const nextChar = text[nextOffset]; | ||
if (nextChar === '/') { | ||
let nextOffset = nextCharOffset(lastAttrOffset + 1); | ||
let nextChar = text[nextOffset]; | ||
const expectedNextChar = selfClosing ? '/' : '>'; | ||
if (nextChar !== expectedNextChar) { | ||
nextOffset = nextCharOffset(lastAttrOffset); | ||
nextChar = text[nextOffset]; | ||
} | ||
if (selfClosing) { | ||
tokens.push(newToken(tt.slash, nextOffset, nextOffset + 1, '/')); | ||
} | ||
else { | ||
(0, assert_1.ok)(nextChar === '>'); | ||
(0, assert_1.ok)(nextChar === '>', `\`nextChar\` must be '>' but actually is '${nextChar}'`); | ||
const prevOffset = prevCharOffset(nodeEnd - 2); | ||
@@ -110,0 +117,0 @@ if (nodeName) { |
@@ -260,5 +260,10 @@ "use strict"; | ||
children }); | ||
const nextOffset = nextCharOffset(lastAttrOffset + 1); | ||
const nextChar = text[nextOffset]; | ||
(0, assert_1.ok)(nextChar === (selfClosing ? '/' : '>')); | ||
let nextOffset = nextCharOffset(lastAttrOffset + 1); | ||
let nextChar = text[nextOffset]; | ||
const expectedNextChar = selfClosing ? '/' : '>'; | ||
if (nextChar !== expectedNextChar) { | ||
nextOffset = nextCharOffset(lastAttrOffset); | ||
nextChar = text[nextOffset]; | ||
} | ||
(0, assert_1.ok)(nextChar === expectedNextChar, `\`nextChar\` must be '${expectedNextChar}' but actually is '${nextChar}'`); | ||
Object.assign(jsxEl.openingElement, normalizeNode(nodeStart, selfClosing ? nodeEnd : nextOffset + 1)); | ||
@@ -265,0 +270,0 @@ expression = jsxEl; |
{ | ||
"name": "eslint-mdx", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "ESLint Parser for MDX", | ||
@@ -5,0 +5,0 @@ "repository": "git+https://github.com/mdx-js/eslint-mdx.git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79989
1015