1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 1× 103× 101× 2× 1× | /** * @file rule: no-bom * @author chris<wfsr@foxmail.com> */ module.exports = { name: 'no-bom', desc: 'HTML file should save with UTF-8 encoding without BOM.', target: 'parser', lint: function (getCfg, parser, reporter, code) { if (!getCfg()) { return; } if (code.charCodeAt(0) === 0xFEFF) { reporter.warn(0, '046', 'Unexpected Unicode BOM (Byte Order Mark).'); } } }; |