eslint-plugin-relativepath
v1.0.0
Published
Only support absolute paths when importing new modules
Downloads
3
Maintainers
Readme
- Relative Path eslint plugin
Only support absolute paths when importing new modules
** Installation
You'll first need to install [[http://eslint.org][ESLint]]:
#+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
- [[http://eslint.org/docs/developer-guide/working-with-plugins][Create plugins for Eslint]]
- [[https://www.npmjs.com/package/generator-eslint][Eslint plugin code generator]]