Skip to content

TypeError: Cannot read properties of undefined (reading '0') at LessParser.atrule #167

Open
@ccqgithub

Description

@ccqgithub

With vscode-stylelint, throw errors when typing, similar with relative issue.

  • Node Version: v16.15.1
  • NPM Version: 8.11.0
  • postcss Version: 8.4.14
  • postcss-less Version: 6.0.0

If you have a large amount of code to share which demonstrates the problem you're experiencing, please provide a link to your
repository rather than pasting code. Otherwise, please paste relevant short snippets below.

LESS

Throw errors when typing

.l

JavaScript

// js that reproduces the issue

Errors

image

Expected Behavior

No exceptions when typing

Actual Behavior

Exceptions.

How can we reproduce the behavior?

stylelintrc.js

module.exports = {
  plugins: ['stylelint-prettier'],
  extends: [
    'stylelint-config-recommended',
    'stylelint-config-css-modules',
    'stylelint-config-prettier'
  ],
  rules: {
    'at-rule-no-unknown': null,
    'font-family-no-missing-generic-family-keyword': null,
    'no-descending-specificity': null,
    'selector-pseudo-class-no-unknown': [
      true,
      {
        ignorePseudoClasses: ['global', 'local']
      }
    ],
    'selector-type-no-unknown': [
      true,
      {
        ignoreTypes: ['/[a-zA-Z-]+/']
      }
    ],
    'function-no-unknown': [
      true,
      {
        ignoreFunctions: ['constant']
      }
    ],
    'prettier/prettier': true
  },
  overrides: [
    {
      files: ['*.less', '**/*.less'],
      customSyntax: 'postcss-less-fix'
    }
  ]
};

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions