Refactor to improve types for `no-extra-semicolons` rule (#5768)
Refactor to improve types for `no-extra-semicolons` rule (#5768)

- Remove `// @ts-nocheck` to enable type-checking.
- Narrow the scope of some local variables.
stylelint/stylelint,stylelint/stylelint,stylelint/stylelint,stylelint/stylelint