Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
Merge 1e0361d into 5a6fe27
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo committed Mar 22, 2016
2 parents 5a6fe27 + 1e0361d commit 949f255
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 129 deletions.
3 changes: 2 additions & 1 deletion lib/rules/disallow-empty-blocks.js
Expand Up @@ -93,7 +93,8 @@ module.exports.prototype = {
if (node.parentElement.type !== 'CatchClause' &&
node.parentElement.type !== 'FunctionDeclaration' &&
node.parentElement.type !== 'FunctionExpression' &&
node.parentElement.type !== 'ArrowFunctionExpression') {
node.parentElement.type !== 'ArrowFunctionExpression' &&
node.parentElement.type !== 'ObjectMethod') {
errors.add('Empty block found', node.lastChild);
}
});
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/validate-quote-marks.js
Expand Up @@ -116,7 +116,9 @@ module.exports.prototype = {
file.iterateTokensByType('String', function(token) {
if (
ignoreJSX &&
token.parentElement.type === 'StringLiteral' &&
// TODO: fix in CST?
(token.parentElement.type === 'Literal' ||
token.parentElement.type === 'StringLiteral') &&
token.parentElement.parentElement.type === 'JSXAttribute'
) {
return;
Expand Down
125 changes: 0 additions & 125 deletions lib/visitor-keys.js

This file was deleted.

4 changes: 4 additions & 0 deletions test/specs/rules/disallow-empty-blocks.js
Expand Up @@ -141,6 +141,10 @@ describe('rules/disallow-empty-blocks', function() {
expect(checker.checkString('(a) => {}')).to.have.no.errors();
});

it('should not report empty object method', function() {
expect(checker.checkString('var a = { b() {} }')).to.have.no.errors();
});

describe('allExcept: ["comments"]', function() {
beforeEach(function() {
checker = new Checker();
Expand Down
1 change: 1 addition & 0 deletions test/specs/rules/disallow-spaces-in-generator.js
Expand Up @@ -160,6 +160,7 @@ describe('rules/disallow-spaces-in-generator', function() {
output: 'var x = function*asdf(){}'
});

// TODO: fix in CST
reportAndFix({
name: 'should report illegal space after the star for the shorthand',
rules: rules,
Expand Down
3 changes: 2 additions & 1 deletion test/specs/rules/require-spaces-in-generator.js
Expand Up @@ -2,7 +2,7 @@ var Checker = require('../../../lib/checker');
var expect = require('chai').expect;
var reportAndFix = require('../../lib/assertHelpers').reportAndFix;

describe('rules/require-spaces-in-generator', function() {
describe.only('rules/require-spaces-in-generator', function() {
var checker;
beforeEach(function() {
checker = new Checker();
Expand Down Expand Up @@ -90,6 +90,7 @@ describe('rules/require-spaces-in-generator', function() {
output: 'var x = function * asdf(){}'
});

// TODO: fix in CST
reportAndFix({
name: 'should report missing space after the star for the shorthand',
rules: rules,
Expand Down
4 changes: 3 additions & 1 deletion test/specs/string-checker.js
Expand Up @@ -376,7 +376,9 @@ describe('string-checker', function() {
});
});

describe.skip('presets', function() {
describe('presets', function() {
this.timeout(15000);

testPreset('airbnb');
testPreset('crockford');
testPreset('google');
Expand Down

0 comments on commit 949f255

Please sign in to comment.