eslint-mdx
Advanced tools
Comparing version 2.0.0-next.5 to 2.0.0-next.6
@@ -6,5 +6,5 @@ "use strict"; | ||
/* eslint-disable unicorn/no-await-expression-member */ | ||
const fs_1 = tslib_1.__importDefault(require("fs")); | ||
const path_1 = tslib_1.__importDefault(require("path")); | ||
const url_1 = require("url"); | ||
const node_fs_1 = tslib_1.__importDefault(require("node:fs")); | ||
const node_path_1 = tslib_1.__importDefault(require("node:path")); | ||
const node_url_1 = require("node:url"); | ||
const synckit_1 = require("synckit"); | ||
@@ -25,3 +25,3 @@ const last = (items) => items && items[items.length - 1]; | ||
try { | ||
if (fs_1.default.statSync(filename).isDirectory()) { | ||
if (node_fs_1.default.statSync(filename).isDirectory()) { | ||
return child || filename; | ||
@@ -35,3 +35,3 @@ } | ||
if (code === 'ENOTDIR' || code === 'ENOENT') { | ||
return (0, exports.getPhysicalFilename)(path_1.default.dirname(filename), filename); | ||
return (0, exports.getPhysicalFilename)(node_path_1.default.dirname(filename), filename); | ||
} | ||
@@ -67,6 +67,6 @@ } | ||
const loadModule = (modulePath) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const esModulePath = path_1.default.isAbsolute(modulePath) | ||
? (0, url_1.pathToFileURL)(modulePath) | ||
const esModulePath = node_path_1.default.isAbsolute(modulePath) | ||
? (0, node_url_1.pathToFileURL)(modulePath) | ||
: modulePath; | ||
switch (path_1.default.extname(modulePath)) { | ||
switch (node_path_1.default.extname(modulePath)) { | ||
/* istanbul ignore next */ | ||
@@ -105,3 +105,3 @@ case '.mjs': { | ||
if (filePath && /^\.\.?([/\\]|$)/.test(plugin)) { | ||
packages = [path_1.default.resolve(path_1.default.dirname(filePath), plugin)]; | ||
packages = [node_path_1.default.resolve(node_path_1.default.dirname(filePath), plugin)]; | ||
} | ||
@@ -108,0 +108,0 @@ else { |
@@ -5,3 +5,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const path_1 = tslib_1.__importDefault(require("path")); | ||
const node_path_1 = tslib_1.__importDefault(require("node:path")); | ||
const helpers_1 = require("./helpers"); | ||
@@ -20,3 +20,3 @@ exports.DEFAULT_EXTENSIONS = ['.mdx']; | ||
var _a; | ||
const extname = path_1.default.extname(filePath); | ||
const extname = node_path_1.default.extname(filePath); | ||
const isMdx = [...exports.DEFAULT_EXTENSIONS, ...(0, helpers_1.arrayify)(extensions)].includes(extname); | ||
@@ -23,0 +23,0 @@ const isMarkdown = [ |
@@ -7,4 +7,4 @@ "use strict"; | ||
/* eslint-disable unicorn/no-await-expression-member */ | ||
const path_1 = tslib_1.__importDefault(require("path")); | ||
const url_1 = require("url"); | ||
const node_path_1 = tslib_1.__importDefault(require("node:path")); | ||
const node_url_1 = require("node:url"); | ||
const cosmiconfig_1 = require("cosmiconfig"); | ||
@@ -43,3 +43,5 @@ const synckit_1 = require("synckit"); | ||
: yield explorer.search(searchFrom); | ||
const cacheKey = result ? `${String(isMdx)}-${result.filepath}` : ''; | ||
const cacheKey = result | ||
? `${String(isMdx)}-${result.filepath}` | ||
: String(isMdx); | ||
cachedProcessor = exports.processorCache.get(cacheKey); | ||
@@ -138,3 +140,3 @@ if (cachedProcessor) { | ||
if (!TokenTranslator) { | ||
TokenTranslator = (yield (0, helpers_1.loadEsmModule)((0, url_1.pathToFileURL)(path_1.default.resolve(require.resolve('espree/package.json'), '../lib/token-translator.js')))).default; | ||
TokenTranslator = (yield (0, helpers_1.loadEsmModule)((0, node_url_1.pathToFileURL)(node_path_1.default.resolve(require.resolve('espree/package.json'), '../lib/token-translator.js')))).default; | ||
} | ||
@@ -141,0 +143,0 @@ if (!tt) { |
{ | ||
"name": "eslint-mdx", | ||
"version": "2.0.0-next.5", | ||
"version": "2.0.0-next.6", | ||
"description": "ESLint Parser for MDX", | ||
@@ -42,3 +42,3 @@ "repository": "git+https://github.com/mdx-js/eslint-mdx.git", | ||
}, | ||
"gitHead": "dfa23d2c485fbd8049d46194da4233869fc5a4c0" | ||
"gitHead": "1a987b086666aa64f065d231797b40c81136022a" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
83730
1091
5
2