pull/16240/head
Rich Harris 3 months ago
parent 943dc0bfaf
commit ff806c2484

@ -1,12 +1,6 @@
/* This file is generated by scripts/process-messages/index.js. Do not edit! */ /* This file is generated by scripts/process-messages/index.js. Do not edit! */
import { import { warnings, ignore_stack, ignore_map, warning_filter } from './state.js';
warnings,
ignore_stack,
ignore_map,
warning_filter
} from './state.js';
import { CompileDiagnostic } from './utils/compile_diagnostic.js'; import { CompileDiagnostic } from './utils/compile_diagnostic.js';
/** @typedef {{ start?: number, end?: number }} NodeLike */ /** @typedef {{ start?: number, end?: number }} NodeLike */
@ -40,6 +34,7 @@ function w(node, code, message) {
const warning = new InternalCompileWarning(code, message, node && node.start !== undefined ? [node.start, node.end ?? node.start] : undefined); const warning = new InternalCompileWarning(code, message, node && node.start !== undefined ? [node.start, node.end ?? node.start] : undefined);
if (!warning_filter(warning)) return; if (!warning_filter(warning)) return;
warnings.push(warning); warnings.push(warning);
} }
@ -496,7 +491,9 @@ export function a11y_role_supports_aria_props_implicit(node, attribute, role, na
* @param {string | undefined | null} [suggestion] * @param {string | undefined | null} [suggestion]
*/ */
export function a11y_unknown_aria_attribute(node, attribute, suggestion) { export function a11y_unknown_aria_attribute(node, attribute, suggestion) {
w(node, 'a11y_unknown_aria_attribute', `${suggestion ? `Unknown aria attribute 'aria-${attribute}'. Did you mean '${suggestion}'?` : `Unknown aria attribute 'aria-${attribute}'`}\nhttps://svelte.dev/e/a11y_unknown_aria_attribute`); w(node, 'a11y_unknown_aria_attribute', `${suggestion
? `Unknown aria attribute 'aria-${attribute}'. Did you mean '${suggestion}'?`
: `Unknown aria attribute 'aria-${attribute}'`}\nhttps://svelte.dev/e/a11y_unknown_aria_attribute`);
} }
/** /**
@ -506,7 +503,9 @@ export function a11y_unknown_aria_attribute(node, attribute, suggestion) {
* @param {string | undefined | null} [suggestion] * @param {string | undefined | null} [suggestion]
*/ */
export function a11y_unknown_role(node, role, suggestion) { export function a11y_unknown_role(node, role, suggestion) {
w(node, 'a11y_unknown_role', `${suggestion ? `Unknown role '${role}'. Did you mean '${suggestion}'?` : `Unknown role '${role}'`}\nhttps://svelte.dev/e/a11y_unknown_role`); w(node, 'a11y_unknown_role', `${suggestion
? `Unknown role '${role}'. Did you mean '${suggestion}'?`
: `Unknown role '${role}'`}\nhttps://svelte.dev/e/a11y_unknown_role`);
} }
/** /**
@ -534,7 +533,9 @@ export function legacy_code(node, code, suggestion) {
* @param {string | undefined | null} [suggestion] * @param {string | undefined | null} [suggestion]
*/ */
export function unknown_code(node, code, suggestion) { export function unknown_code(node, code, suggestion) {
w(node, 'unknown_code', `${suggestion ? `\`${code}\` is not a recognised code (did you mean \`${suggestion}\`?)` : `\`${code}\` is not a recognised code`}\nhttps://svelte.dev/e/unknown_code`); w(node, 'unknown_code', `${suggestion
? `\`${code}\` is not a recognised code (did you mean \`${suggestion}\`?)`
: `\`${code}\` is not a recognised code`}\nhttps://svelte.dev/e/unknown_code`);
} }
/** /**

@ -1120,6 +1120,8 @@ declare module 'svelte/compiler' {
instance: Script | null; instance: Script | null;
/** The parsed `<script module>` element, if exists */ /** The parsed `<script module>` element, if exists */
module: Script | null; module: Script | null;
/** Comments found in <script> and {expressions} */
comments: JSComment[];
} }
export interface SvelteOptions { export interface SvelteOptions {
@ -1437,6 +1439,17 @@ declare module 'svelte/compiler' {
attributes: Attribute[]; attributes: Attribute[];
} }
export interface JSComment {
type: 'Line' | 'Block';
value: string;
start: number;
end: number;
loc: {
start: { line: number; column: number };
end: { line: number; column: number };
};
}
export type AttributeLike = Attribute | SpreadAttribute | Directive; export type AttributeLike = Attribute | SpreadAttribute | Directive;
export type Directive = export type Directive =
@ -1493,7 +1506,7 @@ declare module 'svelte/compiler' {
| AST.Comment | AST.Comment
| Block; | Block;
export type SvelteNode = Node | TemplateNode | AST.Fragment | _CSS.Node; export type SvelteNode = Node | TemplateNode | AST.Fragment | _CSS.Node | Script;
export type { _CSS as CSS }; export type { _CSS as CSS };
} }

Loading…
Cancel
Save