0.0.4 • Published 5 years ago

eslint-plugin-bricks v0.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

eslint-plugin-bricks

Bricks模板语法检查

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-bricks:

$ npm install eslint-plugin-bricks --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-bricks globally.

Usage

Add bricks to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "bricks"
    ],
    "extends": [
        "eslint:recommended",
        "plugin:eslint-plugin-bricks/recommended"
    ],
}

如果使用vscode,需要关闭再重新打开工程

Supported Rules

bk-template-expression

校验表达式exp是否符合javscript的表达式语法

  • "{{#if exp}}"
  • "{{#elseif exp}}"
  • "{{#each exp}}"
  • "#if":"exp"
  • "#elseif":"exp"
  • "#each":"exp"
  • "key":"{{exp}}{{exp}}..."

bk-template-grammar

校验语法

  • 校验条件语句语法
  • 校验循环语句语法