### Required

[\[1\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L33-L33)[\[2\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L464-L464)[\[3\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L468-L468)
Use sentence case for UI text.

[\[1\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L55-L55)
Unexpected aliasing of 'this' to local variable.

[\[1\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L142-L142)[\[2\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L211-L211)[\[3\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L212-L212)[\[4\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L214-L214)
Unexpected any. Specify a different type.

[\[1\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L223-L223)[\[2\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L224-L224)
Unexpected var, use let or const instead.

[\[1\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L270-L270)[\[2\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L279-L279)
Unexpected console statement. Only these console methods are allowed: warn, error, debug.

[\[1\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L307-L307)[\[2\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L416-L416)
Avoid setting styles directly via `element.style.fontWeight`. Use CSS classes for better theming and maintainability.

[\[1\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L308-L308)[\[2\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L417-L417)
Avoid setting styles directly via `element.style.marginRight`. Use CSS classes for better theming and maintainability.

[\[1\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L464-L464)
Use `new Setting(containerEl).setName(...).setHeading()` instead of creating HTML heading elements directly.



---

### Optional

[\[1\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L55-L55)
'self' is assigned a value but never used.

[\[1\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L99-L99)[\[2\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L174-L174)
'e' is defined but never used.

[\[1\]](https://github.com/zhangfuwen/auto-number-headings/blob/a4e1870455a68a0601b9980c99f9b1a13bb2136f/main.ts#L224-L224)
'lastLevel' is assigned a value but never used.

