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

Commit

Permalink
Fix: rename "requireCapitalizedComments" option
Browse files Browse the repository at this point in the history
Since it was never documented, we consider it to be backcompat

Fixes #1853
  • Loading branch information
markelog committed Oct 22, 2015
1 parent 5ee3120 commit 077c2f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/rules/require-capitalized-comments.js
Expand Up @@ -124,7 +124,7 @@ module.exports.prototype = {

var isObject = typeof options === 'object';
var error = optionName + ' option requires a true value ' +
'or an object with String[] `allExcept` property or true with `ignoreIfInTheMiddle`';
'or an object with String[] `allExcept` property or true with `inlined`';

assert(
options === true ||
Expand All @@ -149,11 +149,11 @@ module.exports.prototype = {
this._isPragma = isPragma();
}

if (isObject && options.ignoreIfInTheMiddle) {
if (isObject && options.inlined) {
this.inlined = true;
}

if (isObject && !options.allExcept && !options.ignoreIfInTheMiddle) {
if (isObject && !options.allExcept && !options.inlined) {
assert(false, error);
}
},
Expand Down
2 changes: 1 addition & 1 deletion presets/jquery.json
Expand Up @@ -69,7 +69,7 @@
},
"requirePaddingNewLinesBeforeLineComments": true,
"requireCapitalizedComments": {
"ignoreIfInTheMiddle": true
"inlined": true
},
"validateLineBreaks": "LF",

Expand Down
8 changes: 4 additions & 4 deletions test/specs/rules/require-capitalized-comments.js
Expand Up @@ -198,11 +198,11 @@ describe('rules/require-capitalized-comments', function() {
});
});

describe('ignoreIfInTheMiddle: true', function() {
describe('inlined: true', function() {
beforeEach(function() {
checker.configure({
requireCapitalizedComments: {
ignoreIfInTheMiddle: true
inlined: true
}
});
});
Expand Down Expand Up @@ -233,11 +233,11 @@ describe('rules/require-capitalized-comments', function() {
}).to.throw('AssertionError');
});

it('ignoreIfInTheMiddle: false', function() {
it('inlined: false', function() {
expect(function() {
checker.configure({
requireCapitalizedComments: {
ignoreIfInTheMiddle: false
inlined: false
}
});
}).to.throw('AssertionError');
Expand Down

0 comments on commit 077c2f6

Please sign in to comment.