eslint-plugin-newsdesk
Custom rules specific to the Newsdesk application
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-newsdesk
:
$ npm install eslint-plugin-newsdesk --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-newsdesk
globally.
Usage
Add newsdesk
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
Then configure the rules you want to use under the rules section.
Supported Rules
- newsdesk/use-sinon-sandbox: use
localSandbox
fromtestUtils
to create a sandbox and prevent the direct use ofsinon.spy
,sinon.stub
,sinon.mock
,sinon.clock
, orsinon.server
.localSandbox
restores itself upon completion of the test file.