astro/semi

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.

Default:

with "never" option:

πŸ”§ Options

{
  "semi": "off", // Don't need ESLint's semi, so turn it off.
  "astro/semi": [
    "error", 
    "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