stylelint-scss / stylelint-config-recommended-scss

The recommended shareable SCSS config for Stylelint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Various deprecation warning after upgrading stylelint to 15.0.0

crystalfp opened this issue · comments

After upgrading stylelint to 15.0.0 the following deprecation warnings appear:

 - The "block-closing-brace-space-before" rule is deprecated.
 - The "block-opening-brace-space-after" rule is deprecated.
 - The "color-hex-case" rule is deprecated.
 - The "max-empty-lines" rule is deprecated.
 - The "no-empty-first-line" rule is deprecated.
 - The "no-extra-semicolons" rule is deprecated.
 - The "selector-list-comma-newline-after" rule is deprecated.

Could these rules be removed?
Thanks!
mario

@crystalfp I only get the single warning The "no-extra-semicolons" rule is deprecated. - wonder if the others are from other configs that you have configured...?

@kristerkari To address this problem, since this rule is actually not configured in stylelint-config-recommended-scss (see below), maybe the version of stylelint-config-recommended just needs to be bumped to version ^10.0.1?

'use strict';
module.exports = {
extends: ['stylelint-config-recommended'],
customSyntax: require('postcss-scss'),
plugins: ['stylelint-scss'],
rules: {
'annotation-no-unknown': [
true,
{
ignoreAnnotations: ['default', 'global'],
},
],
'at-rule-no-unknown': null,
'comment-no-empty': null,
'function-no-unknown': null,
'no-invalid-position-at-import-rule': [
true,
{
ignoreAtRules: ['use', 'forward'],
},
],
'scss/at-extend-no-missing-placeholder': true,
'scss/at-if-no-null': true,
'scss/at-import-no-partial-leading-underscore': true,
'scss/at-import-partial-extension': 'never',
'scss/at-rule-no-unknown': true,
'scss/comment-no-empty': true,
'scss/declaration-nested-properties-no-divided-groups': true,
'scss/dollar-variable-no-missing-interpolation': true,
'scss/function-quote-no-quoted-strings-inside': true,
'scss/function-unquote-no-unquoted-strings-inside': true,
'scss/no-duplicate-mixins': true,
'scss/no-global-function-names': true,
'scss/operator-no-newline-after': true,
'scss/operator-no-newline-before': true,
'scss/operator-no-unspaced': true,
},
};

Right now it's at stylelint-config-recommended@^9.0.0:

"stylelint-config-recommended": "^9.0.0",

I haven't yet had time to look at the changes in stylelint 15, but I'll have a look at them this weekend.

I think I have around 10+ npm packages to update.

I tried to upgrade stylelint-config-recommended-scss with disastrous consequences:

npm up -D stylelint-config-recommended-scss
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: iie@0.19.0
npm ERR! Found: stylelint@15.0.0
npm ERR! node_modules/stylelint
npm ERR!   dev stylelint@"^15.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer stylelint@"^14.10.0" from stylelint-config-recommended-scss@8.0.0
npm ERR! node_modules/stylelint-config-recommended-scss
npm ERR!   dev stylelint-config-recommended-scss@"^8.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\mvalle\AppData\Local\npm-cache\_logs\2023-02-10T18_29_30_383Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\mvalle\AppData\Local\npm-cache\_logs\2023-02-10T18_29_30_383Z-debug-0.log

Installing stylelint-config-recommended that was not installed but I think it comes from stylelint itself had similar outcome.
So maybe I should wait till the various stylelint-config-* will be upgraded.
Thanks!
mario

Thanks! Just tried out stylelint-config-recommended-scss@9.0.0 - looks good, no more warnings on my side:

$ yarn stylelint 'packages/**/*.{js,tsx}'
Done in 7.84s.

Fixed thanks!
Still appear some of the deprecation warnings because I have to disable the corresponding rule in my configuration (like color-hex-case: null or no-empty-first-line: null).

I have to disable the corresponding rule in my configuration (like color-hex-case: null or no-empty-first-line: null).

You can remove the lines disabling these rules now, as long as the other configs that you're extending from do not configure them. If you're extending from other configs which configure these rules, then you could open a similar issue in the repo of these other configs.

I also did this, now that stylelint-config-recommended-scss no longer configures these rules: upleveled/eslint-config-upleveled@55c7fcd (#197)

Thanks! I removed all deprecated rules from my configuration, but a single one remains and I don't have it anywhere:
"block-closing-brace-newline-after. It is defined somewhere in:

extends:
  - stylelint-config-standard
  - stylelint-config-standard-vue
  - stylelint-config-standard-scss
  - stylelint-config-recommended-vue/scss
  - stylelint-config-recommended-scss

I'll investigate.

Found. The block-closing-brace-newline-after rule is defined in stylelint-config-standard-scss/index.js line 14.
Where should I report this problem?

Found. The block-closing-brace-newline-after rule is defined in stylelint-config-standard-scss/index.js line 14. Where should I report this problem?

You can report it here:
https://github.com/stylelint-scss/stylelint-config-standard-scss

@crystalfp Just check first that you are using the latest version of that library.

Yes, they fixed it. Thanks!
mario