Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle svelte-check warnings #186

Open
5 tasks
techniq opened this issue Jan 5, 2024 · 1 comment
Open
5 tasks

Handle svelte-check warnings #186

techniq opened this issue Jan 5, 2024 · 1 comment
Milestone

Comments

@techniq
Copy link
Owner

techniq commented Jan 5, 2024

  • Handle all svelte-check warnings (A11y, unused variables, etc) so the console is clean
    • Possibly leverage <!-- svelte-ignore ... --> temporarily
  • Setup CI to run svelte-check and fail build
  • If <!-- svelte-ignore ... --> is used, properly handle remaining items
  • Rinse/repeat in LayerChart
  • Enjoy a peaceful dev experience with improved accessibility
12:25:47 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/ListItem.svelte:38:0 A11y: Non-interactive element <li> should not be assigned mouse or keyboard event listeners.
12:25:47 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/ButtonGroup.svelte:34:0 A11y: Non-interactive element <div> should not be assigned mouse or keyboard event listeners.
12:25:47 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/Tooltip.svelte:92:0 A11y: <div> with mouseenter, mouseleave, click handlers must have an ARIA role
12:25:47 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/Dialog.svelte:72:2 A11y: <div> with click, mouseup, keydown handlers must have an ARIA role
12:25:48 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/Backdrop.svelte:11:0 A11y: <div> with keydown, keyup, keypress, click, mousedown, mouseup handlers must have an ARIA role
12:25:48 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/Field.svelte:108:8 A11y: <div> with click handler must have an ARIA role
12:25:49 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/SelectField.svelte:32:11 SelectField has unused export property 'tabindex'. If it is for external reference only, please consider using `export const tabindex`
12:25:49 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/Menu.svelte:62:2 A11y: Non-interactive element <menu> should not be assigned mouse or keyboard event listeners.
12:25:49 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/_SelectListOptions.svelte:5:11 SelectListOptions has unused export property 'optionText'. If it is for external reference only, please consider using `export const optionText`
12:25:49 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/_SelectListOptions.svelte:8:11 SelectListOptions has unused export property 'selectOption'. If it is for external reference only, please consider using `export const selectOption`
12:25:49 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/_SelectListOptions.svelte:14:11 SelectListOptions has unused export property 'value'. If it is for external reference only, please consider using `export const value`
12:25:49 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/_SelectListOptions.svelte:15:11 SelectListOptions has unused export property 'selected'. If it is for external reference only, please consider using `export const selected`
12:25:49 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/_SelectListOptions.svelte:16:11 SelectListOptions has unused export property 'highlightIndex'. If it is for external reference only, please consider using `export const highlightIndex`
12:25:58 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/ToggleOption.svelte:25:0 A11y: Non-interactive element <label> should not be assigned mouse or keyboard event listeners.
12:26:16 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/docs/Link.svelte:1:0 A11y: <a> element should have an href attribute
12:26:32 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/Drawer.svelte:40:2 A11y: <div> with keydown, mouseup handlers must have an ARIA role
12:26:32 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/MultiSelectField.svelte:98:0 A11y: <div> with click handler must have an ARIA role
12:26:36 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/Grid.svelte:45:0 A11y: <div> with click handler must have an ARIA role
12:26:36 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/Notification.svelte:38:2 A11y: <div> with click, keypress handlers must have an ARIA role
12:26:37 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/RangeSlider.svelte:213:2 A11y: <div> with mouseenter, mouseleave handlers must have an ARIA role
12:26:37 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/RangeSlider.svelte:223:2 A11y: <div> with mouseenter, mouseleave, dblclick handlers must have an ARIA role
12:26:37 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/RangeSlider.svelte:244:2 A11y: <div> with mouseenter, mouseleave, dblclick handlers must have an ARIA role
12:26:37 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/RangeSlider.svelte:263:2 A11y: <div> with mouseenter, mouseleave, dblclick handlers must have an ARIA role
12:26:37 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/RangeSlider.svelte:198:0 A11y: <div> with click, keydown handlers must have an ARIA role
12:26:37 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/lib/components/Tilt.svelte:31:0 A11y: <div> with mousemove, mouseleave handlers must have an ARIA role
12:26:45 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/routes/docs/components/SelectField/+page.svelte:440:10 A11y: visible, non-interactive elements with an on:click event must be accompanied by a keyboard event handler. Consider whether an interactive element such as <button type="button"> or <a> might be more appropriate. See https://svelte.dev/docs/accessibility-warnings#a11y-click-events-have-key-events for more details.
12:26:45 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/routes/docs/components/SelectField/+page.svelte:440:10 A11y: <div> with click handler must have an ARIA role
12:26:45 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/routes/docs/components/SelectField/+page.svelte:504:6 A11y: visible, non-interactive elements with an on:click event must be accompanied by a keyboard event handler. Consider whether an interactive element such as <button type="button"> or <a> might be more appropriate. See https://svelte.dev/docs/accessibility-warnings#a11y-click-events-have-key-events for more details.
12:26:45 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/routes/docs/components/SelectField/+page.svelte:504:6 A11y: <div> with click handler must have an ARIA role
12:26:45 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/routes/docs/components/SelectField/+page.svelte:617:6 A11y: visible, non-interactive elements with an on:click event must be accompanied by a keyboard event handler. Consider whether an interactive element such as <button type="button"> or <a> might be more appropriate. See https://svelte.dev/docs/accessibility-warnings#a11y-click-events-have-key-events for more details.
12:26:45 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/routes/docs/components/SelectField/+page.svelte:617:6 A11y: <span> with click handler must have an ARIA role
12:26:45 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/routes/docs/components/SelectField/+page.svelte:760:4 A11y: visible, non-interactive elements with an on:click event must be accompanied by a keyboard event handler. Consider whether an interactive element such as <button type="button"> or <a> might be more appropriate. See https://svelte.dev/docs/accessibility-warnings#a11y-click-events-have-key-events for more details.
12:26:45 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/routes/docs/components/SelectField/+page.svelte:760:4 A11y: <div> with click handler must have an ARIA role
12:26:45 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/routes/docs/components/SelectField/+page.svelte:869:4 A11y: visible, non-interactive elements with an on:click event must be accompanied by a keyboard event handler. Consider whether an interactive element such as <button type="button"> or <a> might be more appropriate. See https://svelte.dev/docs/accessibility-warnings#a11y-click-events-have-key-events for more details.
12:26:45 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/routes/docs/components/SelectField/+page.svelte:869:4 A11y: <span> with click handler must have an ARIA role
12:26:47 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/routes/docs/components/Switch/+page.svelte:52:4 A11y: A form label must be associated with a control.
12:26:47 PM [vite-plugin-svelte] /Users/techniq/Documents/Development/open-source/svelte-ux/packages/svelte-ux/src/routes/docs/components/Switch/+page.svelte:56:4 A11y: A form label must be associated with a control.
@jycouet
Copy link
Collaborator

jycouet commented May 6, 2024

in user land, if you add in svelte.config.js the function onwarn:

/** @type {import('@sveltejs/kit').Config} */
const config = {
	// ...

	onwarn(warning, defaultHandler) {
		// Do not show 3rd party warnings
		if (warning.filename.includes('node_modules')) return

		defaultHandler(warning)
	},

	// ...
}

export default config

I find it nice until it's "fixed" 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants