sosukesuzuki/eslint-plugin-ast-grep

JavaScript

47

0 commits

updated Nov 15, 2024

See the code

README

eslint-plugin-ast-grep

ESLint plugin with ast-grep.

Installation

npm i -D eslint-plugin-ast-grep

Requirements

  • ESLint 9.0.0
  • ast-grep 0.3.0

Rules

no-restricted-syntax

Restricts syntaxes specified by ast-grep. Inspired by no-restricted-syntax from ESLint core.

Options

This rule takes a list of strings, where each string is an ast-grep pattern:

{
  "rules": {
    "ast-grep/no-restricted-syntax": ["error", "console.log", "console.warn"]
  }
}

Alternatively, the rule also accepts objects, where the pattern and an optional custom message are specified:

{
  "rules": {
    "no-restricted-syntax": [
      "error",
      {
        "pattern": "console.log",
        "message": "console.log is not allowed."
      }
    ]
  }
}

sosukesuzuki/eslint-plugin-ast-grep

JavaScript

47

0 commits

updated Nov 15, 2024

See the code

README

eslint-plugin-ast-grep

ESLint plugin with ast-grep.

Installation

npm i -D eslint-plugin-ast-grep

Requirements

  • ESLint 9.0.0
  • ast-grep 0.3.0

Rules

no-restricted-syntax

Restricts syntaxes specified by ast-grep. Inspired by no-restricted-syntax from ESLint core.

Options

This rule takes a list of strings, where each string is an ast-grep pattern:

{
  "rules": {
    "ast-grep/no-restricted-syntax": ["error", "console.log", "console.warn"]
  }
}

Alternatively, the rule also accepts objects, where the pattern and an optional custom message are specified:

{
  "rules": {
    "no-restricted-syntax": [
      "error",
      {
        "pattern": "console.log",
        "message": "console.log is not allowed."
      }
    ]
  }
}

Languages

JavaScript

100.0%