Skip to content

Commit

Permalink
Prepare docs for website (#6612)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeddy3 committed Feb 6, 2023
1 parent 392c6cd commit a479b03
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 36 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -1179,7 +1179,7 @@ Changes:

## 7.0.0

- Removed: `--extract` and `extractStyleTagsFromHtml` options. Instead, [build](/docs/developer-guide/processors.md) and [use](/docs/user-guide/configure.md#processors) processors.
- Removed: `--extract` and `extractStyleTagsFromHtml` options. Instead, build and use processors.
- Removed: support for plugin rule names that aren't namespaced, i.e. only `your-namespace/your-rule-name` rule names are supported. (If your plugin provides only a single rule or you can't think of a good namespace, you can simply use `plugin/my-rule`.)
- Removed: `--verbose` CLI flag. Use `--formatter verbose` instead.
- Removed: NodeJS `0.12.x` support. `4.2.1 LTS` or greater is now required.
Expand Down
2 changes: 1 addition & 1 deletion docs/migration-guide/to-15.md
Expand Up @@ -11,7 +11,7 @@ Two significant changes may affect you:

### Deprecated stylistic rules

We've deprecated [76 of the rules that enforce stylistic conventions](../user-guide/rules.md#deprecated), e.g. [`indentation`](../../lib/rules/indentation/README.md).
We've deprecated [76 of the rules that enforce stylistic conventions](../user-guide/rules.md#deprecated), e.g. `indentation`.

When we created these rules, pretty printers (like [Prettier](https://prettier.io/)) didn't exist. They now offer a better way to consistently format code, especially whitespace. Linters and pretty printers are complementary tools that work together to help you write consistent and error-free code.

Expand Down
Empty file removed docs/user-guide/combine.md
Empty file.
61 changes: 32 additions & 29 deletions docs/user-guide/customize.md
Expand Up @@ -17,37 +17,40 @@ There's a lot you can do. For example, if you only want to allow:

You can use the [`unit-allowed-list`](../../lib/rules/unit-allowed-list) and [`declaration-property-unit-allowed-list`](../../lib/rules/declaration-property-unit-allowed-list) rules:

```json
```diff json
{
"rules": {
"declaration-property-unit-allowed-list": {
"/^border/": ["px"],
"/^padding|^gap/": ["rem"]
},
"unit-allowed-list": ["%", "deg", "px", "rem", "ms"]
}
"extends": ["stylelint-config-standard"],
+ "rules": {
+ "declaration-property-unit-allowed-list": {
+ "/^border/": ["px"],
+ "/^padding|^gap/": ["rem"]
+ },
+ "unit-allowed-list": ["%", "deg", "px", "rem", "ms"]
+ }
}
```

Or you can enforce the `hsl()` color notation using the [`color-named`](../../lib/rules/color-named), [`color-no-hex`](../../lib/rules/color-no-hex),[`function-disallowed-list`](../../lib/rules/function-disallowed-list) rules:

```json
```diff json
{
"rules": {
"color-named": "never",
"color-no-hex": true,
"function-disallowed-list": ["rgb", "hwb", "lch"]
}
"extends": ["stylelint-config-standard"],
+ "rules": {
+ "color-named": "never",
+ "color-no-hex": true,
+ "function-disallowed-list": ["rgb", "hwb", "lch"]
+ }
}
```

Or you can limit the number of ID selectors using the [`selector-max-id`](../../lib/rules/selector-max-id/README.md) rule:

```json
```diff json
{
"rules": {
"selector-max-id": 0
}
"extends": ["stylelint-config-standard"],
+ "rules": {
+ "selector-max-id": 0
+ }
}
```

Expand All @@ -61,24 +64,24 @@ Custom rules are typically written by communities to support methodologies, tool

You can add custom rules to your config by extending a shared config that includes them or by using a plugin directly. For example, you can order your properties by extending the [recess order config](https://www.npmjs.com/package/stylelint-config-recess-order), which includes the [order plugin](https://www.npmjs.com/package/stylelint-order):

```json
```diff json
{
"extends": [
"stylelint-config-standard"
"stylelint-config-recess-order"
+ "stylelint-config-recess-order"
]
}
```

Or you can use [the plugin](https://www.npmjs.com/package/stylelint-order) directly if, for example, you want to alphabetize your properties:

```json
```diff json
{
"extends": ["stylelint-config-standard"],
"plugins": ["stylelint-order"],
"rules": {
"order/properties-alphabetical-order": true
}
+ "plugins": ["stylelint-order"],
+ "rules": {
+ "order/properties-alphabetical-order": true
+ }
}
```

Expand All @@ -92,12 +95,12 @@ We recommend you craft a config that strictly enforces your conventions and then

You can use the [`report*`](./configure.md#report) properties in your config to ensure your comments aren't useless and descriptionless:

```json
```diff json
{
"extends": ["stylelint-config-standard"],
"reportDescriptionlessDisables": true,
"reportInvalidScopeDisables": true,
"reportNeedlessDisables": true
+ "reportDescriptionlessDisables": true,
+ "reportInvalidScopeDisables": true,
+ "reportNeedlessDisables": true
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/get-started.md
@@ -1,6 +1,6 @@
# Getting started

You can quickly get started with Stylelint by extending a shared config.
You can quickly get started by extending a shared config.

## Linting CSS

Expand Down
2 changes: 0 additions & 2 deletions lib/rules/block-opening-brace-newline-after/README.md
Expand Up @@ -21,8 +21,6 @@ a { /* end-of-line comment */
}
```

Refer to [combining rules](../../../docs/user-guide/combine.md) for more information on using this rule with [`block-opening-brace-newline-before`](../block-opening-brace-newline-before/README.md) to disallow single-line rules.

The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule.

## Options
Expand Down
2 changes: 0 additions & 2 deletions lib/rules/block-opening-brace-newline-before/README.md
Expand Up @@ -12,8 +12,6 @@ Require a newline or disallow whitespace before the opening brace of blocks.
* The newline before this brace */
```

Refer to [combining rules](../../../docs/user-guide/combine.md) for more information on using this rule with [`block-opening-brace-newline-after`](../block-opening-brace-newline-after/README.md) to disallow single-line rules.

The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule.

## Options
Expand Down

0 comments on commit a479b03

Please sign in to comment.