Skip to content

Commit

Permalink
Merge pull request #169 from humanmade/153-enforce-semicolons
Browse files Browse the repository at this point in the history
ESLint Enforce semicolons
  • Loading branch information
mikeselander committed Jan 6, 2020
2 parents b260396 + 07a30eb commit cc23bd6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Unreleased (0.8.0)

### Added:
- Enforce semicolons in JS #169
- Added `WordPress.Security.EscapeOutput` PHPCS rule #166

### Updated
Expand Down
14 changes: 14 additions & 0 deletions packages/eslint-config-humanmade/fixtures/fail/semicolon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-disable no-unused-vars */

// Missing semicolon.
const testMissingSemicolon = 'foo'

// Incorrect space before semicolon.
const testSemiSpacing = 'bar' ;

// Double semicolon.
const testDoubleSemiColon = 5;;

const testFunc = function () {
// ...
}
11 changes: 11 additions & 0 deletions packages/eslint-config-humanmade/fixtures/pass/semicolon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable no-unused-vars */

// Missing semicolon.
const testMissingSemicolon = 'foo';

// Double semicolon.
const testDoubleSemiColon = 5;

const testFunc = function () {
// ...
};
1 change: 1 addition & 0 deletions packages/eslint-config-humanmade/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module.exports = {
'object-curly-spacing': [ 'error', 'always' ],
'object-property-newline': [ 'error' ],
'quotes': [ 'error', 'single' ],
'semi': [ 'error', 'always' ],
'semi-spacing': [ 'error', {
'before': false,
'after': true,
Expand Down

0 comments on commit cc23bd6

Please sign in to comment.