eslint-plugin-unicorn
eslint-plugin-unicorn copied to clipboard
[text-encoding-identifier-case] false positive when using Remix and its HtmlMetaDescriptor that requires 'utf-8'
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?