Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 896 Bytes

text-encoding-identifier-case.md

File metadata and controls

39 lines (28 loc) · 896 Bytes

Enforce consistent case for text encoding identifiers

This rule is part of the recommended config.

💡 This rule provides suggestions.

  • Enforce 'utf8' for UTF-8 encoding.
  • Enforce 'ascii' for ASCII encoding.

Fail

await fs.readFile(file, 'UTF-8');
await fs.readFile(file, 'ASCII');
const string = buffer.toString('utf-8');

Pass

await fs.readFile(file, 'utf8');
await fs.readFile(file, 'ascii');
const string = buffer.toString('utf8');