eslint-plugin-relativepath v1.0.0
- Relative Path eslint plugin
Only support absolute paths when importing new modules
** Installation
You'll first need to install [http://eslint.org]:
#+BEGIN_SRC shell $ npm i eslint --save-dev #+END_SRC
Next, install ~eslint-plugin-relativepath~:
#+BEGIN_SRC shell $ npm install eslint-plugin-relativepath --save-dev #+END_SRC
Note: If you installed ESLint globally (using the ~-g~ flag) then you must also install ~eslint-plugin-relativepath~ globally.
** Usage
Add ~relativepath~ to the plugins section of your ~.eslintrc~ configuration file. You can omit the ~eslint-plugin-~ prefix:
#+BEGIN_SRC javascript { "plugins": "relativepath" } #+END_SRC
Then configure the rules you want to use under the rules section.
#+BEGIN_SRC javascript { "rules": { "relativepath/norelativepath": 2 } } #+END_SRC
** Supported Rules
| Name | Action | |----------------+----------------------| | norelativepath | Avoid relative paths |
** Additional references
9 years ago