Skip to content

Commit

Permalink
Revert deprecation of stylelint-commands option (#2302)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeddy3 authored and davidtheclark committed Jan 29, 2017
1 parent 7aa2282 commit 09955dd
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 62 deletions.
6 changes: 2 additions & 4 deletions lib/rules/comment-empty-line-before/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ a {
}
```

### `ignore: ["after-comment", "stylelint-command"]`
### `ignore: ["after-comment", "stylelint-commands"]`

#### `"after-comment"`

Expand Down Expand Up @@ -126,9 +126,7 @@ a {
}
```

#### `"stylelint-command"`

***Note: This option was previously called `stylelint-commands`. See [the release planning docs](http://stylelint.io/user-guide/release-planning/) for details.***
#### `"stylelint-commands"`

Ignore comments that deliver commands to stylelint, e.g. `/* stylelint-disable color-no-hex */`.

Expand Down

This file was deleted.

10 changes: 0 additions & 10 deletions lib/rules/comment-empty-line-before/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,6 @@ testRule(rule, mergeTestDescriptions(alwaysTests, {
}],
}))

testRule(rule, mergeTestDescriptions(alwaysTests, {
ruleName,
config: [ "always", { ignore: ["stylelint-command"] } ],

accept: [{
code: "a {\ncolor: pink;\n/* stylelint-disable something */\ntop: 0;\n}",
description: "no newline before a stylelint command comment",
}],
}))

testRule(rule, {
ruleName,
config: [ "always", { ignore: ["between-comments"] } ],
Expand Down
14 changes: 0 additions & 14 deletions lib/rules/comment-empty-line-before/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,6 @@ const rule = function (expectation, options) {
})
}

if (
optionsMatches(options, "ignore", "stylelint-commands")
) {
result.warn((
"'comment-empty-line-before\'s' \"stylelint-commands\" option has been deprecated and in 8.0 will be removed. " +
"Instead use the \"stylelint-command\" option."
), {
stylelintType: "deprecation",
stylelintReference: "http://stylelint.io/user-guide/rules/comment-empty-line-before/",
})
}

root.walkComments(comment => {
// Ignore the first node
if (comment === root.first) {
Expand All @@ -74,8 +62,6 @@ const rule = function (expectation, options) {
if (
comment.text.indexOf(stylelintCommandPrefix) === 0
&& optionsMatches(options, "ignore", "stylelint-commands")
|| comment.text.indexOf(stylelintCommandPrefix) === 0
&& optionsMatches(options, "ignore", "stylelint-command")
) {
return
}
Expand Down
4 changes: 0 additions & 4 deletions system-tests/001/__snapshots__/001.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ exports[`test 001 1`] = `
Array [
Object {
"deprecations": Array [
Object {
"reference": "http://stylelint.io/user-guide/rules/comment-empty-line-before/",
"text": "\'comment-empty-line-before\'s\' \"stylelint-commands\" option has been deprecated and in 8.0 will be removed. Instead use the \"stylelint-command\" option.",
},
Object {
"reference": "http://stylelint.io/user-guide/rules/declaration-block-no-ignored-properties/",
"text": "\'declaration-block-no-ignored-properties\' has been deprecated and in 8.0 will be removed.",
Expand Down
4 changes: 0 additions & 4 deletions system-tests/002/__snapshots__/002.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ exports[`test 002 1`] = `
Array [
Object {
"deprecations": Array [
Object {
"reference": "http://stylelint.io/user-guide/rules/comment-empty-line-before/",
"text": "\'comment-empty-line-before\'s\' \"stylelint-commands\" option has been deprecated and in 8.0 will be removed. Instead use the \"stylelint-command\" option.",
},
Object {
"reference": "http://stylelint.io/user-guide/rules/declaration-block-no-ignored-properties/",
"text": "\'declaration-block-no-ignored-properties\' has been deprecated and in 8.0 will be removed.",
Expand Down
4 changes: 0 additions & 4 deletions system-tests/deprecations/002/__snapshots__/002.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ Array [
"reference": "http://stylelint.io/user-guide/rules/comment-empty-line-before/",
"text": "\'comment-empty-line-before\'s\' \"between-comments\" option has been deprecated and in 8.0 will be removed. Instead use the \"after-comment\" option.",
},
Object {
"reference": "http://stylelint.io/user-guide/rules/comment-empty-line-before/",
"text": "\'comment-empty-line-before\'s\' \"stylelint-commands\" option has been deprecated and in 8.0 will be removed. Instead use the \"stylelint-command\" option.",
},
Object {
"reference": "http://stylelint.io/user-guide/rules/max-nesting-depth/",
"text": "\'max-nesting-depth\'s\' \"at-rules-without-declaration-blocks\" option has been deprecated and in 8.0 will be removed. Instead use the \"blockless-at-rules\" option.",
Expand Down

0 comments on commit 09955dd

Please sign in to comment.