Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommend using shared configs #5598

Merged
merged 9 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/migration-guide/to-14.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ There are five changes that may affect you:

### `syntax` option and automatic inferral of syntax

Stylelint no longer includes syntaxes that:
Stylelint no longer includes the syntaxes that:

- parse CSS-like syntaxes like SCSS, Sass, Less and SugarSS
- parse CSS-like languages like SCSS, Sass, Less and SugarSS
- extract styles from HTML, Markdown and CSS-in-JS object & template literals

If you use Stylelint to lint anything other than CSS files, you will need to install and configure these syntaxes. We recommend [extending](../user-guide/configure.md#extends) a shared config that includes the appropriate [PostCSS syntax](https://github.com/postcss/postcss#syntaxes) for you. For example, if you use Stylelint to lint SCSS, you can extend the [stylelint-config-standard-scss shared config](https://www.npmjs.com/package/stylelint-config-standard-scss).
Expand Down
8 changes: 4 additions & 4 deletions docs/user-guide/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Stylelint is designed for CSS.

However, it can be extended to:
However, it can used with [PostCSS syntaxes](https://github.com/postcss/postcss#syntaxes) that:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't know if it's a typo I spotted, or it's part of English I don't know :) Is “be” needed after “can”?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, it is!


- parse CSS-like syntaxes like SCSS, Less and SugarSS
- parse CSS-like languages like SCSS, Less and SugarSS
- extract styles from HTML, JavaScript and Markdown

## Linting CSS
Expand All @@ -31,7 +31,7 @@ npx stylelint "**/*.css"

## Linting everything else

We recommend using a shared config [that extends](../user-guide/configure.md#extends) Stylelint to make it compatible with the language or library. For example, you can extend the [stylelint-config-standard-scss shared config](https://www.npmjs.com/package/stylelint-config-standard-scss) to lint SCSS.
You'll need to use a [PostCSS syntax](https://github.com/postcss/postcss#syntaxes). We recommend [extending](../user-guide/configure.md#extends) a shared config that includes the appropriate syntax for your preferred language or library. For example, you can extend the [stylelint-config-standard-scss shared config](https://www.npmjs.com/package/stylelint-config-standard-scss) to lint SCSS.

1\. Use [npm](https://docs.npmjs.com/about-npm/) to install Stylelint and the shared config:

Expand All @@ -53,7 +53,7 @@ npm install --save-dev stylelint stylelint-config-standard-scss
npx stylelint "**/*.scss"
```

This config configures the [built-in rules](../user-guide/rules/list.md) for SCSS, and includes the [postcss-scss syntax](https://github.com/postcss/postcss-scss) and [stylelint-scss plugin](https://www.npmjs.com/package/stylelint-scss) (a collection of rules specific to SCSS).
This config includes the [postcss-scss syntax](https://github.com/postcss/postcss-scss), configures the [built-in rules](../user-guide/rules/list.md) for SCSS, and includes the [stylelint-scss plugin](https://www.npmjs.com/package/stylelint-scss) (a collection of rules specific to SCSS).

If a shared config isn't available for your preferred language or library, then you can install the appropriate [PostCSS syntax](https://github.com/postcss/postcss#syntaxes) yourself and use the [`customSyntax` option](../user-guide/usage/options.md#customSyntax) to configure it.

Expand Down