Home / Function/ warn_missing_attribute() — svelte Function Reference

warn_missing_attribute() — svelte Function Reference

Architecture documentation for the warn_missing_attribute() function in index.js from the svelte codebase.

Function javascript Compiler Transformer calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  19e27f77_6256_d68e_78c0_a225ef331f17["warn_missing_attribute()"]
  b389a21f_6de7_2a41_34f3_8efbf9045c9c["index.js"]
  19e27f77_6256_d68e_78c0_a225ef331f17 -->|defined in| b389a21f_6de7_2a41_34f3_8efbf9045c9c
  c342967b_b314_8027_476d_d085ed0e13f0["check_element()"]
  c342967b_b314_8027_476d_d085ed0e13f0 -->|calls| 19e27f77_6256_d68e_78c0_a225ef331f17
  e197b1cc_1c1b_9ede_de4b_65d8fbaf508e["a11y_missing_attribute()"]
  19e27f77_6256_d68e_78c0_a225ef331f17 -->|calls| e197b1cc_1c1b_9ede_de4b_65d8fbaf508e
  style 19e27f77_6256_d68e_78c0_a225ef331f17 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js lines 972–981

function warn_missing_attribute(node, attributes, name = node.name) {
	const article =
		regex_starts_with_vowel.test(attributes[0]) || attributes[0] === 'href' ? 'an' : 'a';
	const sequence =
		attributes.length > 1
			? attributes.slice(0, -1).join(', ') + ` or ${attributes[attributes.length - 1]}`
			: attributes[0];

	w.a11y_missing_attribute(node, name, article, sequence);
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does warn_missing_attribute() do?
warn_missing_attribute() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js.
Where is warn_missing_attribute() defined?
warn_missing_attribute() is defined in packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js at line 972.
What does warn_missing_attribute() call?
warn_missing_attribute() calls 1 function(s): a11y_missing_attribute.
What calls warn_missing_attribute()?
warn_missing_attribute() is called by 1 function(s): check_element.

Analyze Your Own Codebase

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

Try Supermodel Free