Skip to content

Commit

Permalink
Add JSHint ESLint config (#12840)
Browse files Browse the repository at this point in the history
* Add ESLint JSHint config

* Update packages/eslint-plugin/README.md

Co-Authored-By: ntwb <[email protected]>
  • Loading branch information
ntwb authored and gziolo committed Dec 19, 2018
1 parent 2934d6c commit 0484bc3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/eslint-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,14 @@ These rules can be used additively, so you could extend both `esnext` and `custo

The granular rulesets will not define any environment globals. As such, if they are required for your project, you will need to define them yourself.

#### Legacy

If you are using WordPress' `.jshintrc` JSHint configuration and you would like to take the first step to migrate to an ESLint equivalent it is also possible to define your own project's `.eslintrc` file as:

```json
{
"extends": [ "plugin:@wordpress/eslint-plugin/jshint" ]
}
```

<br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
17 changes: 17 additions & 0 deletions packages/eslint-plugin/configs/jshint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
rules: {
curly: 'error',
eqeqeq: 'error',
'no-caller': 'error',
'no-cond-assign': [ 'error', 'except-parens' ],
'no-eq-null': 'error',
'no-irregular-whitespace': 'error',
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-unused-expressions': 'error',
'no-unused-vars': 'error',
'one-var': [ 'error', 'always' ],
quotes: [ 'error', 'single' ],
'wrap-iife': [ 'error', 'any' ],
},
};

0 comments on commit 0484bc3

Please sign in to comment.