fix: lint failing on astro and some integrations (#3794)

* fix: lint failing on astro and some integrations

* chore: fix telemetry lint

* chore: fix turbo cache (thx nate)

* chore: fix runtime server
This commit is contained in:
Joaquín Sánchez 2022-07-07 23:06:44 +02:00 committed by GitHub
parent 515e876598
commit c6ba6ec4d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 17 deletions

View file

@ -21,7 +21,6 @@ defaults:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
FORCE_COLOR: true
ASTRO_TELEMETRY_DISABLED: true

View file

@ -198,6 +198,6 @@ async function throwAndExit(cmd: string, err: unknown) {
setTimeout(exitWithErrorMessage, 400);
// Wait for the telemetry event to send, then exit. Ignore any error.
await telemetryPromise
.catch((err) => debug('telemetry', `record() error: ${err.message}`))
.catch((err2) => debug('telemetry', `record() error: ${err2.message}`))
.then(exitWithErrorMessage);
}

View file

@ -150,6 +150,7 @@ const createIntegration = (options: IntegrationOptions = {}): AstroIntegration =
}
if (!inputBuffer) {
// eslint-disable-next-line no-console
console.warn(`"${transform.src}" image could not be fetched`);
continue;
}

View file

@ -31,8 +31,8 @@ export function createPlugin(config: AstroConfig, options: Required<IntegrationO
return {
name: '@astrojs/image',
enforce: 'pre',
configResolved(config) {
resolvedConfig = config;
configResolved(viteConfig) {
resolvedConfig = viteConfig;
},
async resolveId(id) {
// The virtual model redirects imports to the ImageService being used

View file

@ -71,6 +71,7 @@ const createPlugin = (options?: SitemapOptions): AstroIntegration => {
if (config.site) {
finalSiteUrl = new URL(config.base, config.site);
} else {
// eslint-disable-next-line no-console
console.warn(
'The Sitemap integration requires the `site` astro.config option. Skipping.'
);

View file

@ -10,7 +10,7 @@ import { getSystemInfo, SystemInfo } from './system-info.js';
export type AstroTelemetryOptions = { astroVersion: string; viteVersion: string };
export type TelemetryEvent = { eventName: string; payload: Record<string, any> };
interface EventMeta extends SystemInfo {}
type EventMeta = SystemInfo
interface EventContext extends ProjectInfo {
anonymousId: string;
anonymousSessionId: string;

View file

@ -1,12 +1,12 @@
export { pathToPosix } from './lib/utils';
export { AbortController, AbortSignal, alert, atob, Blob, btoa, ByteLengthQueuingStrategy, cancelAnimationFrame, cancelIdleCallback, CanvasRenderingContext2D, CharacterData, clearTimeout, Comment, CountQueuingStrategy, CSSStyleSheet, CustomElementRegistry, CustomEvent, Document, DocumentFragment, DOMException, Element, Event, EventTarget, fetch, File, FormData, Headers, HTMLBodyElement, HTMLCanvasElement, HTMLDivElement, HTMLDocument, HTMLElement, HTMLHeadElement, HTMLHtmlElement, HTMLImageElement, HTMLSpanElement, HTMLStyleElement, HTMLTemplateElement, HTMLUnknownElement, Image, ImageData, IntersectionObserver, MediaQueryList, MutationObserver, Node, NodeFilter, NodeIterator, OffscreenCanvas, ReadableByteStreamController, ReadableStream, ReadableStreamBYOBReader, ReadableStreamBYOBRequest, ReadableStreamDefaultController, ReadableStreamDefaultReader, Request, requestAnimationFrame, requestIdleCallback, ResizeObserver, Response, setTimeout, ShadowRoot, structuredClone, StyleSheet, Text, TransformStream, TreeWalker, URLPattern, Window, WritableStream, WritableStreamDefaultController, WritableStreamDefaultWriter } from './mod.js';
export declare const polyfill: {
(target: any, options?: PolyfillOptions): any;
internals(target: any, name: string): any;
};
interface PolyfillOptions {
exclude?: string | string[];
override?: Record<string, {
(...args: any[]): any;
}>;
}
export { pathToPosix } from './lib/utils';
export { AbortController, AbortSignal, alert, atob, Blob, btoa, ByteLengthQueuingStrategy, cancelAnimationFrame, cancelIdleCallback, CanvasRenderingContext2D, CharacterData, clearTimeout, Comment, CountQueuingStrategy, CSSStyleSheet, CustomElementRegistry, CustomEvent, Document, DocumentFragment, DOMException, Element, Event, EventTarget, fetch, File, FormData, Headers, HTMLBodyElement, HTMLCanvasElement, HTMLDivElement, HTMLDocument, HTMLElement, HTMLHeadElement, HTMLHtmlElement, HTMLImageElement, HTMLSpanElement, HTMLStyleElement, HTMLTemplateElement, HTMLUnknownElement, Image, ImageData, IntersectionObserver, MediaQueryList, MutationObserver, Node, NodeFilter, NodeIterator, OffscreenCanvas, ReadableByteStreamController, ReadableStream, ReadableStreamBYOBReader, ReadableStreamBYOBRequest, ReadableStreamDefaultController, ReadableStreamDefaultReader, Request, requestAnimationFrame, requestIdleCallback, ResizeObserver, Response, setTimeout, ShadowRoot, structuredClone, StyleSheet, Text, TransformStream, TreeWalker, URLPattern, Window, WritableStream, WritableStreamDefaultController, WritableStreamDefaultWriter, } from './mod.js';
export declare const polyfill: {
(target: any, options?: PolyfillOptions): any;
internals(target: any, name: string): any;
};
interface PolyfillOptions {
exclude?: string | string[];
override?: Record<string, {
(...args: any[]): any;
}>;
}