ESLint plugin with ast-grep.
npm i -D eslint-plugin-ast-grep
no-restricted-syntaxRestricts syntaxes specified by ast-grep. Inspired by no-restricted-syntax from ESLint core.
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."
}
]
}
}
JavaScript
100.0%
ESLint plugin with ast-grep.
npm i -D eslint-plugin-ast-grep
no-restricted-syntaxRestricts syntaxes specified by ast-grep. Inspired by no-restricted-syntax from ESLint core.
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."
}
]
}
}
JavaScript
100.0%