mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-02 10:33:39 +00:00
a473e73b3e
Adds a custom oxlint rule renovate/v8-ignore-no-count that flags the count form '/* v8 ignore next <N> */'. The count is not honored by vitest's ast-v8-to-istanbul hint parser, which captures only the keyword (if/else/next/file); 'next' always exempts exactly the next AST node. Trailing counts therefore suggest a line range that is never applied and mislead readers. The rule is autofixable (drops the count, preserving actual behavior) and has been applied to all existing occurrences.
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import * as npmVersioning from '../../versioning/npm/index.ts';
|
|
import { Datasource } from '../datasource.ts';
|
|
import type { GetReleasesConfig, ReleaseResult } from '../types.ts';
|
|
import { defaultRegistryUrl } from './common.ts';
|
|
import { getDependency } from './get.ts';
|
|
|
|
export { setNpmrc } from './npmrc.ts';
|
|
|
|
export class NpmDatasource extends Datasource {
|
|
static readonly id = 'npm';
|
|
|
|
override readonly customRegistrySupport = true;
|
|
|
|
override readonly registryStrategy = 'first';
|
|
|
|
override readonly defaultVersioning = npmVersioning.id;
|
|
|
|
override readonly defaultRegistryUrls = [defaultRegistryUrl];
|
|
|
|
override readonly releaseTimestampSupport = true;
|
|
override readonly releaseTimestampNote =
|
|
'The release timestamp is determined from the `time` field in the results.';
|
|
override readonly sourceUrlSupport = 'release';
|
|
override readonly sourceUrlNote =
|
|
'The source URL is determined from the `repository` field in the results.';
|
|
|
|
constructor() {
|
|
super(NpmDatasource.id);
|
|
}
|
|
|
|
async getReleases({
|
|
packageName,
|
|
registryUrl,
|
|
}: GetReleasesConfig): Promise<ReleaseResult | null> {
|
|
/* v8 ignore next -- should never happen */
|
|
if (!registryUrl) {
|
|
return null;
|
|
}
|
|
|
|
const res = await getDependency(this.http, registryUrl, packageName);
|
|
return res;
|
|
}
|
|
}
|