To overcome JS errors and maintain quality for JS files as per the coding standards defined by WordPress, we have introduced ESLint in the upcoming release 1.8.12.
How to Configure ESLint
We’ve packaged Give Core with the ESLint config file. So, you need to worry much about it and just follow simple steps once and you’re done!
Step 1: Install Node Modules as defined in Give’s package.json
$ npm install
Step 2: Using ESLint
- Open Terminal
- Type Command in format: eslint [options] file.js [file.js] [dir]
- You’ll get list of suggestions, if any:
$ eslint yourfile.js
With PHPStorm… please read on:
Configuring PHPStorm with ESLint
We use PHPStorm as our IDE of choice. If you use it as well, follow the below steps to configure ESLint with PHPStorm:
- Now, Tick the Enable checkbox.
- Set path for Node Interpreter and the ESLint Package, if it is not set by default.