Skip to content

Commit

Permalink
feat: add stylelint-config-prettier
Browse files Browse the repository at this point in the history
This stylelint plugin makes sure all linting rules which might clash with prettier are disabled.
  • Loading branch information
goester-team23 committed Feb 16, 2022
1 parent bea2c70 commit 737d008
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
- updated `stylelint` from `^13.7.2` to `^14.5.0`
- updated `stylelint-config-standard` from `^20.0.0` to `^24.0.0`
- updated `stylelint` peer dependency to `^14.0.0`, i.e. removed support for older versions
- added `stylelint-config-prettier` dependency

## Changes to custom rules
## Changes to linting rules

- removed duplicate rules that were or became standard in stylelint-config-standard or stylelint-config-recommended:

Expand All @@ -20,6 +21,8 @@
"selector-attribute-quotes": "always",
```

- by adding `stylelint-config-prettier`, all rules that might cause conflict when using prettier are disabled.

- disabled all stylistic rules as recommended by stylelint [here](https://stylelint.io/user-guide/rules/list/#stylistic-issues), by changing

```js
Expand All @@ -41,7 +44,7 @@ to
"value-keyword-case": null,
```

- and by adding the following to disable all other stylistic rules which might come with stylelint-config-standard. Those should be handled by a pretty printer instead:
- and by adding the following to disable all other stylistic rules which might come with stylelint-config-standard. Those should be handled by a pretty printer instead.

```js
"function-name-case": null,
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

module.exports = {
extends: 'stylelint-config-standard',
extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
rules: {
/**
* Limit the number of ID selectors in a selector.
Expand Down Expand Up @@ -53,8 +53,6 @@ module.exports = {
* Disable stylistic issues as these rules will be deprecated or removed in the future
* See: https://stylelint.io/user-guide/rules/list/#stylistic-issues
*/
'max-empty-lines': null,
'string-quotes': null,
'value-keyword-case': null,
'function-name-case': null,
'custom-property-empty-line-before': null,
Expand All @@ -63,6 +61,8 @@ module.exports = {
'at-rule-empty-line-before': null,
'comment-empty-line-before': null,
'comment-whitespace-inside': null,
'max-empty-lines': null,
'string-quotes': null,
'color-hex-case': null,
'function-comma-newline-after': null,
'function-comma-newline-before': null,
Expand Down
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"watch": "jest --watch"
},
"dependencies": {
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^25.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit 737d008

Please sign in to comment.