Skip to content

Commit

Permalink
feat: .browserslistrc (#44)
Browse files Browse the repository at this point in the history
This is an automated pull request to update from branch refactor/plugins
  • Loading branch information
nikkeyl authored Feb 14, 2024
2 parents ed03806 + 10e8362 commit 5bcc311
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
> 1.5%
Firefox ESR
last 2 versions
not dead
55 changes: 42 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,70 @@
## Table of Contents

- [This Config](#this-config)
- [Extends](#extends)
- [Plugins](#plugins)
- [Rules](#rules)

- [Installation](#installation)

- [Usage](#usage)

- [License](#license)

## This Config

### Extends

- Extends the [**`stylelint-config-standard-scss`** shared config](https://github.com/stylelint-scss/stylelint-config-standard-scss)
and configures it's rules for **SCSS**.

- **BEM** naming convention likely enforced, encouraging modularity,
maintainability, and clarity in class naming.
### Plugins

- Experimental and non-standard pseudo classes, pseudo elements and properties
are used in the config.
- [**`stylelint-declaration-block-no-ignored-properties`**](https://github.com/kristerkari/stylelint-declaration-block-no-ignored-properties)
disallow property values that are ignored due to another
property value in the same rule.

> Don't worry, it doesn't have any side effects of any kind.
> Use **`.browserslistrc`**.
- [**`stylelint-gamut`**](https://github.com/fpetrakov/stylelint-gamut)
throw warning if color goes out of **sRGB**
color space and is not wrapped in **`@media (color-gamut: p3) {}`**
or **`@media (color-gamut: rec2020) {}`**

- [**`stylelint-group-selectors`**](https://github.com/ssivanatarajan/stylelint-group-selectors)
identify the selectors, which can be grouped,
as they have same set of properties and values.

- [**`stylelint-high-performance-animation`**](https://github.com/kristerkari/stylelint-high-performance-animation)
enhances your animations.

- [**`stylelint-no-unsupported-browser-features`**](https://github.com/ismay/stylelint-no-unsupported-browser-features)
disallow features that aren't supported by your target browser audience.

- [**`stylelint-order`**](https://github.com/hudochenkov/stylelint-order)
sorts **over 400 properties** for enhanced clarity and maintainability.

> Properties are grouped into logical groups and separated by a space.
- [**`stylelint-plugin-defensive-css`**](https://github.com/yuschick/stylelint-plugin-defensive-css)
for enforcing defensive **CSS** best practices.

- [**`stylelint-plugin-logical-css`**](https://github.com/yuschick/stylelint-plugin-logical-css)
replace properties with logical alternatives.

- [**`stylelint-high-performance-animation`**](https://github.com/kristerkari/stylelint-high-performance-animation)
enhances your animations.
- [**`stylelint-prettier`**](https://github.com/prettier/stylelint-prettier)
runs **Prettier** as a **Stylelint** rule and reports
differences as individual Stylelint issues.

- [**`stylelint-plugin-defensive-css`**](https://github.com/yuschick/stylelint-plugin-defensive-css)
for enforcing defensive **CSS** best practices.
### Rules

- [**`stylelint-gamut`**](https://github.com/fpetrakov/stylelint-gamut)
throw warning if color goes out of **sRGB**
color space and is not wrapped in **`@media (color-gamut: p3) {}`**
or **`@media (color-gamut: rec2020) {}`**
- **BEM** naming convention likely enforced, encouraging modularity,
maintainability, and clarity in class naming.

- Experimental and non-standard pseudo classes, pseudo elements and properties
are used in the config.

> Don't worry, it doesn't have any side effects of any kind.
## Installation

Expand Down
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import plugins from './utils/plugins.js';
export default {
extends: ['stylelint-config-standard-scss'],
plugins: [
'stylelint-declaration-block-no-ignored-properties',
'stylelint-gamut',
'stylelint-group-selectors',
'stylelint-high-performance-animation',
'stylelint-no-unsupported-browser-features',
'stylelint-order',
'stylelint-plugin-defensive-css',
'stylelint-plugin-logical-css',
Expand Down
8 changes: 8 additions & 0 deletions src/utils/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ const plugins = {
'prettier/prettier': true,
...propertiesOrder,
'gamut/color-no-out-gamut-range': true,
'plugin/declaration-block-no-ignored-properties': true,
'plugin/no-low-performance-animation-properties': true,
'plugin/no-unsupported-browser-features': [
true,
{
severity: 'warning',
},
],
'plugin/stylelint-group-selectors': true,
'plugin/use-defensive-css': [
true,
{
Expand Down

0 comments on commit 5bcc311

Please sign in to comment.