html-validate 9.1.1 → 9.1.2
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/cjs/browser.js +1 -1
- package/dist/cjs/cli.js +3 -3
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/core-browser.js +30 -0
- package/dist/cjs/core-browser.js.map +1 -1
- package/dist/cjs/core-nodejs.js +1 -1
- package/dist/cjs/core-nodejs.js.map +1 -1
- package/dist/cjs/core.js +19 -49
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/matchers.js +6 -6
- package/dist/cjs/matchers.js.map +1 -1
- package/dist/cjs/utils/natural-join.js.map +1 -1
- package/dist/cjs/vitest.js +3 -3
- package/dist/cjs/vitest.js.map +1 -1
- package/dist/es/browser.js +2 -2
- package/dist/es/cli.js +3 -3
- package/dist/es/cli.js.map +1 -1
- package/dist/es/core-browser.js +31 -2
- package/dist/es/core-browser.js.map +1 -1
- package/dist/es/core-nodejs.js +1 -2
- package/dist/es/core-nodejs.js.map +1 -1
- package/dist/es/core.js +20 -49
- package/dist/es/core.js.map +1 -1
- package/dist/es/html-validate.js +1 -2
- package/dist/es/html-validate.js.map +1 -1
- package/dist/es/index.js +0 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/jest-worker.js +0 -1
- package/dist/es/jest-worker.js.map +1 -1
- package/dist/es/jest.js +0 -1
- package/dist/es/jest.js.map +1 -1
- package/dist/es/matchers.js +6 -6
- package/dist/es/matchers.js.map +1 -1
- package/dist/es/utils/natural-join.js.map +1 -1
- package/dist/es/vitest.js +3 -4
- package/dist/es/vitest.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-nodejs.js","sources":["../../src/utils/require-uncached.ts","../../src/config/resolver/nodejs/determine-root-dir.ts","../../src/config/resolver/nodejs/expand-relative-path.ts","../../src/config/resolver/nodejs/cjs-resolver.ts","../../src/config/resolver/nodejs/import-function.ts","../../src/config/resolver/nodejs/internal-import.ts","../../src/config/resolver/nodejs/esm-resolver.ts","../../src/config/loaders/file-system.ts","../../src/utils/compatibility-check.nodejs.ts"],"sourcesContent":["/**\n * Similar to `require(..)` but removes the cached copy first.\n */\nexport function requireUncached(require: NodeJS.Require, moduleId: string): unknown {\n\tconst filename = require.resolve(moduleId);\n\n\t/* remove references from the parent module to prevent memory leak */\n\tconst m = require.cache[filename];\n\tif (m?.parent) {\n\t\tconst { parent } = m;\n\t\tfor (let i = parent.children.length - 1; i >= 0; i--) {\n\t\t\tif (parent.children[i].id === filename) {\n\t\t\t\tparent.children.splice(i, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* remove old module from cache */\n\t/* eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- needed to perform its function */\n\tdelete require.cache[filename];\n\n\t/* eslint-disable-next-line import/no-dynamic-require, security/detect-non-literal-require -- as expected but should be moved to upcoming resolver class */\n\treturn require(filename);\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nlet cachedRootDir: string | null = null;\n\ninterface FSLike {\n\texistsSync(path: string): boolean;\n}\n\n/**\n * @internal\n */\nexport function determineRootDirImpl(intial: string, fs: FSLike): string {\n\t/* try to locate package.json */\n\tlet current = intial;\n\n\t// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition -- break outs when filesystem is traversed\n\twhile (true) {\n\t\tconst search = path.join(current, \"package.json\");\n\t\tif (fs.existsSync(search)) {\n\t\t\treturn current;\n\t\t}\n\n\t\t/* get the parent directory */\n\t\tconst child = current;\n\t\tcurrent = path.dirname(current);\n\n\t\t/* stop if this is the root directory */\n\t\tif (current === child) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* default to working directory if no package.json is found */\n\treturn intial;\n}\n\n/**\n * Try to determine root directory based on the location of the closest\n * `package.json`. Fallbacks on `process.cwd()` if no package.json was found.\n *\n * @internal\n */\n/* istanbul ignore next: cached version of determineRootDirImpl, no need to test */\nexport function determineRootDir(): string {\n\tif (cachedRootDir === null) {\n\t\tcachedRootDir = determineRootDirImpl(process.cwd(), fs);\n\t}\n\treturn cachedRootDir;\n}\n","import path from \"node:path\";\n\n/**\n * @internal\n */\nexport function expandRelativePath<T>(value: string | T, { cwd }: { cwd: string }): string | T {\n\tif (typeof value === \"string\" && value.startsWith(\".\")) {\n\t\treturn path.normalize(path.join(cwd, value));\n\t} else {\n\t\treturn value;\n\t}\n}\n","import path from \"node:path\";\nimport { type MetaDataTable } from \"../../../meta\";\nimport { type Plugin } from \"../../../plugin\";\nimport { legacyRequire } from \"../../../resolve\";\nimport { type Transformer } from \"../../../transform\";\nimport { requireUncached } from \"../../../utils\";\nimport { type ConfigData } from \"../../config-data\";\nimport { ConfigError } from \"../../error\";\nimport { type Resolver, type ResolverOptions } from \"../resolver\";\nimport { determineRootDir } from \"./determine-root-dir\";\nimport { expandRelativePath } from \"./expand-relative-path\";\n\n/**\n * @internal\n */\nexport interface RequireError extends Error {\n\tcode: string;\n}\n\nfunction isRequireError(error: unknown): error is RequireError {\n\treturn Boolean(error && typeof error === \"object\" && \"code\" in error);\n}\n\nfunction isTransformer(value: Transformer | Plugin): value is Transformer {\n\treturn typeof value === \"function\";\n}\n\n/**\n * CommonJS resolver.\n *\n * @public\n * @since 8.8.0\n */\nexport type CommonJSResolver = Required<Resolver>;\n\n/**\n * CommonJS resolver.\n *\n * @public\n * @deprecated Deprecated alias for [[CommonJSResolver]].\n * @since 8.0.0\n */\nexport type NodeJSResolver = Required<Resolver>;\n\n/**\n * Create a new resolver for NodeJS packages using `require(..)`.\n *\n * If the module name contains `<rootDir>` (e.g. `<rootDir/foo`) it will be\n * expanded relative to the root directory either explicitly set by the\n * `rootDir` parameter or determined automatically by the closest `package.json`\n * file (starting at the current working directory).\n *\n * @public\n * @since 8.8.0\n */\nexport function cjsResolver(options: { rootDir?: string } = {}): CommonJSResolver {\n\tconst rootDir = options.rootDir ?? determineRootDir();\n\n\tfunction internalRequire<T = unknown>(id: string, { cache }: ResolverOptions): T | null {\n\t\tconst moduleName = id.replace(\"<rootDir>\", rootDir);\n\t\ttry {\n\t\t\t/* istanbul ignore else: the tests only runs the cached versions to get\n\t\t\t * unmodified access to `require`, the implementation of `requireUncached`\n\t\t\t * is assumed to be tested elsewhere */\n\t\t\tif (cache) {\n\t\t\t\treturn legacyRequire(moduleName) as T;\n\t\t\t} else {\n\t\t\t\treturn requireUncached(legacyRequire, moduleName) as T;\n\t\t\t}\n\t\t} catch (err: unknown) {\n\t\t\tif (isRequireError(err) && err.code === \"MODULE_NOT_FOUND\") {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\treturn {\n\t\tname: \"nodejs-resolver\",\n\n\t\tresolveElements(id: string, options: ResolverOptions): MetaDataTable | null {\n\t\t\treturn internalRequire(id, options);\n\t\t},\n\n\t\tresolveConfig(id: string, options: ResolverOptions): ConfigData | null {\n\t\t\tconst configData = internalRequire<ConfigData>(id, options);\n\t\t\tif (!configData) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t/* expand any relative paths */\n\t\t\tconst cwd = path.dirname(id);\n\t\t\tconst expand = <T>(value: string | T): string | T => expandRelativePath(value, { cwd });\n\n\t\t\tif (Array.isArray(configData.elements)) {\n\t\t\t\tconfigData.elements = configData.elements.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.extends)) {\n\t\t\t\tconfigData.extends = configData.extends.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.plugins)) {\n\t\t\t\tconfigData.plugins = configData.plugins.map(expand);\n\t\t\t}\n\n\t\t\treturn configData;\n\t\t},\n\n\t\tresolvePlugin(id: string, options: ResolverOptions): Plugin | null {\n\t\t\treturn internalRequire<Plugin>(id, options);\n\t\t},\n\n\t\tresolveTransformer(id: string, options: ResolverOptions): Transformer | null {\n\t\t\tconst mod = internalRequire<Transformer | Plugin>(id, options);\n\t\t\tif (!mod) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isTransformer(mod)) {\n\t\t\t\treturn mod;\n\t\t\t}\n\n\t\t\t/* this is not a proper transformer, is it a plugin exposing a transformer? */\n\t\t\tif (mod.transformer) {\n\t\t\t\tthrow new ConfigError(\n\t\t\t\t\t`Module \"${id}\" is not a valid transformer. This looks like a plugin, did you forget to load the plugin first?`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new ConfigError(`Module \"${id}\" is not a valid transformer.`);\n\t\t},\n\t};\n}\n\n/**\n * Create a new resolver for NodeJS packages using `require(..)`.\n *\n * If the module name contains `<rootDir>` (e.g. `<rootDir/foo`) it will be\n * expanded relative to the root directory either explicitly set by the\n * `rootDir` parameter or determined automatically by the closest `package.json`\n * file (starting at the current working directory).\n *\n * @public\n * @deprecated Deprecated alias for [[commonjsResolver]].\n * @since 8.0.0\n */\n/* istanbul ignore next -- deprecated alias */\nexport function nodejsResolver(options: { rootDir?: string } = {}): NodeJSResolver {\n\treturn cjsResolver(options);\n}\n","/* istanbul ignore file: this file is only for easier mocking */\n\n/**\n * Wrapper around import() so we can mock it in unittests.\n *\n * @internal\n */\nexport function importFunction(id: string): unknown {\n\treturn import(id);\n}\n","import fs from \"node:fs/promises\";\nimport { fileURLToPath } from \"node:url\";\nimport { importResolve } from \"../../../resolve\";\nimport { UserError } from \"../../../error\";\nimport { type ResolverOptions } from \"../resolver\";\nimport { importFunction } from \"./import-function\";\n\n/**\n * @internal\n */\nexport interface ImportError extends Error {\n\tcode: string;\n\trequireStack?: string[];\n}\n\nasync function getModuleName(\n\tid: string,\n\t{ cache, rootDir }: { cache: boolean; rootDir: string },\n): Promise<URL> {\n\tconst moduleName = id.replace(\"<rootDir>\", rootDir);\n\tconst url = importResolve(moduleName);\n\n\tif (url.protocol !== \"file:\") {\n\t\treturn url;\n\t}\n\n\t/* istanbul ignore else: the tests only runs the cached versions */\n\tif (cache) {\n\t\treturn url;\n\t} else {\n\t\t/* Cachebusting in ESM is tricky, we cannot flush the cache of the old import\n\t\t * but a common workaround is to append ?something to the path. It only works\n\t\t * with absolute paths though so we must first use `import.meta.resolve(..)`\n\t\t * which doesn't play nice with CJS. Then we will leak memory each time a\n\t\t * fresh copy is loaded and there doesn't seem to be a way to deal with this\n\t\t * yet. We use the file mtime to at least try to retain the copy as long as\n\t\t * possible but this will fail for transitive imports but at least with\n\t\t * directly loaded configurations it would reload property. */\n\t\tconst stat = await fs.stat(url);\n\t\turl.searchParams.append(\"mtime\", String(stat.mtime.getTime()));\n\t\treturn url;\n\t}\n}\n\nfunction isImportError(error: unknown): error is ImportError {\n\treturn Boolean(error && typeof error === \"object\" && \"code\" in error);\n}\n\n/**\n * @internal\n */\nexport async function internalImport<T = unknown>(\n\tid: string,\n\trootDir: string,\n\t{ cache }: ResolverOptions,\n): Promise<T | null> {\n\t/* this is a workaround for rollup which mangles import attributes so we\n\t * cannot use `import(.., { with: { type: \"json\" } })` to import a json\n\t * file. */\n\t/* istanbul ignore if: workaround, not tested, should be removed if the compiler bug is fixed */\n\tif (id.endsWith(\".json\")) {\n\t\tconst content = await fs.readFile(id, \"utf-8\");\n\t\treturn JSON.parse(content) as T;\n\t}\n\n\ttry {\n\t\tconst url = await getModuleName(id, { cache, rootDir });\n\t\tif (url.protocol !== \"file:\") {\n\t\t\treturn null;\n\t\t}\n\t\tconst moduleName = fileURLToPath(url);\n\n\t\tconst { default: defaultImport } = (await importFunction(moduleName)) as { default: T };\n\t\tif (!defaultImport) {\n\t\t\tthrow new UserError(`\"${id}\" does not have a default export`);\n\t\t}\n\t\treturn defaultImport;\n\t} catch (err: unknown) {\n\t\tif (isImportError(err) && err.code === \"MODULE_NOT_FOUND\" && !err.requireStack) {\n\t\t\treturn null;\n\t\t}\n\t\tthrow err;\n\t}\n}\n","import path from \"node:path\";\nimport { type MetaDataTable } from \"../../../meta\";\nimport { type Plugin } from \"../../../plugin\";\nimport { type Transformer } from \"../../../transform\";\nimport { type ConfigData } from \"../../config-data\";\nimport { ConfigError } from \"../../error\";\nimport { type Resolver, type ResolverOptions } from \"../resolver\";\nimport { determineRootDir } from \"./determine-root-dir\";\nimport { expandRelativePath } from \"./expand-relative-path\";\nimport { internalImport } from \"./internal-import\";\n\nfunction isTransformer(value: Transformer | Plugin): value is Transformer {\n\treturn typeof value === \"function\";\n}\n\n/**\n * ESM resolver.\n *\n * @public\n * @since 9.0.0\n */\nexport type ESMResolver = Required<Resolver>;\n\n/**\n * Create a new resolver for NodeJS packages using `import(..)`.\n *\n * If the module name contains `<rootDir>` (e.g. `<rootDir/foo`) it will be\n * expanded relative to the root directory either explicitly set by the\n * `rootDir` parameter or determined automatically by the closest `package.json`\n * file (starting at the current working directory).\n *\n * @public\n * @since 9.0.0\n */\nexport function esmResolver(options: { rootDir?: string } = {}): ESMResolver {\n\tconst rootDir = options.rootDir ?? determineRootDir();\n\n\treturn {\n\t\tname: \"esm-resolver\",\n\n\t\tresolveElements(id: string, options: ResolverOptions): Promise<MetaDataTable | null> {\n\t\t\treturn internalImport(id, rootDir, options);\n\t\t},\n\n\t\tasync resolveConfig(id: string, options: ResolverOptions): Promise<ConfigData | null> {\n\t\t\tconst configData = await internalImport<ConfigData>(id, rootDir, options);\n\t\t\tif (!configData) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t/* expand any relative paths */\n\t\t\tconst cwd = path.dirname(id);\n\t\t\tconst expand = <T>(value: string | T): string | T => expandRelativePath(value, { cwd });\n\n\t\t\tif (Array.isArray(configData.elements)) {\n\t\t\t\tconfigData.elements = configData.elements.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.extends)) {\n\t\t\t\tconfigData.extends = configData.extends.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.plugins)) {\n\t\t\t\tconfigData.plugins = configData.plugins.map(expand);\n\t\t\t}\n\n\t\t\treturn configData;\n\t\t},\n\n\t\tresolvePlugin(id: string, options: ResolverOptions): Promise<Plugin | null> {\n\t\t\treturn internalImport<Plugin>(id, rootDir, options);\n\t\t},\n\n\t\tasync resolveTransformer(id: string, options: ResolverOptions): Promise<Transformer | null> {\n\t\t\tconst mod = await internalImport<Transformer | Plugin>(id, rootDir, options);\n\t\t\tif (!mod) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isTransformer(mod)) {\n\t\t\t\treturn mod;\n\t\t\t}\n\n\t\t\t/* this is not a proper transformer, is it a plugin exposing a transformer? */\n\t\t\tif (mod.transformer) {\n\t\t\t\tthrow new ConfigError(\n\t\t\t\t\t`Module \"${id}\" is not a valid transformer. This looks like a plugin, did you forget to load the plugin first?`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new ConfigError(`Module \"${id}\" is not a valid transformer.`);\n\t\t},\n\t};\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Config } from \"../config\";\nimport { type ConfigData } from \"../config-data\";\nimport { ConfigLoader } from \"../config-loader\";\nimport { type ResolvedConfig } from \"../resolved-config\";\nimport { type Resolver } from \"../resolver\";\nimport { type FSLike, esmResolver } from \"../resolver/nodejs\";\nimport { isThenable } from \"../../utils\";\n\n/**\n * Options for [[FileSystemConfigLoader]].\n *\n * @public\n */\nexport interface FileSystemConfigLoaderOptions {\n\t/** An implementation of `fs` as needed by [[FileSystemConfigLoader]] */\n\tfs: FSLike;\n}\n\n/**\n * @internal\n */\nfunction findConfigurationFiles(fs: FSLike, directory: string): string[] {\n\treturn [\"json\", \"mjs\", \"cjs\", \"js\"]\n\t\t.map((extension) => path.join(directory, `.htmlvalidate.${extension}`))\n\t\t.filter((filePath) => fs.existsSync(filePath));\n}\n\nconst defaultResolvers: Resolver[] = [esmResolver()];\n\ntype ConstructorParametersDefault = [ConfigData?, Partial<FileSystemConfigLoaderOptions>?];\ntype ConstructorParametersResolver = [\n\tResolver[],\n\tConfigData?,\n\tPartial<FileSystemConfigLoaderOptions>?,\n];\ntype ConstructorParameters = ConstructorParametersDefault | ConstructorParametersResolver;\n\nfunction hasResolver(value: ConstructorParameters): value is ConstructorParametersResolver {\n\treturn Array.isArray(value[0]);\n}\n\n/**\n * Loads configuration by traversing filesystem.\n *\n * Configuration is read from three sources and in the following order:\n *\n * 1. Global configuration passed to constructor.\n * 2. Configuration files found when traversing the directory structure.\n * 3. Override passed to this function.\n *\n * The following configuration filenames are searched:\n *\n * - `.htmlvalidate.json`\n * - `.htmlvalidate.js`\n * - `.htmlvalidate.cjs`\n * - `.htmlvalidate.mjs`\n *\n * Global configuration is used when no configuration file is found. The\n * result is always merged with override if present.\n *\n * The `root` property set to `true` affects the configuration as following:\n *\n * 1. If set in override the override is returned as-is.\n * 2. If set in the global config the override is merged into global and\n * returned. No configuration files are searched.\n * 3. Setting `root` in configuration file only stops directory traversal.\n *\n * @public\n */\nexport class FileSystemConfigLoader extends ConfigLoader {\n\tprotected cache: Map<string, Config | null>;\n\tprivate fs: FSLike;\n\n\t/**\n\t * Create a filesystem configuration loader with default resolvers.\n\t *\n\t * @param fs - `fs` implementation,\n\t * @param config - Global configuration.\n\t * @param configFactory - Optional configuration factory.\n\t */\n\tpublic constructor(config?: ConfigData, options?: Partial<FileSystemConfigLoaderOptions>);\n\n\t/**\n\t * Create a filesystem configuration loader with custom resolvers.\n\t *\n\t * @param fs - `fs` implementation,\n\t * @param resolvers - Resolvers to use.\n\t * @param config - Global configuration.\n\t * @param configFactory - Optional configuration factory.\n\t */\n\tpublic constructor(\n\t\tresolvers: Resolver[],\n\t\tconfig?: ConfigData,\n\t\toptions?: Partial<FileSystemConfigLoaderOptions>,\n\t);\n\n\tpublic constructor(...args: ConstructorParameters) {\n\t\tif (hasResolver(args)) {\n\t\t\t/* istanbul ignore next */\n\t\t\tconst [resolvers, config, options = {}] = args;\n\t\t\tsuper(resolvers, config);\n\t\t\tthis.fs = /* istanbul ignore next */ options.fs ?? fs;\n\t\t} else {\n\t\t\t/* istanbul ignore next */\n\t\t\tconst [config, options = {}] = args;\n\t\t\tsuper(defaultResolvers, config);\n\t\t\tthis.fs = /* istanbul ignore next */ options.fs ?? fs;\n\t\t}\n\t\tthis.cache = new Map();\n\t}\n\n\t/**\n\t * Get configuration for given filename.\n\t *\n\t * @param filename - Filename to get configuration for.\n\t * @param configOverride - Configuration to merge final result with.\n\t */\n\tpublic override getConfigFor(\n\t\tfilename: string,\n\t\tconfigOverride?: ConfigData,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\tconst override = this.loadFromObject(configOverride ?? {});\n\t\tif (isThenable(override)) {\n\t\t\treturn override.then((override) => {\n\t\t\t\treturn this._resolveAsync(filename, override);\n\t\t\t});\n\t\t} else {\n\t\t\treturn this._resolveSync1(filename, override);\n\t\t}\n\t}\n\n\t/**\n\t * Flush configuration cache.\n\t *\n\t * @param filename - If given only the cache for that file is flushed.\n\t */\n\tpublic override flushCache(filename?: string): void {\n\t\tif (filename) {\n\t\t\tthis.cache.delete(filename);\n\t\t} else {\n\t\t\tthis.cache.clear();\n\t\t}\n\t}\n\n\t/**\n\t * Load raw configuration from directory traversal.\n\t *\n\t * This configuration is not merged with global configuration and may return\n\t * `null` if no configuration files are found.\n\t */\n\tpublic fromFilename(filename: string): Config | Promise<Config | null> | null {\n\t\tif (filename === \"inline\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst cache = this.cache.get(filename);\n\t\tif (cache) {\n\t\t\treturn cache;\n\t\t}\n\n\t\tlet found = false;\n\t\tlet current = path.resolve(path.dirname(filename));\n\t\tlet config = this.empty();\n\n\t\t// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition -- it will break out when filesystem is traversed\n\t\twhile (true) {\n\t\t\t/* search configuration files in current directory */\n\t\t\tfor (const configFile of findConfigurationFiles(this.fs, current)) {\n\t\t\t\tconst local = this.loadFromFile(configFile);\n\n\t\t\t\t/* if the loader returns an async config we exit out of the synchronous\n\t\t\t\t * processing and enter the async method so we can resolve any promises\n\t\t\t\t * as we go */\n\t\t\t\tif (isThenable(local)) {\n\t\t\t\t\treturn this.fromFilenameAsync(filename);\n\t\t\t\t}\n\n\t\t\t\tfound = true;\n\n\t\t\t\tconst merged = local.merge(this.resolvers, config);\n\n\t\t\t\t/* istanbul ignore if -- should never happen */\n\t\t\t\tif (isThenable(merged)) {\n\t\t\t\t\tthrow new Error(\"internal error: async result ended up in sync path\");\n\t\t\t\t}\n\t\t\t\tconfig = merged;\n\t\t\t}\n\n\t\t\t/* stop if a configuration with \"root\" is set to true */\n\t\t\tif (config.isRootFound()) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* get the parent directory */\n\t\t\tconst child = current;\n\t\t\tcurrent = path.dirname(current);\n\n\t\t\t/* stop if this is the root directory */\n\t\t\tif (current === child) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* no config was found by loader, return null and let caller decide what to do */\n\t\tif (!found) {\n\t\t\tthis.cache.set(filename, null);\n\t\t\treturn null;\n\t\t}\n\n\t\tthis.cache.set(filename, config);\n\t\treturn config;\n\t}\n\n\t/**\n\t * Async version of [[fromFilename]].\n\t *\n\t * @internal\n\t */\n\tpublic async fromFilenameAsync(filename: string): Promise<Config | null> {\n\t\tif (filename === \"inline\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst cache = this.cache.get(filename);\n\t\tif (cache) {\n\t\t\treturn cache;\n\t\t}\n\n\t\tlet found = false;\n\t\tlet current = path.resolve(path.dirname(filename));\n\t\tlet config = this.empty();\n\n\t\t// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition -- it will break out when filesystem is traversed\n\t\twhile (true) {\n\t\t\t/* search configuration files in current directory */\n\t\t\tfor (const configFile of findConfigurationFiles(this.fs, current)) {\n\t\t\t\tconst local = await this.loadFromFile(configFile);\n\t\t\t\tfound = true;\n\t\t\t\tconfig = await local.merge(this.resolvers, config);\n\t\t\t}\n\n\t\t\t/* stop if a configuration with \"root\" is set to true */\n\t\t\tif (config.isRootFound()) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* get the parent directory */\n\t\t\tconst child = current;\n\t\t\tcurrent = path.dirname(current);\n\n\t\t\t/* stop if this is the root directory */\n\t\t\tif (current === child) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* no config was found by loader, return null and let caller decide what to do */\n\t\tif (!found) {\n\t\t\tthis.cache.set(filename, null);\n\t\t\treturn null;\n\t\t}\n\n\t\tthis.cache.set(filename, config);\n\t\treturn config;\n\t}\n\n\tprivate _merge(\n\t\tglobalConfig: Config,\n\t\toverride: Config,\n\t\tconfig: Config | null,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\tconst merged = config\n\t\t\t? config.merge(this.resolvers, override)\n\t\t\t: globalConfig.merge(this.resolvers, override);\n\t\t/* istanbul ignore if -- covered by tsc, hard to recreate even with very specific testcases */\n\t\tif (isThenable(merged)) {\n\t\t\treturn merged.then((merged) => {\n\t\t\t\treturn merged.resolve();\n\t\t\t});\n\t\t} else {\n\t\t\treturn merged.resolve();\n\t\t}\n\t}\n\n\tprivate _resolveSync1(\n\t\tfilename: string,\n\t\toverride: Config,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\tif (override.isRootFound()) {\n\t\t\treturn override.resolve();\n\t\t}\n\n\t\tconst globalConfig = this.getGlobalConfig();\n\t\t/* istanbul ignore if -- covered by tsc, hard to recreate even with very specific testcases */\n\t\tif (isThenable(globalConfig)) {\n\t\t\treturn globalConfig.then((globalConfig) => {\n\t\t\t\treturn this._resolveSync2(filename, override, globalConfig);\n\t\t\t});\n\t\t} else {\n\t\t\treturn this._resolveSync2(filename, override, globalConfig);\n\t\t}\n\t}\n\n\tprivate _resolveSync2(\n\t\tfilename: string,\n\t\toverride: Config,\n\t\tglobalConfig: Config,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\t/* special case when the global configuration is marked as root, should not\n\t\t * try to load and more configuration files */\n\t\tif (globalConfig.isRootFound()) {\n\t\t\tconst merged = globalConfig.merge(this.resolvers, override);\n\t\t\t/* istanbul ignore if -- covered by tsc, hard to recreate even with very specific testcases */\n\t\t\tif (isThenable(merged)) {\n\t\t\t\treturn merged.then((merged) => {\n\t\t\t\t\treturn merged.resolve();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn merged.resolve();\n\t\t\t}\n\t\t}\n\n\t\tconst config = this.fromFilename(filename);\n\t\tif (isThenable(config)) {\n\t\t\treturn config.then((config) => {\n\t\t\t\treturn this._merge(globalConfig, override, config);\n\t\t\t});\n\t\t} else {\n\t\t\treturn this._merge(globalConfig, override, config);\n\t\t}\n\t}\n\n\tprivate async _resolveAsync(filename: string, override: Config): Promise<ResolvedConfig> {\n\t\tif (override.isRootFound()) {\n\t\t\treturn override.resolve();\n\t\t}\n\n\t\tconst globalConfig = await this.getGlobalConfig();\n\n\t\t/* special case when the global configuration is marked as root, should not\n\t\t * try to load and more configuration files */\n\t\tif (globalConfig.isRootFound()) {\n\t\t\tconst merged = await globalConfig.merge(this.resolvers, override);\n\t\t\treturn merged.resolve();\n\t\t}\n\n\t\tconst config = await this.fromFilenameAsync(filename);\n\t\treturn this._merge(globalConfig, override, config);\n\t}\n\n\t/**\n\t * @internal For testing only\n\t */\n\tpublic _getInternalCache(): Map<string, Config | null> {\n\t\treturn this.cache;\n\t}\n\n\tprotected defaultConfig(): Config | Promise<Config> {\n\t\treturn Config.defaultConfig();\n\t}\n}\n","import kleur from \"kleur\";\nimport { version } from \"../generated/package\";\nimport { type CompatibilityOptions, compatibilityCheckImpl } from \"./compatibility-check\";\n\nconst defaults: CompatibilityOptions = {\n\tsilent: false,\n\tversion,\n\tlogger(text: string): void {\n\t\t/* eslint-disable-next-line no-console -- expected to log */\n\t\tconsole.error(kleur.red(text));\n\t},\n};\n\n/**\n * Tests if plugin is compatible with html-validate library. Unless the `silent`\n * option is used a warning is displayed on the console.\n *\n * @public\n * @since v5.0.0\n * @param name - Name of plugin\n * @param declared - What library versions the plugin support (e.g. declared peerDependencies)\n * @returns - `true` if version is compatible\n */\nexport function compatibilityCheck(\n\tname: string,\n\tdeclared: string,\n\toptions?: Partial<CompatibilityOptions>,\n): boolean {\n\treturn compatibilityCheckImpl(name, declared, {\n\t\t...defaults,\n\t\t...options,\n\t});\n}\n"],"names":["fs","isTransformer","options","override","merged","globalConfig","config"],"mappings":";;;;;;;;AAGgB,SAAA,eAAA,CAAgB,SAAyB,QAA2B,EAAA;AACnF,EAAM,MAAA,QAAA,GAAW,OAAQ,CAAA,OAAA,CAAQ,QAAQ,CAAA;AAGzC,EAAM,MAAA,CAAA,GAAI,OAAQ,CAAA,KAAA,CAAM,QAAQ,CAAA;AAChC,EAAA,IAAI,GAAG,MAAQ,EAAA;AACd,IAAM,MAAA,EAAE,QAAW,GAAA,CAAA;AACnB,IAAA,KAAA,IAAS,IAAI,MAAO,CAAA,QAAA,CAAS,SAAS,CAAG,EAAA,CAAA,IAAK,GAAG,CAAK,EAAA,EAAA;AACrD,MAAA,IAAI,MAAO,CAAA,QAAA,CAAS,CAAC,CAAA,CAAE,OAAO,QAAU,EAAA;AACvC,QAAO,MAAA,CAAA,QAAA,CAAS,MAAO,CAAA,CAAA,EAAG,CAAC,CAAA;AAAA;AAC5B;AACD;AAKD,EAAO,OAAA,OAAA,CAAQ,MAAM,QAAQ,CAAA;AAG7B,EAAA,OAAO,QAAQ,QAAQ,CAAA;AACxB;;;;;;;ACpBA,IAAI,aAA+B,GAAA,IAAA;AASnB,SAAA,oBAAA,CAAqB,QAAgBA,GAAoB,EAAA;AAExE,EAAA,IAAI,OAAU,GAAA,MAAA;AAGd,EAAA,OAAO,IAAM,EAAA;AACZ,IAAA,MAAM,MAAS,GAAA,IAAA,CAAK,IAAK,CAAA,OAAA,EAAS,cAAc,CAAA;AAChD,IAAIA,IAAAA,GAAAA,CAAG,UAAW,CAAA,MAAM,CAAG,EAAA;AAC1B,MAAO,OAAA,OAAA;AAAA;AAIR,IAAA,MAAM,KAAQ,GAAA,OAAA;AACd,IAAU,OAAA,GAAA,IAAA,CAAK,QAAQ,OAAO,CAAA;AAG9B,IAAA,IAAI,YAAY,KAAO,EAAA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AM,QAAiC,GAAA;AAAA,EACtC,MAAQ,EAAA,KAAA;AAAA,EACR,OAAA;AAAA,EACA,OAAO,IAAoB,EAAA;AAE1B,IAAA,OAAA,CAAQ,KAAM,CAAA,KAAA,CAAM,GAAI,CAAA,IAAI,CAAC,CAAA;AAAA;AAE/B,CAAA;AAYgB,SAAA,kBAAA,CACf,IACA,EAAA,QAAA,EACA,OACU,EAAA;AACV,EAAO,OAAA,sBAAA,CAAuB,MAAM,QAAU,EAAA;AAAA,IAC7C,GAAG,QAAA;AAAA,IACH,GAAG;AAAA,GACH,CAAA;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"core-nodejs.js","sources":["../../src/utils/require-uncached.ts","../../src/config/resolver/nodejs/determine-root-dir.ts","../../src/config/resolver/nodejs/expand-relative-path.ts","../../src/config/resolver/nodejs/cjs-resolver.ts","../../src/config/resolver/nodejs/import-function.ts","../../src/config/resolver/nodejs/internal-import.ts","../../src/config/resolver/nodejs/esm-resolver.ts","../../src/config/loaders/file-system.ts","../../src/utils/compatibility-check.nodejs.ts"],"sourcesContent":["/**\n * Similar to `require(..)` but removes the cached copy first.\n */\nexport function requireUncached(require: NodeJS.Require, moduleId: string): unknown {\n\tconst filename = require.resolve(moduleId);\n\n\t/* remove references from the parent module to prevent memory leak */\n\tconst m = require.cache[filename];\n\tif (m?.parent) {\n\t\tconst { parent } = m;\n\t\tfor (let i = parent.children.length - 1; i >= 0; i--) {\n\t\t\tif (parent.children[i].id === filename) {\n\t\t\t\tparent.children.splice(i, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* remove old module from cache */\n\t/* eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- needed to perform its function */\n\tdelete require.cache[filename];\n\n\t/* eslint-disable-next-line import/no-dynamic-require, security/detect-non-literal-require -- as expected but should be moved to upcoming resolver class */\n\treturn require(filename);\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nlet cachedRootDir: string | null = null;\n\ninterface FSLike {\n\texistsSync(path: string): boolean;\n}\n\n/**\n * @internal\n */\nexport function determineRootDirImpl(intial: string, fs: FSLike): string {\n\t/* try to locate package.json */\n\tlet current = intial;\n\n\t// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition -- break outs when filesystem is traversed\n\twhile (true) {\n\t\tconst search = path.join(current, \"package.json\");\n\t\tif (fs.existsSync(search)) {\n\t\t\treturn current;\n\t\t}\n\n\t\t/* get the parent directory */\n\t\tconst child = current;\n\t\tcurrent = path.dirname(current);\n\n\t\t/* stop if this is the root directory */\n\t\tif (current === child) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* default to working directory if no package.json is found */\n\treturn intial;\n}\n\n/**\n * Try to determine root directory based on the location of the closest\n * `package.json`. Fallbacks on `process.cwd()` if no package.json was found.\n *\n * @internal\n */\n/* istanbul ignore next: cached version of determineRootDirImpl, no need to test */\nexport function determineRootDir(): string {\n\tif (cachedRootDir === null) {\n\t\tcachedRootDir = determineRootDirImpl(process.cwd(), fs);\n\t}\n\treturn cachedRootDir;\n}\n","import path from \"node:path\";\n\n/**\n * @internal\n */\nexport function expandRelativePath<T>(value: string | T, { cwd }: { cwd: string }): string | T {\n\tif (typeof value === \"string\" && value.startsWith(\".\")) {\n\t\treturn path.normalize(path.join(cwd, value));\n\t} else {\n\t\treturn value;\n\t}\n}\n","import path from \"node:path\";\nimport { type MetaDataTable } from \"../../../meta\";\nimport { type Plugin } from \"../../../plugin\";\nimport { legacyRequire } from \"../../../resolve\";\nimport { type Transformer } from \"../../../transform\";\nimport { requireUncached } from \"../../../utils\";\nimport { type ConfigData } from \"../../config-data\";\nimport { ConfigError } from \"../../error\";\nimport { type Resolver, type ResolverOptions } from \"../resolver\";\nimport { determineRootDir } from \"./determine-root-dir\";\nimport { expandRelativePath } from \"./expand-relative-path\";\n\n/**\n * @internal\n */\nexport interface RequireError extends Error {\n\tcode: string;\n}\n\nfunction isRequireError(error: unknown): error is RequireError {\n\treturn Boolean(error && typeof error === \"object\" && \"code\" in error);\n}\n\nfunction isTransformer(value: Transformer | Plugin): value is Transformer {\n\treturn typeof value === \"function\";\n}\n\n/**\n * CommonJS resolver.\n *\n * @public\n * @since 8.8.0\n */\nexport type CommonJSResolver = Required<Resolver>;\n\n/**\n * CommonJS resolver.\n *\n * @public\n * @deprecated Deprecated alias for [[CommonJSResolver]].\n * @since 8.0.0\n */\nexport type NodeJSResolver = Required<Resolver>;\n\n/**\n * Create a new resolver for NodeJS packages using `require(..)`.\n *\n * If the module name contains `<rootDir>` (e.g. `<rootDir/foo`) it will be\n * expanded relative to the root directory either explicitly set by the\n * `rootDir` parameter or determined automatically by the closest `package.json`\n * file (starting at the current working directory).\n *\n * @public\n * @since 8.8.0\n */\nexport function cjsResolver(options: { rootDir?: string } = {}): CommonJSResolver {\n\tconst rootDir = options.rootDir ?? determineRootDir();\n\n\tfunction internalRequire<T = unknown>(id: string, { cache }: ResolverOptions): T | null {\n\t\tconst moduleName = id.replace(\"<rootDir>\", rootDir);\n\t\ttry {\n\t\t\t/* istanbul ignore else: the tests only runs the cached versions to get\n\t\t\t * unmodified access to `require`, the implementation of `requireUncached`\n\t\t\t * is assumed to be tested elsewhere */\n\t\t\tif (cache) {\n\t\t\t\treturn legacyRequire(moduleName) as T;\n\t\t\t} else {\n\t\t\t\treturn requireUncached(legacyRequire, moduleName) as T;\n\t\t\t}\n\t\t} catch (err: unknown) {\n\t\t\tif (isRequireError(err) && err.code === \"MODULE_NOT_FOUND\") {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\treturn {\n\t\tname: \"nodejs-resolver\",\n\n\t\tresolveElements(id: string, options: ResolverOptions): MetaDataTable | null {\n\t\t\treturn internalRequire(id, options);\n\t\t},\n\n\t\tresolveConfig(id: string, options: ResolverOptions): ConfigData | null {\n\t\t\tconst configData = internalRequire<ConfigData>(id, options);\n\t\t\tif (!configData) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t/* expand any relative paths */\n\t\t\tconst cwd = path.dirname(id);\n\t\t\tconst expand = <T>(value: string | T): string | T => expandRelativePath(value, { cwd });\n\n\t\t\tif (Array.isArray(configData.elements)) {\n\t\t\t\tconfigData.elements = configData.elements.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.extends)) {\n\t\t\t\tconfigData.extends = configData.extends.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.plugins)) {\n\t\t\t\tconfigData.plugins = configData.plugins.map(expand);\n\t\t\t}\n\n\t\t\treturn configData;\n\t\t},\n\n\t\tresolvePlugin(id: string, options: ResolverOptions): Plugin | null {\n\t\t\treturn internalRequire<Plugin>(id, options);\n\t\t},\n\n\t\tresolveTransformer(id: string, options: ResolverOptions): Transformer | null {\n\t\t\tconst mod = internalRequire<Transformer | Plugin>(id, options);\n\t\t\tif (!mod) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isTransformer(mod)) {\n\t\t\t\treturn mod;\n\t\t\t}\n\n\t\t\t/* this is not a proper transformer, is it a plugin exposing a transformer? */\n\t\t\tif (mod.transformer) {\n\t\t\t\tthrow new ConfigError(\n\t\t\t\t\t`Module \"${id}\" is not a valid transformer. This looks like a plugin, did you forget to load the plugin first?`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new ConfigError(`Module \"${id}\" is not a valid transformer.`);\n\t\t},\n\t};\n}\n\n/**\n * Create a new resolver for NodeJS packages using `require(..)`.\n *\n * If the module name contains `<rootDir>` (e.g. `<rootDir/foo`) it will be\n * expanded relative to the root directory either explicitly set by the\n * `rootDir` parameter or determined automatically by the closest `package.json`\n * file (starting at the current working directory).\n *\n * @public\n * @deprecated Deprecated alias for [[commonjsResolver]].\n * @since 8.0.0\n */\n/* istanbul ignore next -- deprecated alias */\nexport function nodejsResolver(options: { rootDir?: string } = {}): NodeJSResolver {\n\treturn cjsResolver(options);\n}\n","/* istanbul ignore file: this file is only for easier mocking */\n\n/**\n * Wrapper around import() so we can mock it in unittests.\n *\n * @internal\n */\nexport function importFunction(id: string): unknown {\n\treturn import(id);\n}\n","import fs from \"node:fs/promises\";\nimport { importResolve } from \"../../../resolve\";\nimport { UserError } from \"../../../error\";\nimport { type ResolverOptions } from \"../resolver\";\nimport { importFunction } from \"./import-function\";\n\n/**\n * @internal\n */\nexport interface ImportError extends Error {\n\tcode: string;\n\trequireStack?: string[];\n}\n\nasync function getModuleName(\n\tid: string,\n\t{ cache, rootDir }: { cache: boolean; rootDir: string },\n): Promise<URL> {\n\tconst moduleName = id.replace(\"<rootDir>\", rootDir);\n\tconst url = importResolve(moduleName);\n\n\tif (url.protocol !== \"file:\") {\n\t\treturn url;\n\t}\n\n\t/* istanbul ignore else: the tests only runs the cached versions */\n\tif (cache) {\n\t\treturn url;\n\t} else {\n\t\t/* Cachebusting in ESM is tricky, we cannot flush the cache of the old import\n\t\t * but a common workaround is to append ?something to the path. It only works\n\t\t * with absolute paths though so we must first use `import.meta.resolve(..)`\n\t\t * which doesn't play nice with CJS. Then we will leak memory each time a\n\t\t * fresh copy is loaded and there doesn't seem to be a way to deal with this\n\t\t * yet. We use the file mtime to at least try to retain the copy as long as\n\t\t * possible but this will fail for transitive imports but at least with\n\t\t * directly loaded configurations it would reload property. */\n\t\tconst stat = await fs.stat(url);\n\t\turl.searchParams.append(\"mtime\", String(stat.mtime.getTime()));\n\t\treturn url;\n\t}\n}\n\nfunction isImportError(error: unknown): error is ImportError {\n\treturn Boolean(error && typeof error === \"object\" && \"code\" in error);\n}\n\n/**\n * @internal\n */\nexport async function internalImport<T = unknown>(\n\tid: string,\n\trootDir: string,\n\t{ cache }: ResolverOptions,\n): Promise<T | null> {\n\t/* this is a workaround for rollup which mangles import attributes so we\n\t * cannot use `import(.., { with: { type: \"json\" } })` to import a json\n\t * file. */\n\t/* istanbul ignore if: workaround, not tested, should be removed if the compiler bug is fixed */\n\tif (id.endsWith(\".json\")) {\n\t\tconst content = await fs.readFile(id, \"utf-8\");\n\t\treturn JSON.parse(content) as T;\n\t}\n\n\ttry {\n\t\tconst url = await getModuleName(id, { cache, rootDir });\n\t\tif (url.protocol !== \"file:\") {\n\t\t\treturn null;\n\t\t}\n\t\tconst moduleName = url.toString();\n\t\tconst { default: defaultImport } = (await importFunction(moduleName)) as { default: T };\n\t\tif (!defaultImport) {\n\t\t\tthrow new UserError(`\"${id}\" does not have a default export`);\n\t\t}\n\t\treturn defaultImport;\n\t} catch (err: unknown) {\n\t\tif (isImportError(err) && err.code === \"MODULE_NOT_FOUND\" && !err.requireStack) {\n\t\t\treturn null;\n\t\t}\n\t\tthrow err;\n\t}\n}\n","import path from \"node:path\";\nimport { type MetaDataTable } from \"../../../meta\";\nimport { type Plugin } from \"../../../plugin\";\nimport { type Transformer } from \"../../../transform\";\nimport { type ConfigData } from \"../../config-data\";\nimport { ConfigError } from \"../../error\";\nimport { type Resolver, type ResolverOptions } from \"../resolver\";\nimport { determineRootDir } from \"./determine-root-dir\";\nimport { expandRelativePath } from \"./expand-relative-path\";\nimport { internalImport } from \"./internal-import\";\n\nfunction isTransformer(value: Transformer | Plugin): value is Transformer {\n\treturn typeof value === \"function\";\n}\n\n/**\n * ESM resolver.\n *\n * @public\n * @since 9.0.0\n */\nexport type ESMResolver = Required<Resolver>;\n\n/**\n * Create a new resolver for NodeJS packages using `import(..)`.\n *\n * If the module name contains `<rootDir>` (e.g. `<rootDir/foo`) it will be\n * expanded relative to the root directory either explicitly set by the\n * `rootDir` parameter or determined automatically by the closest `package.json`\n * file (starting at the current working directory).\n *\n * @public\n * @since 9.0.0\n */\nexport function esmResolver(options: { rootDir?: string } = {}): ESMResolver {\n\tconst rootDir = options.rootDir ?? determineRootDir();\n\n\treturn {\n\t\tname: \"esm-resolver\",\n\n\t\tresolveElements(id: string, options: ResolverOptions): Promise<MetaDataTable | null> {\n\t\t\treturn internalImport(id, rootDir, options);\n\t\t},\n\n\t\tasync resolveConfig(id: string, options: ResolverOptions): Promise<ConfigData | null> {\n\t\t\tconst configData = await internalImport<ConfigData>(id, rootDir, options);\n\t\t\tif (!configData) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t/* expand any relative paths */\n\t\t\tconst cwd = path.dirname(id);\n\t\t\tconst expand = <T>(value: string | T): string | T => expandRelativePath(value, { cwd });\n\n\t\t\tif (Array.isArray(configData.elements)) {\n\t\t\t\tconfigData.elements = configData.elements.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.extends)) {\n\t\t\t\tconfigData.extends = configData.extends.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.plugins)) {\n\t\t\t\tconfigData.plugins = configData.plugins.map(expand);\n\t\t\t}\n\n\t\t\treturn configData;\n\t\t},\n\n\t\tresolvePlugin(id: string, options: ResolverOptions): Promise<Plugin | null> {\n\t\t\treturn internalImport<Plugin>(id, rootDir, options);\n\t\t},\n\n\t\tasync resolveTransformer(id: string, options: ResolverOptions): Promise<Transformer | null> {\n\t\t\tconst mod = await internalImport<Transformer | Plugin>(id, rootDir, options);\n\t\t\tif (!mod) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isTransformer(mod)) {\n\t\t\t\treturn mod;\n\t\t\t}\n\n\t\t\t/* this is not a proper transformer, is it a plugin exposing a transformer? */\n\t\t\tif (mod.transformer) {\n\t\t\t\tthrow new ConfigError(\n\t\t\t\t\t`Module \"${id}\" is not a valid transformer. This looks like a plugin, did you forget to load the plugin first?`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new ConfigError(`Module \"${id}\" is not a valid transformer.`);\n\t\t},\n\t};\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Config } from \"../config\";\nimport { type ConfigData } from \"../config-data\";\nimport { ConfigLoader } from \"../config-loader\";\nimport { type ResolvedConfig } from \"../resolved-config\";\nimport { type Resolver } from \"../resolver\";\nimport { type FSLike, esmResolver } from \"../resolver/nodejs\";\nimport { isThenable } from \"../../utils\";\n\n/**\n * Options for [[FileSystemConfigLoader]].\n *\n * @public\n */\nexport interface FileSystemConfigLoaderOptions {\n\t/** An implementation of `fs` as needed by [[FileSystemConfigLoader]] */\n\tfs: FSLike;\n}\n\n/**\n * @internal\n */\nfunction findConfigurationFiles(fs: FSLike, directory: string): string[] {\n\treturn [\"json\", \"mjs\", \"cjs\", \"js\"]\n\t\t.map((extension) => path.join(directory, `.htmlvalidate.${extension}`))\n\t\t.filter((filePath) => fs.existsSync(filePath));\n}\n\nconst defaultResolvers: Resolver[] = [esmResolver()];\n\ntype ConstructorParametersDefault = [ConfigData?, Partial<FileSystemConfigLoaderOptions>?];\ntype ConstructorParametersResolver = [\n\tResolver[],\n\tConfigData?,\n\tPartial<FileSystemConfigLoaderOptions>?,\n];\ntype ConstructorParameters = ConstructorParametersDefault | ConstructorParametersResolver;\n\nfunction hasResolver(value: ConstructorParameters): value is ConstructorParametersResolver {\n\treturn Array.isArray(value[0]);\n}\n\n/**\n * Loads configuration by traversing filesystem.\n *\n * Configuration is read from three sources and in the following order:\n *\n * 1. Global configuration passed to constructor.\n * 2. Configuration files found when traversing the directory structure.\n * 3. Override passed to this function.\n *\n * The following configuration filenames are searched:\n *\n * - `.htmlvalidate.json`\n * - `.htmlvalidate.js`\n * - `.htmlvalidate.cjs`\n * - `.htmlvalidate.mjs`\n *\n * Global configuration is used when no configuration file is found. The\n * result is always merged with override if present.\n *\n * The `root` property set to `true` affects the configuration as following:\n *\n * 1. If set in override the override is returned as-is.\n * 2. If set in the global config the override is merged into global and\n * returned. No configuration files are searched.\n * 3. Setting `root` in configuration file only stops directory traversal.\n *\n * @public\n */\nexport class FileSystemConfigLoader extends ConfigLoader {\n\tprotected cache: Map<string, Config | null>;\n\tprivate fs: FSLike;\n\n\t/**\n\t * Create a filesystem configuration loader with default resolvers.\n\t *\n\t * @param fs - `fs` implementation,\n\t * @param config - Global configuration.\n\t * @param configFactory - Optional configuration factory.\n\t */\n\tpublic constructor(config?: ConfigData, options?: Partial<FileSystemConfigLoaderOptions>);\n\n\t/**\n\t * Create a filesystem configuration loader with custom resolvers.\n\t *\n\t * @param fs - `fs` implementation,\n\t * @param resolvers - Resolvers to use.\n\t * @param config - Global configuration.\n\t * @param configFactory - Optional configuration factory.\n\t */\n\tpublic constructor(\n\t\tresolvers: Resolver[],\n\t\tconfig?: ConfigData,\n\t\toptions?: Partial<FileSystemConfigLoaderOptions>,\n\t);\n\n\tpublic constructor(...args: ConstructorParameters) {\n\t\tif (hasResolver(args)) {\n\t\t\t/* istanbul ignore next */\n\t\t\tconst [resolvers, config, options = {}] = args;\n\t\t\tsuper(resolvers, config);\n\t\t\tthis.fs = /* istanbul ignore next */ options.fs ?? fs;\n\t\t} else {\n\t\t\t/* istanbul ignore next */\n\t\t\tconst [config, options = {}] = args;\n\t\t\tsuper(defaultResolvers, config);\n\t\t\tthis.fs = /* istanbul ignore next */ options.fs ?? fs;\n\t\t}\n\t\tthis.cache = new Map();\n\t}\n\n\t/**\n\t * Get configuration for given filename.\n\t *\n\t * @param filename - Filename to get configuration for.\n\t * @param configOverride - Configuration to merge final result with.\n\t */\n\tpublic override getConfigFor(\n\t\tfilename: string,\n\t\tconfigOverride?: ConfigData,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\tconst override = this.loadFromObject(configOverride ?? {});\n\t\tif (isThenable(override)) {\n\t\t\treturn override.then((override) => {\n\t\t\t\treturn this._resolveAsync(filename, override);\n\t\t\t});\n\t\t} else {\n\t\t\treturn this._resolveSync1(filename, override);\n\t\t}\n\t}\n\n\t/**\n\t * Flush configuration cache.\n\t *\n\t * @param filename - If given only the cache for that file is flushed.\n\t */\n\tpublic override flushCache(filename?: string): void {\n\t\tif (filename) {\n\t\t\tthis.cache.delete(filename);\n\t\t} else {\n\t\t\tthis.cache.clear();\n\t\t}\n\t}\n\n\t/**\n\t * Load raw configuration from directory traversal.\n\t *\n\t * This configuration is not merged with global configuration and may return\n\t * `null` if no configuration files are found.\n\t */\n\tpublic fromFilename(filename: string): Config | Promise<Config | null> | null {\n\t\tif (filename === \"inline\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst cache = this.cache.get(filename);\n\t\tif (cache) {\n\t\t\treturn cache;\n\t\t}\n\n\t\tlet found = false;\n\t\tlet current = path.resolve(path.dirname(filename));\n\t\tlet config = this.empty();\n\n\t\t// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition -- it will break out when filesystem is traversed\n\t\twhile (true) {\n\t\t\t/* search configuration files in current directory */\n\t\t\tfor (const configFile of findConfigurationFiles(this.fs, current)) {\n\t\t\t\tconst local = this.loadFromFile(configFile);\n\n\t\t\t\t/* if the loader returns an async config we exit out of the synchronous\n\t\t\t\t * processing and enter the async method so we can resolve any promises\n\t\t\t\t * as we go */\n\t\t\t\tif (isThenable(local)) {\n\t\t\t\t\treturn this.fromFilenameAsync(filename);\n\t\t\t\t}\n\n\t\t\t\tfound = true;\n\n\t\t\t\tconst merged = local.merge(this.resolvers, config);\n\n\t\t\t\t/* istanbul ignore if -- should never happen */\n\t\t\t\tif (isThenable(merged)) {\n\t\t\t\t\tthrow new Error(\"internal error: async result ended up in sync path\");\n\t\t\t\t}\n\t\t\t\tconfig = merged;\n\t\t\t}\n\n\t\t\t/* stop if a configuration with \"root\" is set to true */\n\t\t\tif (config.isRootFound()) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* get the parent directory */\n\t\t\tconst child = current;\n\t\t\tcurrent = path.dirname(current);\n\n\t\t\t/* stop if this is the root directory */\n\t\t\tif (current === child) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* no config was found by loader, return null and let caller decide what to do */\n\t\tif (!found) {\n\t\t\tthis.cache.set(filename, null);\n\t\t\treturn null;\n\t\t}\n\n\t\tthis.cache.set(filename, config);\n\t\treturn config;\n\t}\n\n\t/**\n\t * Async version of [[fromFilename]].\n\t *\n\t * @internal\n\t */\n\tpublic async fromFilenameAsync(filename: string): Promise<Config | null> {\n\t\tif (filename === \"inline\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst cache = this.cache.get(filename);\n\t\tif (cache) {\n\t\t\treturn cache;\n\t\t}\n\n\t\tlet found = false;\n\t\tlet current = path.resolve(path.dirname(filename));\n\t\tlet config = this.empty();\n\n\t\t// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition -- it will break out when filesystem is traversed\n\t\twhile (true) {\n\t\t\t/* search configuration files in current directory */\n\t\t\tfor (const configFile of findConfigurationFiles(this.fs, current)) {\n\t\t\t\tconst local = await this.loadFromFile(configFile);\n\t\t\t\tfound = true;\n\t\t\t\tconfig = await local.merge(this.resolvers, config);\n\t\t\t}\n\n\t\t\t/* stop if a configuration with \"root\" is set to true */\n\t\t\tif (config.isRootFound()) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* get the parent directory */\n\t\t\tconst child = current;\n\t\t\tcurrent = path.dirname(current);\n\n\t\t\t/* stop if this is the root directory */\n\t\t\tif (current === child) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* no config was found by loader, return null and let caller decide what to do */\n\t\tif (!found) {\n\t\t\tthis.cache.set(filename, null);\n\t\t\treturn null;\n\t\t}\n\n\t\tthis.cache.set(filename, config);\n\t\treturn config;\n\t}\n\n\tprivate _merge(\n\t\tglobalConfig: Config,\n\t\toverride: Config,\n\t\tconfig: Config | null,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\tconst merged = config\n\t\t\t? config.merge(this.resolvers, override)\n\t\t\t: globalConfig.merge(this.resolvers, override);\n\t\t/* istanbul ignore if -- covered by tsc, hard to recreate even with very specific testcases */\n\t\tif (isThenable(merged)) {\n\t\t\treturn merged.then((merged) => {\n\t\t\t\treturn merged.resolve();\n\t\t\t});\n\t\t} else {\n\t\t\treturn merged.resolve();\n\t\t}\n\t}\n\n\tprivate _resolveSync1(\n\t\tfilename: string,\n\t\toverride: Config,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\tif (override.isRootFound()) {\n\t\t\treturn override.resolve();\n\t\t}\n\n\t\tconst globalConfig = this.getGlobalConfig();\n\t\t/* istanbul ignore if -- covered by tsc, hard to recreate even with very specific testcases */\n\t\tif (isThenable(globalConfig)) {\n\t\t\treturn globalConfig.then((globalConfig) => {\n\t\t\t\treturn this._resolveSync2(filename, override, globalConfig);\n\t\t\t});\n\t\t} else {\n\t\t\treturn this._resolveSync2(filename, override, globalConfig);\n\t\t}\n\t}\n\n\tprivate _resolveSync2(\n\t\tfilename: string,\n\t\toverride: Config,\n\t\tglobalConfig: Config,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\t/* special case when the global configuration is marked as root, should not\n\t\t * try to load and more configuration files */\n\t\tif (globalConfig.isRootFound()) {\n\t\t\tconst merged = globalConfig.merge(this.resolvers, override);\n\t\t\t/* istanbul ignore if -- covered by tsc, hard to recreate even with very specific testcases */\n\t\t\tif (isThenable(merged)) {\n\t\t\t\treturn merged.then((merged) => {\n\t\t\t\t\treturn merged.resolve();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn merged.resolve();\n\t\t\t}\n\t\t}\n\n\t\tconst config = this.fromFilename(filename);\n\t\tif (isThenable(config)) {\n\t\t\treturn config.then((config) => {\n\t\t\t\treturn this._merge(globalConfig, override, config);\n\t\t\t});\n\t\t} else {\n\t\t\treturn this._merge(globalConfig, override, config);\n\t\t}\n\t}\n\n\tprivate async _resolveAsync(filename: string, override: Config): Promise<ResolvedConfig> {\n\t\tif (override.isRootFound()) {\n\t\t\treturn override.resolve();\n\t\t}\n\n\t\tconst globalConfig = await this.getGlobalConfig();\n\n\t\t/* special case when the global configuration is marked as root, should not\n\t\t * try to load and more configuration files */\n\t\tif (globalConfig.isRootFound()) {\n\t\t\tconst merged = await globalConfig.merge(this.resolvers, override);\n\t\t\treturn merged.resolve();\n\t\t}\n\n\t\tconst config = await this.fromFilenameAsync(filename);\n\t\treturn this._merge(globalConfig, override, config);\n\t}\n\n\t/**\n\t * @internal For testing only\n\t */\n\tpublic _getInternalCache(): Map<string, Config | null> {\n\t\treturn this.cache;\n\t}\n\n\tprotected defaultConfig(): Config | Promise<Config> {\n\t\treturn Config.defaultConfig();\n\t}\n}\n","import kleur from \"kleur\";\nimport { version } from \"../generated/package\";\nimport { type CompatibilityOptions, compatibilityCheckImpl } from \"./compatibility-check\";\n\nconst defaults: CompatibilityOptions = {\n\tsilent: false,\n\tversion,\n\tlogger(text: string): void {\n\t\t/* eslint-disable-next-line no-console -- expected to log */\n\t\tconsole.error(kleur.red(text));\n\t},\n};\n\n/**\n * Tests if plugin is compatible with html-validate library. Unless the `silent`\n * option is used a warning is displayed on the console.\n *\n * @public\n * @since v5.0.0\n * @param name - Name of plugin\n * @param declared - What library versions the plugin support (e.g. declared peerDependencies)\n * @returns - `true` if version is compatible\n */\nexport function compatibilityCheck(\n\tname: string,\n\tdeclared: string,\n\toptions?: Partial<CompatibilityOptions>,\n): boolean {\n\treturn compatibilityCheckImpl(name, declared, {\n\t\t...defaults,\n\t\t...options,\n\t});\n}\n"],"names":["fs","isTransformer","options","override","merged","globalConfig","config"],"mappings":";;;;;;;AAGgB,SAAA,eAAA,CAAgB,SAAyB,QAA2B,EAAA;AACnF,EAAM,MAAA,QAAA,GAAW,OAAQ,CAAA,OAAA,CAAQ,QAAQ,CAAA;AAGzC,EAAM,MAAA,CAAA,GAAI,OAAQ,CAAA,KAAA,CAAM,QAAQ,CAAA;AAChC,EAAA,IAAI,GAAG,MAAQ,EAAA;AACd,IAAM,MAAA,EAAE,QAAW,GAAA,CAAA;AACnB,IAAA,KAAA,IAAS,IAAI,MAAO,CAAA,QAAA,CAAS,SAAS,CAAG,EAAA,CAAA,IAAK,GAAG,CAAK,EAAA,EAAA;AACrD,MAAA,IAAI,MAAO,CAAA,QAAA,CAAS,CAAC,CAAA,CAAE,OAAO,QAAU,EAAA;AACvC,QAAO,MAAA,CAAA,QAAA,CAAS,MAAO,CAAA,CAAA,EAAG,CAAC,CAAA;AAAA;AAC5B;AACD;AAKD,EAAO,OAAA,OAAA,CAAQ,M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AAgB,EAAA;AAIhD,IAAI,IAAA,YAAA,CAAa,aAAe,EAAA;AAC/B,MAAA,MAAM,SAAS,MAAM,YAAA,CAAa,KAAM,CAAA,IAAA,CAAK,WAAW,QAAQ,CAAA;AAChE,MAAA,OAAO,OAAO,OAAQ,EAAA;AAAA;AAGvB,IAAA,MAAM,MAAS,GAAA,MAAM,IAAK,CAAA,iBAAA,CAAkB,QAAQ,CAAA;AACpD,IAAA,OAAO,IAAK,CAAA,MAAA,CAAO,YAAc,EAAA,QAAA,EAAU,MAAM,CAAA;AAAA;AAClD;AAAA;AAAA;AAAA,EAKO,iBAAgD,GAAA;AACtD,IAAA,OAAO,IAAK,CAAA,KAAA;AAAA;AACb,EAEU,aAA0C,GAAA;AACnD,IAAA,OAAO,OAAO,aAAc,EAAA;AAAA;AAE9B;;ACtWA,MAAM,QAAiC,GAAA;AAAA,EACtC,MAAQ,EAAA,KAAA;AAAA,EACR,OAAA;AAAA,EACA,OAAO,IAAoB,EAAA;AAE1B,IAAA,OAAA,CAAQ,KAAM,CAAA,KAAA,CAAM,GAAI,CAAA,IAAI,CAAC,CAAA;AAAA;AAE/B,CAAA;AAYgB,SAAA,kBAAA,CACf,IACA,EAAA,QAAA,EACA,OACU,EAAA;AACV,EAAO,OAAA,sBAAA,CAAuB,MAAM,QAAU,EAAA;AAAA,IAC7C,GAAG,QAAA;AAAA,IACH,GAAG;AAAA,GACH,CAAA;AACF;;;;"}
|
package/dist/es/core.js
CHANGED
|
@@ -431,7 +431,7 @@ class UserError extends NestedError {
|
|
|
431
431
|
*/
|
|
432
432
|
/* istanbul ignore next: default implementation */
|
|
433
433
|
prettyFormat() {
|
|
434
|
-
return
|
|
434
|
+
return undefined;
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
|
|
@@ -934,7 +934,7 @@ const ajvRegexpValidate = function(data, dataCxt) {
|
|
|
934
934
|
ajvRegexpValidate.errors = [
|
|
935
935
|
{
|
|
936
936
|
instancePath: dataCxt?.instancePath,
|
|
937
|
-
schemaPath:
|
|
937
|
+
schemaPath: undefined,
|
|
938
938
|
keyword: "type",
|
|
939
939
|
message: "should be a regular expression",
|
|
940
940
|
params: {
|
|
@@ -961,7 +961,7 @@ const ajvFunctionValidate = function(data, dataCxt) {
|
|
|
961
961
|
/* istanbul ignore next */
|
|
962
962
|
dataCxt?.instancePath
|
|
963
963
|
),
|
|
964
|
-
schemaPath:
|
|
964
|
+
schemaPath: undefined,
|
|
965
965
|
keyword: "type",
|
|
966
966
|
message: "should be a function",
|
|
967
967
|
params: {
|
|
@@ -1016,7 +1016,7 @@ function isSet(value) {
|
|
|
1016
1016
|
return typeof value !== "undefined";
|
|
1017
1017
|
}
|
|
1018
1018
|
function flag(value) {
|
|
1019
|
-
return value ? true :
|
|
1019
|
+
return value ? true : undefined;
|
|
1020
1020
|
}
|
|
1021
1021
|
function stripUndefined(src) {
|
|
1022
1022
|
const entries = Object.entries(src).filter(([, value]) => isSet(value));
|
|
@@ -1026,8 +1026,8 @@ function migrateSingleAttribute(src, key) {
|
|
|
1026
1026
|
const result = {};
|
|
1027
1027
|
result.deprecated = flag(src.deprecatedAttributes?.includes(key));
|
|
1028
1028
|
result.required = flag(src.requiredAttributes?.includes(key));
|
|
1029
|
-
result.omit =
|
|
1030
|
-
const attr = src.attributes ? src.attributes[key] :
|
|
1029
|
+
result.omit = undefined;
|
|
1030
|
+
const attr = src.attributes ? src.attributes[key] : undefined;
|
|
1031
1031
|
if (typeof attr === "undefined") {
|
|
1032
1032
|
return stripUndefined(result);
|
|
1033
1033
|
}
|
|
@@ -1083,7 +1083,7 @@ function migrateElement(src) {
|
|
|
1083
1083
|
const result = {
|
|
1084
1084
|
...src,
|
|
1085
1085
|
...{
|
|
1086
|
-
formAssociated:
|
|
1086
|
+
formAssociated: undefined
|
|
1087
1087
|
},
|
|
1088
1088
|
attributes: migrateAttributes(src),
|
|
1089
1089
|
textContent: src.textContent,
|
|
@@ -1621,7 +1621,7 @@ class DOMNode {
|
|
|
1621
1621
|
if (this.cache) {
|
|
1622
1622
|
return this.cache.get(key);
|
|
1623
1623
|
} else {
|
|
1624
|
-
return
|
|
1624
|
+
return undefined;
|
|
1625
1625
|
}
|
|
1626
1626
|
}
|
|
1627
1627
|
cacheSet(key, value) {
|
|
@@ -1881,7 +1881,7 @@ function parseCombinator(combinator, pattern) {
|
|
|
1881
1881
|
return 5 /* SCOPE */;
|
|
1882
1882
|
}
|
|
1883
1883
|
switch (combinator) {
|
|
1884
|
-
case
|
|
1884
|
+
case undefined:
|
|
1885
1885
|
case null:
|
|
1886
1886
|
case "":
|
|
1887
1887
|
return 1 /* DESCENDANT */;
|
|
@@ -2113,7 +2113,7 @@ class AttrMatcher extends Matcher {
|
|
|
2113
2113
|
const attr = node.getAttribute(this.key, true);
|
|
2114
2114
|
return attr.some((cur) => {
|
|
2115
2115
|
switch (this.op) {
|
|
2116
|
-
case
|
|
2116
|
+
case undefined:
|
|
2117
2117
|
return true;
|
|
2118
2118
|
/* attribute exists */
|
|
2119
2119
|
case "=":
|
|
@@ -2586,7 +2586,7 @@ class HtmlElement extends DOMNode {
|
|
|
2586
2586
|
*/
|
|
2587
2587
|
get role() {
|
|
2588
2588
|
const cached = this.cacheGet(ROLE);
|
|
2589
|
-
if (cached !==
|
|
2589
|
+
if (cached !== undefined) {
|
|
2590
2590
|
return cached;
|
|
2591
2591
|
}
|
|
2592
2592
|
const role = this.getAttribute("role");
|
|
@@ -2644,7 +2644,7 @@ class HtmlElement extends DOMNode {
|
|
|
2644
2644
|
*/
|
|
2645
2645
|
get tabIndex() {
|
|
2646
2646
|
const cached = this.cacheGet(TABINDEX);
|
|
2647
|
-
if (cached !==
|
|
2647
|
+
if (cached !== undefined) {
|
|
2648
2648
|
return cached;
|
|
2649
2649
|
}
|
|
2650
2650
|
const tabindex = this.getAttribute("tabindex");
|
|
@@ -11930,7 +11930,7 @@ class Parser {
|
|
|
11930
11930
|
*/
|
|
11931
11931
|
getAttributeLocation(key, value) {
|
|
11932
11932
|
const begin = key.location;
|
|
11933
|
-
const end = value && value.type === TokenType.ATTR_VALUE ? value.location :
|
|
11933
|
+
const end = value && value.type === TokenType.ATTR_VALUE ? value.location : undefined;
|
|
11934
11934
|
return {
|
|
11935
11935
|
filename: begin.filename,
|
|
11936
11936
|
line: begin.line,
|
|
@@ -11969,8 +11969,8 @@ class Parser {
|
|
|
11969
11969
|
actionOffset,
|
|
11970
11970
|
actionOffset + action.length
|
|
11971
11971
|
);
|
|
11972
|
-
const optionsLocation = data ? sliceLocation(token.location, optionsOffset, optionsOffset + data.length) :
|
|
11973
|
-
const commentLocation = comment ? sliceLocation(token.location, commentOffset, commentOffset + comment.length) :
|
|
11972
|
+
const optionsLocation = data ? sliceLocation(token.location, optionsOffset, optionsOffset + data.length) : undefined;
|
|
11973
|
+
const commentLocation = comment ? sliceLocation(token.location, commentOffset, commentOffset + comment.length) : undefined;
|
|
11974
11974
|
this.trigger("directive", {
|
|
11975
11975
|
action,
|
|
11976
11976
|
data,
|
|
@@ -12911,13 +12911,13 @@ function isConfigData(value) {
|
|
|
12911
12911
|
class HtmlValidate {
|
|
12912
12912
|
configLoader;
|
|
12913
12913
|
constructor(arg) {
|
|
12914
|
-
const [loader, config] = arg instanceof ConfigLoader ? [arg,
|
|
12914
|
+
const [loader, config] = arg instanceof ConfigLoader ? [arg, undefined] : [undefined, arg];
|
|
12915
12915
|
this.configLoader = loader ?? new StaticConfigLoader(config);
|
|
12916
12916
|
}
|
|
12917
12917
|
/* eslint-enable @typescript-eslint/unified-signatures */
|
|
12918
12918
|
validateString(str, arg1, arg2, arg3) {
|
|
12919
12919
|
const filename = typeof arg1 === "string" ? arg1 : "inline";
|
|
12920
|
-
const options = isConfigData(arg1) ? arg1 : isConfigData(arg2) ? arg2 :
|
|
12920
|
+
const options = isConfigData(arg1) ? arg1 : isConfigData(arg2) ? arg2 : undefined;
|
|
12921
12921
|
const hooks = isSourceHooks(arg1) ? arg1 : isSourceHooks(arg2) ? arg2 : arg3;
|
|
12922
12922
|
const source = {
|
|
12923
12923
|
data: str,
|
|
@@ -12932,7 +12932,7 @@ class HtmlValidate {
|
|
|
12932
12932
|
/* eslint-enable @typescript-eslint/unified-signatures */
|
|
12933
12933
|
validateStringSync(str, arg1, arg2, arg3) {
|
|
12934
12934
|
const filename = typeof arg1 === "string" ? arg1 : "inline";
|
|
12935
|
-
const options = isConfigData(arg1) ? arg1 : isConfigData(arg2) ? arg2 :
|
|
12935
|
+
const options = isConfigData(arg1) ? arg1 : isConfigData(arg2) ? arg2 : undefined;
|
|
12936
12936
|
const hooks = isSourceHooks(arg1) ? arg1 : isSourceHooks(arg2) ? arg2 : arg3;
|
|
12937
12937
|
const source = {
|
|
12938
12938
|
data: str,
|
|
@@ -13313,7 +13313,7 @@ class HtmlValidate {
|
|
|
13313
13313
|
}
|
|
13314
13314
|
|
|
13315
13315
|
const name = "html-validate";
|
|
13316
|
-
const version = "9.1.
|
|
13316
|
+
const version = "9.1.2";
|
|
13317
13317
|
const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
|
|
13318
13318
|
|
|
13319
13319
|
function definePlugin(plugin) {
|
|
@@ -14400,36 +14400,7 @@ if (
|
|
|
14400
14400
|
|| isNotRelative(path);
|
|
14401
14401
|
}
|
|
14402
14402
|
|
|
14403
|
-
function importFunction(id) {
|
|
14404
|
-
return import(id);
|
|
14405
|
-
}
|
|
14406
|
-
|
|
14407
|
-
async function internalImport(id) {
|
|
14408
|
-
const { default: defaultImport } = await importFunction(id);
|
|
14409
|
-
if (!defaultImport) {
|
|
14410
|
-
throw new UserError(`"${id}" does not have a default export`);
|
|
14411
|
-
}
|
|
14412
|
-
return defaultImport;
|
|
14413
|
-
}
|
|
14414
|
-
function esmResolver() {
|
|
14415
|
-
return {
|
|
14416
|
-
name: "esm-resolver",
|
|
14417
|
-
resolveElements(id) {
|
|
14418
|
-
return internalImport(id);
|
|
14419
|
-
},
|
|
14420
|
-
resolveConfig(id) {
|
|
14421
|
-
return internalImport(id);
|
|
14422
|
-
},
|
|
14423
|
-
resolvePlugin(id) {
|
|
14424
|
-
return internalImport(id);
|
|
14425
|
-
},
|
|
14426
|
-
async resolveTransformer(id) {
|
|
14427
|
-
return internalImport(id);
|
|
14428
|
-
}
|
|
14429
|
-
};
|
|
14430
|
-
}
|
|
14431
|
-
|
|
14432
14403
|
var workerPath = "./jest-worker.js";
|
|
14433
14404
|
|
|
14434
|
-
export { Attribute as A, Reporter as B, Config as C, DOMNode as D, definePlugin as E, ruleExists as F, walk as G, HtmlValidate as H, EventHandler as I, compatibilityCheckImpl as J, isThenable as K, workerPath as L, MetaCopyableProperty as M, NodeClosed as N, codeframe as O, Parser as P,
|
|
14405
|
+
export { Attribute as A, Reporter as B, Config as C, DOMNode as D, definePlugin as E, ruleExists as F, walk as G, HtmlValidate as H, EventHandler as I, compatibilityCheckImpl as J, isThenable as K, workerPath as L, MetaCopyableProperty as M, NodeClosed as N, codeframe as O, Parser as P, name as Q, ResolvedConfig as R, Severity as S, TextNode as T, UserError as U, Validator as V, WrappedError as W, bugs as X, ConfigError as a, ConfigLoader as b, defineConfig as c, deepmerge as d, ensureError as e, factory as f, getFormatter as g, StaticConfigLoader as h, DOMTokenList as i, DOMTree as j, DynamicValue as k, HtmlElement as l, NodeType as m, NestedError as n, SchemaValidationError as o, presets as p, MetaTable as q, TextContent$1 as r, staticResolver as s, Rule as t, ariaNaming as u, version as v, TextClassification as w, classifyNodeText as x, keywordPatternMatcher as y, sliceLocation as z };
|
|
14435
14406
|
//# sourceMappingURL=core.js.map
|