0.0.2 • Published 7 years ago
eslint-plugin-socket-io v0.0.2
eslint-plugin-socket-io
ESLint rules for Socket.io.
Installation
You'll first need to install ESLint:
$ npm install eslint --save-devNext, install eslint-plugin-socket-io:
$ npm install @lixar/eslint-plugin-socket-io --save-devNote: If you installed ESLint globally (using the -g flag) then you must
also install eslint-plugin-socket-io globally.
Usage
Add socket-io to the plugins section of your .eslintrc.json configuration
file. You can omit the eslint-plugin- prefix:
{
"plugins": ["socket-io"]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"socket-io/no-public-emit": 1
}
}or start with the recommended rule set:
{
"extends": ["plugin:socket-io/recommended"]
}Rules
| rule | description | recommended | fixable |
|---|---|---|---|
no-public-emit | Forbids the broadcasting of public messages | :bangbang: |
Key
| icon | description |
|---|---|
| :bangbang: | Reports as error in recommended configuration |
| :warning: | Reports as warning in recommended configuration |
| :seven: | ES2017 Async Await rules |
| :wrench: | Rule is fixable with eslint --fix |