1.1.8 • Published 5 years ago
eslint-plugin-attributes v1.1.8
eslint-plugin-attributes
html标签属性数量过多时需换行
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-attributes:
$ npm install eslint-plugin-attributes --save-devNote: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-attributes globally.
Usage
Add attributes to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"attributes"
]
}Use default by extends option
{
"extends": [
"plugin:attributes/base"
]
}Or configure the rules you want to use under the rules section.
{
"rules": {
"attributes/rule-name": 2
}
}Supported Rules
| Rule | Default | Options | Description |
|---|---|---|---|
max-attributes | 2 | [2, { max: 3, attrStrLimit: 50 }] | html标签属性数量过多时需换行,支持自动修复。若属性过少换行也会自动修复为一行。单个属性长度超出attrStrLimit时,即使属性较少也要换行。 |
max-attribute-value-logical | 1 | [1, { max: 2 }] | 属性上逻辑操作符出现的次数限制 |
1.1.8
5 years ago
1.1.7
5 years ago
1.1.6
5 years ago
1.1.5
6 years ago
1.1.4
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.11
6 years ago
1.0.10
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.2
6 years ago
1.0.3
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago
0.0.17
6 years ago