jsx-eslint / eslint-plugin-jsx-a11y

Static AST checker for a11y rules on JSX elements.
MIT License
3.38k stars 637 forks source link

[img-redundant-alt] `words` option does not work with double-byte character words. #969

Closed makotot closed 8 months ago

makotot commented 8 months ago

If a multibyte character is specified in words option, the corresponding character is not treated as an error. This may be due to the fact that word boundary \b do not support multibyte characters.

For example, in Japanese, "image" can be written as "イメージ". However, specifying this in option words is not treated as an error.

    'jsx-a11y/img-redundant-alt': ['error', {
      words: ['イメージ'],
    }],
      <img src='path/to/image.jpg' alt="イメージ" />