Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSHint ESLint config #12840

Merged
merged 2 commits into from
Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

An ESLint equivalent of WordPress' `.jshintrc` JSHint configuration is also available by defining 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' ],
},
};