Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tildah/eslint-plugin-zinky
eslint plugin for ZinkyJS specificities
https://github.com/tildah/eslint-plugin-zinky
Last synced: about 2 months ago
JSON representation
eslint plugin for ZinkyJS specificities
- Host: GitHub
- URL: https://github.com/tildah/eslint-plugin-zinky
- Owner: tildah
- Created: 2020-04-07T14:43:24.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T20:04:40.000Z (about 2 years ago)
- Last Synced: 2023-02-27T22:48:51.983Z (almost 2 years ago)
- Language: JavaScript
- Size: 292 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eslint-plugin-zinky
this plugin is aimed to contain eslint rules specific to ZinkyJS
## Installation
You'll first need to install [ESLint](http://eslint.org):
```
npm i eslint --save-dev
```Next, install `eslint-plugin-zinky`:
```
npm install eslint-plugin-zinky --save-dev
```**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-zinky` globally.
## Usage
Add `zinky` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": [
"zinky"
]
}
```Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"zinky/rule-name": 2
}
}
```## Supported Rules
### `id-length`
This rule behaves just like [`id-length`](https://eslint.org/docs/rules/id-length) native rule, taking into account, however, some ZinkyJS specificities.
1. Skips method prefixes in operations (`GET_`, `POST_`, ...)
2. Does not check `BEFORE` and `AFTER` hooks.*NOTE: You should not use [`id-length`](https://eslint.org/docs/rules/id-length) alongside this rule.*
Code example:
```javascript
/*eslint zinky/id-length: ["error", { "max": 5 }]*/GET_abc() {} // ✔ is VALID because "abc" has a length less than 5
GET_abcdef() {} // ✘ is NOT VALID because "abcdef" has a length greater than 5
BEFORE_GET_abcdef() // ✔ does NOT cause an ERROR. Because it will not be checked
```