Skip to content

Commit

Permalink
Merge pull request #5604 from stylelint/v14
Browse files Browse the repository at this point in the history
Prepare 14.0.0
  • Loading branch information
jeddy3 committed Oct 21, 2021
2 parents 864b01b + 16d259f commit 82e2507
Show file tree
Hide file tree
Showing 773 changed files with 19,087 additions and 31,643 deletions.
1 change: 0 additions & 1 deletion .eslintignore
@@ -1,6 +1,5 @@
.coverage
lib/vendor
lib/utils/parseCalcExpression/parser.js

# Unignore config files like .prettierrc.js, because they're ignored by default
!.*rc.js
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/REPORT_A_BUG.md
Expand Up @@ -23,7 +23,7 @@ a {
}
```

> What stylelint configuration is needed to reproduce the bug?
> What Stylelint configuration is needed to reproduce the bug?
e.g.

Expand All @@ -35,7 +35,7 @@ e.g.
}
```

> Which version of stylelint are you using?
> Which version of Stylelint are you using?
e.g. `9.2.0`

Expand Down
9 changes: 8 additions & 1 deletion .github/dependabot.yml
Expand Up @@ -8,4 +8,11 @@ updates:
labels:
- 'pr: dependencies'
versioning-strategy: increase
target-branch: 'v14' # TODO: Remove when releasing v14.

- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
open-pull-requests-limit: 5
labels:
- 'pr: dependencies'
6 changes: 2 additions & 4 deletions .github/workflows/linting.yml
Expand Up @@ -9,9 +9,6 @@ on:
branches:
- '**'

env:
CI: true

jobs:
lint:
name: Lint on Node.js ${{ matrix.node }} and ${{ matrix.os }}
Expand All @@ -27,9 +24,10 @@ jobs:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm

- name: Install latest npm
run: npm install --global npm@latest
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/testing.yml
Expand Up @@ -9,9 +9,6 @@ on:
branches:
- '**'

env:
CI: true

jobs:
test:
name: Test on Node.js ${{ matrix.node }} and ${{ matrix.os }}
Expand All @@ -21,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [10, 12, 14, 16]
node: [12, 14, 16]
os: [ubuntu-latest, windows-latest, macos-latest]
exclude:
- os: ubuntu-latest
Expand All @@ -31,9 +28,10 @@ jobs:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm

- name: Install latest npm
run: npm install --global npm@latest
Expand All @@ -58,9 +56,10 @@ jobs:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm

- name: Install latest npm
run: npm install --global npm@latest
Expand Down
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .prettierignore
Expand Up @@ -10,7 +10,6 @@
**/fixtures/**/*.vue
**/fixtures/**/*.html
**/fixtures/**/*.markdown
lib/utils/parseCalcExpression/parser.js
scripts/**/*.css
system-tests/**/*.css
system-tests/**/*.scss
66 changes: 50 additions & 16 deletions CHANGELOG.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Expand Up @@ -5,15 +5,15 @@ Thank you for wanting to contribute.
To help out, you can:

