Skip to content

Commit

Permalink
Rename some keywords according stylelint's new names
Browse files Browse the repository at this point in the history
at-rule-nested-empty-line-before
"blockless-group" → "blockless-after-blockless"

comment-empty-line-before
"between-comments" → "after-comment"
"stylelint-commands" → "stylelint-command"

stylelint/stylelint#1663 (comment)
9
  • Loading branch information
hudochenkov committed Jan 8, 2017
1 parent e25ef72 commit af21204
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ function plugin(css, opts) {

// Optionally ignore the expectation if the node is blockless
if (
checkOption(optionName, 'ignore', 'blockless-group')
checkOption(optionName, 'ignore', 'blockless-after-blockless')
&& isBlocklessAfterBlockless()
) {
return;
Expand Down Expand Up @@ -615,7 +615,7 @@ function plugin(css, opts) {
}

if (
checkOption(optionName, 'except', 'blockless-group')
checkOption(optionName, 'except', 'blockless-after-blockless')
&& isBlocklessAfterBlockless()
) {
expectEmptyLineBefore = !expectEmptyLineBefore;
Expand Down Expand Up @@ -728,7 +728,7 @@ function plugin(css, opts) {
// Optionally ignore stylelint commands
if (
comment.text.indexOf('stylelint-') === 0
&& checkOption(optionName, 'ignore', 'stylelint-commands')
&& checkOption(optionName, 'ignore', 'stylelint-command')
) {
return;
}
Expand All @@ -739,7 +739,7 @@ function plugin(css, opts) {
if (
prev
&& prev.type === 'comment'
&& checkOption(optionName, 'ignore', 'between-comments')
&& checkOption(optionName, 'ignore', 'after-comment')
) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/validateOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ function validateAtRuleNestedEmptyLineBefore(options) {

if (!validateSecondaryOptions({
options,
exceptPossible: ['blockless-after-same-name-blockless', 'blockless-group', 'first-nested', 'after-same-name'],
ignorePossible: ['blockless-after-same-name-blockless', 'blockless-group', 'after-comment'],
exceptPossible: ['blockless-after-same-name-blockless', 'blockless-after-blockless', 'first-nested', 'after-same-name'],
ignorePossible: ['blockless-after-same-name-blockless', 'blockless-after-blockless', 'after-comment'],
})) {
return false;
}
Expand Down Expand Up @@ -381,7 +381,7 @@ function validateCommentEmptyLineBefore(options) {
if (!validateSecondaryOptions({
options,
exceptPossible: ['first-nested'],
ignorePossible: ['between-comments', 'stylelint-commands'],
ignorePossible: ['after-comment', 'stylelint-command'],
})) {
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions test/at-rule-nested-empty-line-before.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ groupTest([
},
{
options: {
'at-rule-nested-empty-line-before': [true, { except: ['blockless-group'] }]
'at-rule-nested-empty-line-before': [true, { except: ['blockless-after-blockless'] }]
},
cases: mergeTestCases(sharedAlwaysTests, [
{
Expand Down Expand Up @@ -188,7 +188,7 @@ groupTest([
},
{
options: {
'at-rule-nested-empty-line-before': [true, { ignore: ['blockless-group'] }]
'at-rule-nested-empty-line-before': [true, { ignore: ['blockless-after-blockless'] }]
},
cases: mergeTestCases(sharedAlwaysTests, [
{
Expand Down Expand Up @@ -268,7 +268,7 @@ groupTest([
},
{
options: {
'at-rule-nested-empty-line-before': [false, { except: ['blockless-group'] }]
'at-rule-nested-empty-line-before': [false, { except: ['blockless-after-blockless'] }]
},
cases: mergeTestCases(sharedNeverTests, [
{
Expand Down Expand Up @@ -326,7 +326,7 @@ groupTest([
},
{
options: {
'at-rule-nested-empty-line-before': [false, { ignore: ['blockless-group'] }]
'at-rule-nested-empty-line-before': [false, { ignore: ['blockless-after-blockless'] }]
},
cases: [
{
Expand Down
4 changes: 2 additions & 2 deletions test/comment-empty-line-before.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ groupTest([
},
{
options: {
'comment-empty-line-before': [true, { ignore: ['stylelint-commands'] }]
'comment-empty-line-before': [true, { ignore: ['stylelint-command'] }]
},
cases: mergeTestCases(sharedAlwaysTests, [
{
Expand All @@ -96,7 +96,7 @@ groupTest([
},
{
options: {
'comment-empty-line-before': [true, { ignore: ['between-comments'] }]
'comment-empty-line-before': [true, { ignore: ['after-comment'] }]
},
cases: [
{
Expand Down
6 changes: 3 additions & 3 deletions test/validate-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ testConfig({
config: {
'at-rule-nested-empty-line-before': [
{
except: ['blockless-group'],
except: ['blockless-after-blockless'],
},
],
},
Expand All @@ -844,7 +844,7 @@ testConfig({
'at-rule-nested-empty-line-before': [
false,
{
except: ['blockless-group'],
except: ['blockless-after-blockless'],
},
],
},
Expand All @@ -857,7 +857,7 @@ testConfig({
'at-rule-nested-empty-line-before': [
true,
{
except: ['blockless-group-sdfsffsd'],
except: ['blockless-after-blockless-sdfsffsd'],
},
],
},
Expand Down

0 comments on commit af21204

Please sign in to comment.