1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Svelteでnpm run dev時に出る警告ログの消し方

Posted at

はじめに

Svelte.js、Sapperなどでnpm run devなどでコードの書き方で警告表示がされることがあるかとおもいます。一番いいのは勿論コードを修正することですが、特に問題ない場合そのままにしておきたい、でも警告が邪魔って思う時があるかと思うので今回はその時の対応方法を紹介します。

svelte-ignore

コメントにsvelte-ignore追加することでアクセスシビリティルール(a11y)を無視することが出来ます。

<!-- svelte-ignore a11y-rule -->

実際に警告を消してみる

<script>
	let name = 'world';
</script>

<h1>Hello {name}!</h1>
<!-- svelte-ignore a11y-label-has-associated-control -->
<label>test</label>
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?