Home / File/ warnings.js — svelte Source File

warnings.js — svelte Source File

Architecture documentation for warnings.js, a javascript file in the svelte codebase. 3 imports, 25 dependents.

File javascript Compiler Transformer 3 imports 25 dependents 82 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  56a689f9_11c0_cc76_bd60_41bb6dc96475["warnings.js"]
  62f818c8_e890_17ed_5ec1_92f953d4a7a6["state.js"]
  56a689f9_11c0_cc76_bd60_41bb6dc96475 --> 62f818c8_e890_17ed_5ec1_92f953d4a7a6
  266f0f82_b1c9_08bb_80b9_55a66e7d3dba["compile_diagnostic.js"]
  56a689f9_11c0_cc76_bd60_41bb6dc96475 --> 266f0f82_b1c9_08bb_80b9_55a66e7d3dba
  fca2e303_5d6d_304a_d0fc_14ab13a1ecb7["CompileDiagnostic"]
  56a689f9_11c0_cc76_bd60_41bb6dc96475 --> fca2e303_5d6d_304a_d0fc_14ab13a1ecb7
  90aa5201_1990_23b6_f05a_1ff5d9b22b14["script.js"]
  90aa5201_1990_23b6_f05a_1ff5d9b22b14 --> 56a689f9_11c0_cc76_bd60_41bb6dc96475
  206889ff_1f9f_b6c1_d530_059d001e1cf4["element.js"]
  206889ff_1f9f_b6c1_d530_059d001e1cf4 --> 56a689f9_11c0_cc76_bd60_41bb6dc96475
  4676a465_3cd7_1d4c_04b8_a56bf8469f18["css-warn.js"]
  4676a465_3cd7_1d4c_04b8_a56bf8469f18 --> 56a689f9_11c0_cc76_bd60_41bb6dc96475
  4aa8a188_84d4_0274_ed83_cac0ab1d3572["index.js"]
  4aa8a188_84d4_0274_ed83_cac0ab1d3572 --> 56a689f9_11c0_cc76_bd60_41bb6dc96475
  6b8c189e_23e1_77d3_9ee3_3eec5012a9b2["BindDirective.js"]
  6b8c189e_23e1_77d3_9ee3_3eec5012a9b2 --> 56a689f9_11c0_cc76_bd60_41bb6dc96475
  9c8c3898_c88a_e729_415d_3dfa25f39aa1["ClassDeclaration.js"]
  9c8c3898_c88a_e729_415d_3dfa25f39aa1 --> 56a689f9_11c0_cc76_bd60_41bb6dc96475
  dbb15ae0_a432_16e3_1429_24ffed462356["ExpressionStatement.js"]
  dbb15ae0_a432_16e3_1429_24ffed462356 --> 56a689f9_11c0_cc76_bd60_41bb6dc96475
  dbcd64ee_7333_aa92_9b8e_ed189c6c4449["Identifier.js"]
  dbcd64ee_7333_aa92_9b8e_ed189c6c4449 --> 56a689f9_11c0_cc76_bd60_41bb6dc96475
  5d572700_84fa_a20f_b641_c5b7becd2684["LabeledStatement.js"]
  5d572700_84fa_a20f_b641_c5b7becd2684 --> 56a689f9_11c0_cc76_bd60_41bb6dc96475
  d812d0a1_2202_85b0_1991_a9ba140dd8b4["Literal.js"]
  d812d0a1_2202_85b0_1991_a9ba140dd8b4 --> 56a689f9_11c0_cc76_bd60_41bb6dc96475
  4a1787d0_f65e_afaf_574b_c50d2f0f6992["NewExpression.js"]
  4a1787d0_f65e_afaf_574b_c50d2f0f6992 --> 56a689f9_11c0_cc76_bd60_41bb6dc96475
  style 56a689f9_11c0_cc76_bd60_41bb6dc96475 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/* This file is generated by scripts/process-messages/index.js. Do not edit! */

import { warnings, ignore_stack, ignore_map, warning_filter } from './state.js';
import { CompileDiagnostic } from './utils/compile_diagnostic.js';

/** @typedef {{ start?: number, end?: number }} NodeLike */
class InternalCompileWarning extends CompileDiagnostic {
	name = 'CompileWarning';

	/**
	 * @param {string} code
	 * @param {string} message
	 * @param {[number, number] | undefined} position
	 */
	constructor(code, message, position) {
		super(code, message, position);
	}
}

/**
 * @param {null | NodeLike} node
 * @param {string} code
 * @param {string} message
 */
function w(node, code, message) {
	let stack = ignore_stack;

	if (node) {
		stack = ignore_map.get(node) ?? ignore_stack;
	}

	if (stack && stack.at(-1)?.has(code)) return;

	const warning = new InternalCompileWarning(code, message, node && node.start !== undefined ? [node.start, node.end ?? node.start] : undefined);

	if (!warning_filter(warning)) return;

	warnings.push(warning);
}

export const codes = [
	'a11y_accesskey',
	'a11y_aria_activedescendant_has_tabindex',
	'a11y_aria_attributes',
	'a11y_autocomplete_valid',
	'a11y_autofocus',
	'a11y_click_events_have_key_events',
	'a11y_consider_explicit_label',
	'a11y_distracting_elements',
	'a11y_figcaption_index',
	'a11y_figcaption_parent',
	'a11y_hidden',
	'a11y_img_redundant_alt',
	'a11y_incorrect_aria_attribute_type',
	'a11y_incorrect_aria_attribute_type_boolean',
	'a11y_incorrect_aria_attribute_type_id',
	'a11y_incorrect_aria_attribute_type_idlist',
	'a11y_incorrect_aria_attribute_type_integer',
	'a11y_incorrect_aria_attribute_type_token',
	'a11y_incorrect_aria_attribute_type_tokenlist',
// ... (785 more lines)

Domain

Subdomains

Functions

Imported By

Frequently Asked Questions

What does warnings.js do?
warnings.js is a source file in the svelte codebase, written in javascript. It belongs to the Compiler domain, Transformer subdomain.
What functions are defined in warnings.js?
warnings.js defines 82 function(s): a11y_accesskey, a11y_aria_activedescendant_has_tabindex, a11y_aria_attributes, a11y_autocomplete_valid, a11y_autofocus, a11y_click_events_have_key_events, a11y_consider_explicit_label, a11y_distracting_elements, a11y_figcaption_index, a11y_figcaption_parent, and 72 more.
What does warnings.js depend on?
warnings.js imports 3 module(s): CompileDiagnostic, compile_diagnostic.js, state.js.
What files import warnings.js?
warnings.js is imported by 25 file(s): BindDirective.js, ClassDeclaration.js, ExpressionStatement.js, Identifier.js, LabeledStatement.js, Literal.js, NewExpression.js, OnDirective.js, and 17 more.
Where is warnings.js in the architecture?
warnings.js is located at packages/svelte/src/compiler/warnings.js (domain: Compiler, subdomain: Transformer, directory: packages/svelte/src/compiler).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free