【问题标题】:Error: `severity` property of a stylelint warning must be either 'error' or 'warning', but it was 'ignore' (string)错误:stylelint 警告的“严重性”属性必须是“错误”或“警告”,但它是“忽略”(字符串)
【发布时间】:2019-07-17 04:08:39
【问题描述】:

VSCode-Stylelint 显示无意义的错误:

错误:severity stylelint 警告的属性必须是“错误”或“警告”,但它是“忽略”(字符串)。在 stylelintWarningToVscodeDiagnostic (/Users/xxx/.vscode/extensions/shinnn.stylelint-0.51.0/node_modules/stylelint-warning-to-vscode-diagnostic/index.js:40:9) at Array.map () at processResults ( /Users/xxxs/shinnn.stylelint-0.51.0/node_modules/stylelint-vscode/index.js:59:18) 在 stylelintVSCode (/Users/xxx/.vscode/extensions/shinnn.stylelint-0.51.0/node_modules/ stylelint-vscode/index.js:144:9)

我的.stylelintrc.js

module.exports = {
  defaultSeverity: 'warning',
  extends: [
    'stylelint-config-standard',
    'stylelint-config-css-modules',
    'stylelint-config-rational-order',
    'stylelint-config-prettier',
  ],
  plugins: ['stylelint-order', 'stylelint-declaration-block-no-ignored-properties'],
  rules: {
    'no-descending-specificity': null,
    'plugin/declaration-block-no-ignored-properties': true,
    'declaration-empty-line-before': null,
    'length-zero-no-unit': null,
    'function-whitespace-after': null,
  },
};

【问题讨论】:

    标签: visual-studio-code stylelint


    【解决方案1】:

    'stylelint-config-rational-order' 的较新版本有问题。

    如果您将其设置为版本0.0.4,它可以工作。

    Github 上已经创建了一个问题: https://github.com/constverum/stylelint-config-rational-order/issues/16

    【讨论】:

      猜你喜欢
      • 2015-01-05
      • 2014-02-17
      • 2016-07-29
      • 2017-02-12
      • 1970-01-01
      • 2019-02-19
      • 1970-01-01
      • 2013-12-15
      • 2022-08-05
      相关资源
      最近更新 更多