eslint-plugin-unicorn icon indicating copy to clipboard operation
eslint-plugin-unicorn copied to clipboard

[text-encoding-identifier-case] false positive when using Remix and its HtmlMetaDescriptor that requires 'utf-8'

Open jakubmazanec opened this issue 1 year ago • 0 comments

When using Remix framework, rule text-encoding-identifier-case reports error:

import type {MetaFunction} from '@remix-run/node';

/* ... */

export const meta: MetaFunction = () => ({
  charset: 'utf-8', // <- text-encoding-identifier-case error here
});

export default function App() {
  /* ... */
}

This is false positive, since MetaFunction returns type HtmlMetaDescriptor, which has property charset with string literal type 'utf-8' (AFAIK correctly, because of <meta charset="utf-8">).

Can some exception be added to the text-encoding-identifier-case rule? Or maybe somehow use the available type information?

jakubmazanec avatar Aug 06 '22 16:08 jakubmazanec