Skip to content

Commit

Permalink
Deprecate rules (#2197) (#2298)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeddy3 committed Jan 29, 2017
1 parent 2d24a7e commit 7aa2282
Show file tree
Hide file tree
Showing 75 changed files with 1,371 additions and 78 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
@@ -1,10 +1,21 @@
# Head


- Deprecated: `block-no-single-line`. Use `block-opening-brace-newline-after` and `block-closing-brace-newline-before` rules with the option `"always"` instead. See [the FAQs for an example](docs/user-guide/faq.md#how-do-i-disallow-single-line-blocks).
- Deprecated: `declaration-block-no-ignored-properties`. If you use this rule, please consider creating a plugin for the community. See the [release planning](docs/user-guide/release-planning.md) document for more details.
- Deprecated: `declaration-block-properties-order`. Use the community [`stylelint-order`](https://github.com/hudochenkov/stylelint-order) plugin pack instead. See the [release planning](docs/user-guide/release-planning.md) document for more details.
- Deprecated: `media-feature-no-missing-punctuation`. If you use this rule, please consider creating a plugin for the community. See the [release planning](docs/user-guide/release-planning.md) document for more details.
- Deprecated: `selector-no-empty`. If you use this rule, please consider creating a plugin for the community. See the [release planning](docs/user-guide/release-planning.md) document for more details.
- Deprecated: `"all-nested"` option for `at-rule-empty-line-before`. Use the `"inside-block"` option instead.
- Deprecated: `"blockless-group"` option for `at-rule-empty-line-before`. Use the `"blockless-after-blockless"` option instead.
- Deprecated: `"between-comments"` option for `comment-empty-line-before`. Use the `"after-comment"` option instead.
- Deprecated: `"stylelint-commands"` option for `comment-empty-line-before`. Use the `"stylelint-command"` option instead.
- Deprecated: `"at-rules-without-declaration-blocks"` option for `max-nesting-depth`. Use the `"blockless-at-rules"` option instead.
- Added: `time-min-milliseconds` rule, to replace `time-no-imperceptible` ([#2289](https://github.com/stylelint/stylelint/pull/2289)).
- Added: `except: ["after-same-name"]` option to `at-rule-empty-line-before` ([#2225](https://github.com/stylelint/stylelint/pull/2225)).
- Fixed: `selector-pseudo-class-no-unknown` no longer warns for proprietary webkit pseudo-classes ([#2264](https://github.com/stylelint/stylelint/pull/2264)).
- Fixed: `configOverrides` now work with `extends` ([#2295](https://github.com/stylelint/stylelint/pull/2295)).
- Fixed: `max-line-length` no longer reports incorrect column positions for lines with `url()` or `import` ([#2287](https://github.com/stylelint/stylelint/pull/2287)).
- Fixed: `selector-pseudo-class-no-unknown` no longer warns for proprietary webkit pseudo-classes ([#2264](https://github.com/stylelint/stylelint/pull/2264)).

# 7.7.1

Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/articles.md
Expand Up @@ -6,7 +6,7 @@ A collection of articles and tutorials about stylelint.
- [Stylelint: The Style Sheet Linter We’ve Always Wanted](https://www.smashingmagazine.com/2016/05/stylelint-the-style-sheet-linter-weve-always-wanted/): Why linting a stylesheet matters and how stylelint brings order to a stylesheet. *(We now recommend using [`gulp-stylelint`](https://github.com/olegskl/gulp-stylelint), rather than the `gulp-postcss` and `postcss-reporter` combination outlined in the article. Also, both the “prevent qualified selectors” and “enforce shorthand values” plugins were rolled into the core rules as `selector-no-qualifying-type` and `shorthand-property-no-redundant-values` respectively)*
- [Improving CSS quality at Facebook and beyond](https://code.facebook.com/posts/879890885467584/improving-css-quality-at-facebook-and-beyond): Detailing Facebook's switch from a custom CSS linter to stylelint.
- [How to lint your Sass/CSS properly with Stylelint](http://www.creativenightly.com/2016/02/How-to-lint-your-css-with-stylelint/): Introduction to linting CSS. *(As above, we now recommend using [`gulp-stylelint`](https://github.com/olegskl/gulp-stylelint), rather than the `gulp-postcss` and `postcss-reporter` combination outlined in the article)*
- [Improving the Quality of Your CSS with PostCSS](http://www.sitepoint.com/improving-the-quality-of-your-css-with-postcss/): Introduction to various PostCSS linting tools. *(As above, we recommend using [`gulp-stylelint`](https://github.com/olegskl/gulp-stylelint). Also, `doiuse` is now bundled in stylelint as the `no-unsupported-browser-features` rule)*
- [Improving the Quality of Your CSS with PostCSS](http://www.sitepoint.com/improving-the-quality-of-your-css-with-postcss/): Introduction to various PostCSS linting tools. *(As above, we recommend using [`gulp-stylelint`](https://github.com/olegskl/gulp-stylelint).)*
- [Floss your style sheets with Stylelint](https://benfrain.com/floss-your-style-sheets-with-stylelint/): The first article written about stylelint. *(As before, we now recommend using [`gulp-stylelint`](https://github.com/olegskl/gulp-stylelint))*

Please send us a Pull Request to add your own article to the list.
2 changes: 1 addition & 1 deletion docs/user-guide/configuration.md
Expand Up @@ -36,7 +36,7 @@ The `rules` property is *an object whose keys are rule names and values are rule
"block-no-empty": null,
"color-no-invalid-hex": true,
"comment-empty-line-before": [ "always", {
"ignore": ["stylelint-commands", "between-comments"]
"ignore": ["stylelint-command", "after-comment"]
} ],
"declaration-colon-space-after": "always",
"indentation": ["tab", {
Expand Down
13 changes: 0 additions & 13 deletions docs/user-guide/example-config.md
Expand Up @@ -22,7 +22,6 @@ You might want to learn a little about [how rules are named and how they work to
"block-closing-brace-space-after": "always"|"always-single-line"|"never-single-line"|"always-multi-line"|"never-multi-line",
"block-closing-brace-space-before": "always"|"never"|"always-single-line"|"never-single-line"|"always-multi-line"|"never-multi-line",
"block-no-empty": true,
"block-no-single-line": true,
"block-opening-brace-newline-after": "always"|"always-multi-line"|"never-multi-line",
"block-opening-brace-newline-before": "always"|"always-single-line"|"never-single-line"|"always-multi-line"|"never-multi-line",
"block-opening-brace-space-after": "always"|"always-single-line"|"never-single-line"|"always-multi-line"|"never-multi-line",
Expand All @@ -38,15 +37,12 @@ You might want to learn a little about [how rules are named and how they work to
"comment-word-blacklist": string|[],
"custom-media-pattern": string,
"custom-property-empty-line-before": "always"|"never",
"custom-property-no-outside-root": true,
"custom-property-pattern": string,
"declaration-bang-space-after": "always"|"never",
"declaration-bang-space-before": "always"|"never",
"declaration-block-no-duplicate-properties": true,
"declaration-block-no-ignored-properties": true,
"declaration-block-no-redundant-longhand-properties": true,
"declaration-block-no-shorthand-property-overrides": true,
"declaration-block-properties-order": "alphabetical"|[],
"declaration-block-semicolon-newline-after": "always"|"always-multi-line"|"never-multi-line",
"declaration-block-semicolon-newline-before": "always"|"always-multi-line"|"never-multi-line",
"declaration-block-semicolon-space-after": "always"|"never"|"always-single-line"|"never-single-line",
Expand Down Expand Up @@ -95,25 +91,21 @@ You might want to learn a little about [how rules are named and how they work to
"media-feature-name-no-unknown": true,
"media-feature-name-no-vendor-prefix": true,
"media-feature-name-whitelist": string|[],
"media-feature-no-missing-punctuation": true,
"media-feature-parentheses-space-inside": "always"|"never",
"media-feature-range-operator-space-after": "always"|"never",
"media-feature-range-operator-space-before": "always"|"never",
"media-query-list-comma-newline-after": "always"|"always-multi-line"|"never-multi-line",
"media-query-list-comma-newline-before": "always"|"always-multi-line"|"never-multi-line",
"media-query-list-comma-space-after": "always"|"never"|"always-single-line"|"never-single-line",
"media-query-list-comma-space-before": "always"|"never"|"always-single-line"|"never-single-line",
"no-browser-hacks": true,
"no-descending-specificity": true,
"no-duplicate-selectors": true,
"no-empty-source": true,
"no-eol-whitespace": true,
"no-extra-semicolons": true,
"no-indistinguishable-colors": true,
"no-invalid-double-slash-comments": true,
"no-missing-end-of-source-newline": true,
"no-unknown-animations": true,
"no-unsupported-browser-features": true,
"number-leading-zero": "always"|"never",
"number-max-precision": int,
"number-no-trailing-zeros": true,
Expand All @@ -122,7 +114,6 @@ You might want to learn a little about [how rules are named and how they work to
"property-no-unknown": true,
"property-no-vendor-prefix": true,
"property-whitelist": string|[],
"root-no-standard-properties": true,
"rule-nested-empty-line-before": "always"|"never",
"rule-non-nested-empty-line-before": "always"|"never",
"selector-attribute-brackets-space-inside": "always"|"never",
Expand All @@ -146,7 +137,6 @@ You might want to learn a little about [how rules are named and how they work to
"selector-nested-pattern": string,
"selector-no-attribute": true,
"selector-no-combinator": true,
"selector-no-empty": true,
"selector-no-id": true,
"selector-no-qualifying-type": true,
"selector-no-type": true,
Expand All @@ -160,15 +150,12 @@ You might want to learn a little about [how rules are named and how they work to
"selector-pseudo-element-case": "lower"|"upper",
"selector-pseudo-element-colon-notation": "single"|"double",
"selector-pseudo-element-no-unknown": true,
"selector-root-no-composition": true,
"selector-type-case": "lower"|"upper",
"selector-type-no-unknown": true,
"shorthand-property-no-redundant-values": true,
"string-no-newline": true,
"string-quotes": "single"|"double",
"stylelint-disable-reason": "always-before"|"always-after",
"time-min-milliseconds": int,
"time-no-imperceptible": true,
"unit-blacklist": string|[],
"unit-case": "lower"|"upper",
"unit-no-unknown": true,
Expand Down
40 changes: 40 additions & 0 deletions docs/user-guide/faq.md
Expand Up @@ -87,6 +87,46 @@ You can also take advantage of the `selector-*` rules to ban certain types of se

If you're using SUITCSS, you might want to use [their shareable config](https://github.com/suitcss/stylelint-config-suitcss).

## How do I disallow single-line blocks?

```css
a { color: red; }
/** ↑
* Declaration blocks like this */
```

Use the `block-opening-brace-newline-after` and `block-opening-brace-newline-before` rules together. For example, this config:

```json
{
"block-opening-brace-newline-after": ["always"],
"block-closing-brace-newline-before": ["always"]
}
```

Would allow:

```css
a {
color: red;
}
```

But not these patterns:

```css
a { color: red;
}

a {
color: red; }

a { color: red; }
```

To allow single-line blocks but enforce newlines with multi-line blocks, use the `"always-multi-line"` option for both rules.


## How do I configure the `*-pattern` rules for common CSS naming conventions like kebab-case?

Use the regex that corresponds to your chosen convention:
Expand Down

0 comments on commit 7aa2282

Please sign in to comment.