move a11y.js to visitors/validate-a11y.js

tidy-up-analysis
Rich Harris 2 years ago
parent c6dc279480
commit d1cecd67cd

@ -8,7 +8,7 @@ import { is_custom_element_node } from '../nodes.js';
import { regex_not_whitespace, regex_only_whitespaces } from '../patterns.js';
import { Scope, get_rune } from '../scope.js';
import { merge } from '../visitors.js';
import { a11y_validators } from './a11y.js';
import { a11y_validators } from './visitors/validate-a11y.js';
/**
* @param {import('#compiler').Component | import('#compiler').SvelteComponent | import('#compiler').SvelteSelf} node

@ -6,11 +6,11 @@ import {
regex_not_whitespace,
regex_starts_with_vowel,
regex_whitespaces
} from '../patterns.js';
import { warn } from '../../warnings.js';
import fuzzymatch from '../1-parse/utils/fuzzymatch.js';
import { is_text_attribute } from '../../utils/ast.js';
import { ContentEditableBindings } from '../constants.js';
} from '../../patterns.js';
import { warn } from '../../../warnings.js';
import fuzzymatch from '../../1-parse/utils/fuzzymatch.js';
import { is_text_attribute } from '../../../utils/ast.js';
import { ContentEditableBindings } from '../../constants.js';
import { walk } from 'zimmerframe';
const aria_roles = roles_map.keys();
@ -666,7 +666,7 @@ function get_static_text_value(attribute) {
/**
* @param {import('#compiler').RegularElement | import('#compiler').SvelteElement} node
* @param {import('./types.js').AnalysisState} state
* @param {import('../types.js').AnalysisState} state
* @param {import('#compiler').SvelteNode[]} path
*/
function check_element(node, state, path) {
@ -674,10 +674,10 @@ function check_element(node, state, path) {
if (state.options.namespace === 'foreign') return;
/**
* @template {keyof import('../../warnings.js').AllWarnings} T
* @template {keyof import('../../../warnings.js').AllWarnings} T
* @param {{ start?: number, end?: number }} node
* @param {T} code
* @param {Parameters<import('../../warnings.js').AllWarnings[T]>} args
* @param {Parameters<import('../../../warnings.js').AllWarnings[T]>} args
* @returns {void}
*/
const push_warning = (node, code, ...args) =>
@ -1157,7 +1157,7 @@ function check_element(node, state, path) {
}
/**
* @type {import('zimmerframe').Visitors<import('#compiler').SvelteNode, import('./types.js').AnalysisState>}
* @type {import('zimmerframe').Visitors<import('#compiler').SvelteNode, import('../types.js').AnalysisState>}
*/
export const a11y_validators = {
RegularElement(node, context) {
Loading…
Cancel
Save