Require or disallow semicolons instead of ASI

  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

This rule enforces consistent use of semicolons.

This rule extends the base ESLint's semi rule. The semi rule does not understand frontmatter fence tokens (---), so using the never option in the semi rule will result in a false negative. This rule supports astro-eslint-parser's AST and tokens.


with "never" option:

🔧 Options

  "semi": "off", // Don't need ESLint's semi, so turn it off.
  "astro/semi": [
    "always", // or "never"
    { "omitLastInOneLineBlock": true }
    // or { "beforeStatementContinuationChars": "any" | "always" | "never" }

Same as semi rule option. See here for details.

🚀 Version

This rule was introduced in eslint-plugin-astro v0.19.0

🔍 Implementation

Taken with ❤️ from ESLint core

Edit this page