ESLint custom rules by Open Reach Tech.
npm install eslint-plugin-openreachtech* This is ESLint plugin by Open Reach Tech.
* As of March 2022, the following ESLint rules are packed.
```
empty-line-after-super
indent-in-infix-expression
newline-per-parameter
no-else-if
no-if-in-oneline
no-unexpected-multiline
1. Install
``
npm install --save-dev eslint-plugin-openreachtech
2. Update .eslintrc settings in your application package.
`
...
plugins:
- openreachtech
...
rules:
openreachtech/empty-line-after-super: error
openreachtech/indent-in-infix-expression: error
openreachtech/newline-per-parameter: error
openreachtech/no-else-if: error
openreachtech/no-if-in-oneline: error
openreachtech/no-unexpected-multiline: error
...
`
* Error Message.
`
% npx eslint .
/your/project/directory/target-file.js
129:3 18:5 error Require empty line between super call and other statements empty-line-after-super
/your/project/directory/target-file.js
21:20 error Must add indent before "-" indent-in-infix-expression
24:21 error Must remove indent before "-" indent-in-infix-expression
31:20 error Must add indent before right operand of "+" indent-in-infix-expression
34:21 error Must remove indent before right operand of "-" indent-in-infix-expression
/your/project/directory/target-file.js
9:8 error Never use else-if statement openreachtech/no-else-if
`
* empty-line-after-super [English] [日本語]indent-in-infix-expression
* [English] [日本語]newline-per-parameter
* [English] [日本語]no-else-if
* [English] [日本語]no-if-in-oneline
* [English] [日本語]no-unexpected-multiline` [English] [日本語]
*