- get involved in any open [issue](https://github.com/stylelint/stylelint/issues) or [pull request](https://github.com/stylelint/stylelint/pulls)
- improve our [support for non-standard syntaxes](docs/about/syntaxes.md)
- maintain [community custom syntaxes](docs/developer-guide/syntaxes.md)
- create, enhance and debug rules using [our guide](docs/developer-guide/rules.md)
- improve the [documentation](docs/)
- add [new tests](https://github.com/stylelint/stylelint/issues?q=is%3Aopen+is%3Aissue+label%3A%22type%3A+tests%22) to _absolutely anything_
- improve the [performance of rules](docs/developer-guide/rules.md#improve-the-performance-of-a-rule)
- open [new issues](https://github.com/stylelint/stylelint/issues/new/choose) about your ideas for making stylelint better
- open [new issues](https://github.com/stylelint/stylelint/issues/new/choose) about your ideas for making Stylelint better
- create or contribute to [integrations](docs/user-guide/integrations/editor.md), like our plugin for [VS Code](https://github.com/stylelint/vscode-stylelint)

Not only will you help stylelint thrive, but you may learn a thing or two — about CSS, PostCSS, Node, ES2015, unit testing, open-source software, and more. We want to encourage contributions! If you want to participate but couldn't, please [give us feedback](https://github.com/stylelint/stylelint/issues/new) about what we could do better.
Not only will you help Stylelint thrive, but you may learn a thing or two — about CSS, PostCSS, Node, ES2015, unit testing, open-source software, and more. We want to encourage contributions! If you want to participate but couldn't, please [give us feedback](https://github.com/stylelint/stylelint/issues/new) about what we could do better.

## Code contributions

Expand All @@ -24,7 +24,7 @@ To start coding, you'll need:

Then:

1. [Fork and clone](https://guides.github.com/activities/forking/) the stylelint repository.
1. [Fork and clone](https://guides.github.com/activities/forking/) the Stylelint repository.
2. Install all the dependencies with `npm ci`.

### Run tests
Expand Down Expand Up @@ -67,7 +67,7 @@ Alternatively, you can:

When you have something to share, it's time to [open a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork).

After we review and merge your pull request, we'll invite you to become a maintainer of the stylelint organization. You'll then be able to help manage issues, pull requests and releases. You'll also be able to work on the stylelint repository rather than your fork.
After we review and merge your pull request, we'll invite you to become a maintainer of the Stylelint organization. You'll then be able to help manage issues, pull requests and releases. You'll also be able to work on the Stylelint repository rather than your fork.

## Financial contributions

Expand Down
80 changes: 61 additions & 19 deletions README.md
@@ -1,4 +1,4 @@
# stylelint
# Stylelint

[![NPM version](https://img.shields.io/npm/v/stylelint.svg)](https://www.npmjs.org/package/stylelint) [![Build Status](https://github.com/stylelint/stylelint/workflows/CI/badge.svg)](https://github.com/stylelint/stylelint/actions) [![NPM Downloads](https://img.shields.io/npm/dm/stylelint.svg)](https://npmcharts.com/compare/stylelint?minimal=true)

Expand All @@ -8,42 +8,84 @@ A mighty, modern linter that helps you avoid errors and enforce conventions in y

It's mighty as it:

- understands the **latest CSS syntax** including custom properties and level 4 selectors
- extracts **embedded styles** from HTML, markdown and CSS-in-JS object & template literals
- parses **CSS-like syntaxes** like SCSS, Sass, Less and SugarSS
- has over **170 built-in rules** to catch errors, apply limits and enforce stylistic conventions
- supports **plugins** so you can create your own rules or make use of plugins written by the community
- automatically **fixes** the majority of stylistic violations
- understands **modern** CSS syntax and features
- has over **170 built-in rules** to catch errors and enforce conventions
- supports **plugins** so you can create your own rules
- automatically **fixes** the majority of stylistic problems
- is **well tested** with over 15000 unit tests
- supports **shareable configs** that you can extend or create
- is **unopinionated** so that you can customize it to your exact needs
- has a **growing community** and is used by [Facebook](https://code.facebook.com/posts/879890885467584/improving-css-quality-at-facebook-and-beyond/), [GitHub](https://github.com/primer/stylelint-config-primer) and [WordPress](https://github.com/WordPress-Coding-Standards/stylelint-config-wordpress)
- has a **growing community** and is used by Google, GitHub and WordPress

And can be extended to:

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

## Example output

![Example](https://github.com/stylelint/stylelint/raw/master/example.png?raw=true)

## Getting started

You'll find steps to [get started in our User guide](docs/user-guide/get-started.md).
## Guides

- User guide
- [Getting started](docs/user-guide/get-started.md)
- [Configuration](docs/user-guide/configure.md)
- Rules
- [List of rules](docs/user-guide/rules/list.md)
- [About rules](docs/user-guide/rules/about.md)
- [Combining rules](docs/user-guide/rules/combine.md)
- [Using regex in rules](docs/user-guide/rules/regex.md)
- Usage
- [CLI](docs/user-guide/usage/cli.md)
- [Node.js API](docs/user-guide/usage/node-api.md)
- [PostCSS plugin](docs/user-guide/usage/postcss-plugin.md)
- [Shared options](docs/user-guide/usage/options.md)
- Integrations
- [Editor integrations](docs/user-guide/integrations/editor.md)
- [Task runner integrations](docs/user-guide/integrations/task-runner.md)
- [Other integrations](docs/user-guide/integrations/other.md)
- [Ignoring code](docs/user-guide/ignore-code.md)
- [Errors & warnings](docs/user-guide/errors.md)
- Developer guide
- [Working on rules](docs/developer-guide/rules.md)
- [Writing plugins](docs/developer-guide/plugins.md)
- [Writing custom syntaxes](docs/developer-guide/syntaxes.md)
- [Writing custom formatters](docs/developer-guide/formatters.md)
- [Writing system tests](docs/developer-guide/system-tests.md)
- [Writing processors](docs/developer-guide/processors.md)
- Migration guide
- [Migrating to 14.0.0](docs/migration-guide/to-14.md)
- Maintainer guide
- [Managing issues](docs/maintainer-guide/issues.md)
- [Managing pull requests](docs/maintainer-guide/pull-requests.md)
- [Performing releases](docs/maintainer-guide/releases.md)
- About
- [Vision](docs/about/vision.md)
- [Linting](docs/about/linting.md)
- [Semantic versioning](docs/about/semantic-versioning.md)

## Contributors

Without the contributions from [all these fantastic people](https://github.com/stylelint/stylelint/graphs/contributors), stylelint would not exist. [Become a contributor](CONTRIBUTING.md).
Stylelint is maintained by volunteers. Without the code contributions from [all these fantastic people](https://github.com/stylelint/stylelint/graphs/contributors), Stylelint would not exist. [Become a contributor](CONTRIBUTING.md).

## Backers
### Sponsors

<a href="https://opencollective.com/stylelint#backers" target="_blank"><img src="https://opencollective.com/stylelint/backers.svg?width=890" /></a>
<object data="https://opencollective.com/stylelint/sponsors.svg?width=420&button=false" type="image/svg+xml">
<img src="https://opencollective.com/stylelint/sponsors.svg?width=840&button=false" />
</object>

Thank you to all our backers! [Become a backer](https://opencollective.com/stylelint#backer).
Thank you to all our sponsors! [Become a sponsor](https://opencollective.com/stylelint).

## Sponsors
### Backers

<a href="https://opencollective.com/stylelint/sponsor/0/website" target="_blank"><img src="https://opencollective.com/stylelint/sponsor/0/avatar.svg" /></a>
<object data="https://opencollective.com/stylelint/backers.svg?width=420&avatarHeight=48&button=false" type="image/svg+xml">
<img src="https://opencollective.com/stylelint/backers.svg?width=840&avatarHeight=48&button=false" />
</object>

Support this project to show your logo here with a link to your website. [Become a sponsor](https://opencollective.com/stylelint#sponsor).
Thank you to all our backers! [Become a backer](https://opencollective.com/stylelint).

## Website hosting
### Website hosting

<a href="https://www.netlify.com"><img src="https://www.netlify.com/img/global/badges/netlify-color-accent.svg" alt="Deploys by Netlify" /></a>

Expand Down
8 changes: 4 additions & 4 deletions docs/about/linting.md
Expand Up @@ -11,9 +11,9 @@ There are two approaches to enforcing stylistic conventions:
- a machine algorithmically pretty prints the code (usually based on a maximum line length)
- a human initially formats the code, and a machine fixes-up/warns-about any mistakes

The former is handled by pretty printers, like [prettier](https://github.com/prettier/prettier), whereas the latter is catered for by the built-in [stylistic rules](../user-guide/rules/list.md#stylistic-issues). If you use a pretty printer, you'll want to use [`stylelint-config-recommended`](https://github.com/stylelint/stylelint-config-recommended), which only turns on [possible error](../user-guide/rules/list.md#possible-errors) rules.
The former is handled by pretty printers, like [Prettier](https://github.com/prettier/prettier), whereas the latter is catered for by the built-in [stylistic rules](../user-guide/rules/list.md#stylistic-issues). If you use a pretty printer, you'll want to use [`stylelint-config-standard`](https://github.com/stylelint/stylelint-config-standard) and [`stylelint-config-prettier`](https://github.com/prettier/stylelint-config-prettier), which turns off any imcompatible rules.

Additionally, the built-in stylistic rules and plugins are configurable to support a diverse range of stylistic conventions. For example, ordering properties within declaration blocks is a divisive topic, where there isn't a dominant convention. The [`stylelint-order`](https://www.npmjs.com/package/stylelint-order) plugin can be configured to lint and fix a diverse range of ordering conventions.
The built-in stylistic rules and plugins are configurable to support a diverse range of stylistic conventions. For example, ordering properties within declaration blocks is a divisive topic, where there isn't a dominant convention. The [`stylelint-order`](https://www.npmjs.com/package/stylelint-order) plugin can be configured to lint and fix a diverse range of ordering conventions.

Another example is the use of single-line rules for sets of _related_ rules, e.g.

Expand All @@ -29,6 +29,6 @@ You can configure the built-in stylistic rules to allow both multi-line and sing

## Validators

Validators like [csstree](https://github.com/csstree/csstree) identify invalid code such as misformed hex colors and unknown language features.
Validators like [CSSTree](https://github.com/csstree/csstree) identify invalid code such as misformed hex colors, unknown language features or invalid property and value pairs.

However, as a stop-gap, while these tools mature stylelint provides rules for the simplest of cases.
However, as a stop-gap, Stylelint provides rules for the simplest of cases while these tools mature.
10 changes: 5 additions & 5 deletions docs/about/semantic-versioning.md
@@ -1,14 +1,14 @@
# Semantic versioning

Due to the nature of stylelint as a code quality tool, we follow a specific flavor of [semantic versioning](http://semver.org).
Due to the nature of Stylelint as a code quality tool, we follow a specific flavor of [semantic versioning](http://semver.org).

Any minor update may report more errors than the previous release. As such, we recommend using the tilde (`~`) in `package.json` e.g. `"stylelint": "~7.2.0"` to guarantee the results of your builds.

## Patch release

Intended not to break your lint build:

- a bug fix in a rule that results in stylelint reporting fewer errors
- a bug fix in a rule that results in Stylelint reporting fewer errors
- a bug fix to the CLI or core (including formatters)
- improvements to documentation
- non-user-facing changes such as refactoring code or modifying tests
Expand All @@ -18,9 +18,9 @@ Intended not to break your lint build:

Might break your lint build:

- a bug fix in a rule that results in stylelint reporting more errors
- a bug fix in a rule that results in Stylelint reporting more errors
- a new rule is created
- a new option to an existing rule that does not result in stylelint reporting more errors by default
- a new option to an existing rule that does not result in Stylelint reporting more errors by default
- an existing rule is deprecated
- a new CLI capability is created
- a new public API capability is created
Expand All @@ -30,7 +30,7 @@ Might break your lint build:

Likely to break your lint build:

- a change in the documented behavior of an existing rule results in stylelint reporting more errors by default
- a change in the documented behavior of an existing rule results in Stylelint reporting more errors by default
- an existing rule is removed
- an existing formatter is removed
- part of the CLI is removed or changed in an incompatible way
Expand Down
18 changes: 0 additions & 18 deletions docs/about/syntaxes.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/about/vision.md
Expand Up @@ -44,8 +44,8 @@ Provide multiple points of extensions, including:

- [plugins](../developer-guide/plugins.md) - build community rules to support methodologies, toolsets, non-standard CSS features, or very specific use cases
- [extendable configs](../user-guide/configure.md#extends) - extend and share configurations
- [formatters](../developer-guide/formatters.md) - format stylelint result objects
- [custom syntax](syntaxes.md) - use any PostCSS-compatible syntax module
- [formatters](../developer-guide/formatters.md) - format Stylelint result objects
- [custom syntax](../user-guide/usage/options.md#customSyntax) - use any PostCSS-compatible syntax module

## Robust

Expand Down
14 changes: 7 additions & 7 deletions docs/developer-guide/formatters.md
@@ -1,4 +1,4 @@
# Writing formatters
# Writing custom formatters

A formatter is a function with the following signature:

Expand All @@ -11,15 +11,15 @@ function formatter(results, returnValue) {
}
```

Where the first argument (`results`) is an array of stylelint result objects (type `Array<StylelintResult>`) in the form:
Where the first argument (`results`) is an array of Stylelint result objects (type `Array<StylelintResult>`) in the form:

```js
// A stylelint result object
// A Stylelint result object
{
"source": "path/to/file.css", // The filepath or PostCSS identifier like <input css 1>
"errored": true, // This is `true` if at least one rule with an "error"-level severity triggered a warning
"warnings": [
// Array of rule violation warning objects, each like the following ...
// Array of rule problem warning objects, each like the following ...
{
"line": 3,
"column": 12,
Expand All @@ -45,13 +45,13 @@ Where the first argument (`results`) is an array of stylelint result objects (ty
}
```

And the second argument (`returnValue`) is an object (type `StylelintStandaloneReturnValue`) with one or more of the following keys:
And the second argument (`returnValue`) is an object (type `LinterResult`) with one or more of the following keys:

```js
{
"errored": false, // `true` if there were any warnings with "error" severity
"maxWarningsExceeded": {
// Present if stylelint was configured with a `maxWarnings` count
// Present if Stylelint was configured with a `maxWarnings` count
"maxWarnings": 10,
"foundWarnings": 15
}
Expand All @@ -74,4 +74,4 @@ stylelint -f json "*.css" | my-program-that-reads-JSON --option

## `stylelint.formatters`

stylelint's internal formatters are exposed publicly in `stylelint.formatters`.
Stylelint's internal formatters are exposed publicly in `stylelint.formatters`.

0 comments on commit 82e2507

Please sign in to comment.