no_bom
Flag a leading UTF-8 / UTF-16 LE/BE / UTF-32 LE/BE byte-order mark. The fixer strips whichever BOM is detected.
As of v0.18, the fixer strips only a leading UTF-8 BOM (a stacked run of them in one pass); a UTF-16 / UTF-32 BOM is reported but not auto-fixed, since removing it without transcoding the file would corrupt it (the byte-level text fixers likewise leave UTF-16 / UTF-32 files alone).
Options
Section titled "Options"This rule takes no kind-specific options.
Plus the common paths, level, id, when, scope_filter, fix, and expect_matches fields. This table is generated from the JSON Schema; option types and defaults are authoritative.
Example
Section titled "Example"A Markdown file that opens with a UTF-8 byte-order mark
Section titled "A Markdown file that opens with a UTF-8 byte-order mark"The rule fires on this repository:
- docs/
- docs/clean.md✓
- docs/with_bom.md
⚠ warning no-bom
1:1 file begins with a UTF-8 BOM
# hi<U+FEFF># hiWith this .alint.yml:
version: 1rules: - id: no-bom kind: no_bom paths: "docs/**/*.md" level: warningalint check reports:
--- docs/with_bom.md ----------------------------------------------------------- ! warning no-bom 1:1 file begins with a UTF-8 BOM
Summary (1 violation): ! 1 warning 0 passing * 1 failingMarkdown files saved as plain UTF-8 with no BOM
Section titled "Markdown files saved as plain UTF-8 with no BOM"This repository is compliant:
- docs/
- docs/a.md✓
- docs/b.md✓
# hicontentWith this .alint.yml:
version: 1rules: - id: no-bom kind: no_bom paths: "docs/**/*.md" level: warningalint check reports:
v All 1 rule(s) passed.