question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stylelint: Unknown word (CssSyntaxError)

See original GitHub issue

What steps are needed to reproduce the bug?

I just upgrade stylelint from version 13.13.1 to 14.2.0 and I start to get this error Stylelint: Unknown word (CssSyntaxError) on ts files.

I read this migration doc https://stylelint.io/migration-guide/to-14 but it not helped me.

and here is my relevant devDependencies I’m using

    "stylelint": "^14.2.0",
    "stylelint-config-sass-guidelines": "^9.0.1",
    "stylelint-config-standard": "^24.0.0",

What Stylelint configuration is needed to reproduce the bug?

{
  "extends": "stylelint-config-sass-guidelines",
  "rules": {
    "length-zero-no-unit": true,
    "unit-no-unknown": true,
    "property-no-unknown": true,
    "color-no-invalid-hex": true,
    "color-no-hex": true,
    "function-disallowed-list": ["/^rgb/", "/^hsl/"],
    "color-named": "never",
    "declaration-block-no-duplicate-properties": true,
    "selector-pseudo-element-no-unknown": [true, { "ignorePseudoElements": ["ng-deep"] }],
    "media-feature-name-no-unknown": true,
    "at-rule-no-unknown": null,
    "comment-no-empty": true,
    "no-duplicate-at-import-rules": true,
    "no-extra-semicolons": true,
    "no-invalid-double-slash-comments": true,
    "shorthand-property-no-redundant-values": true,
    "value-keyword-case": "lower",
    "max-nesting-depth": null,
    "selector-no-qualifying-type": null,
    "selector-class-pattern": "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$|^noUi-|calenderMatMenu",
    "selector-max-compound-selectors": null,
    "scss/dollar-variable-pattern": null,
    "order/properties-alphabetical-order": null
  }
}

How did you run Stylelint?

stylelint ‘**/*.scss’ --fix

Which version of Stylelint are you using?

^14.2.0

What did you expect to happen?

Not to show me an un relevant error: Stylelint: Unknown word (CssSyntaxError)

What actually happened?

I see error on ts files with Stylelint: Unknown word (CssSyntaxError) on js import for example

import { DAY_DROPDOWN_ITEMS, getCorrectDayObjByValue, getDaysDropdownItems } from './day-dropdown-items.const';

Does the bug relate to non-standard syntax?

NO

Proposal to fix the bug

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ofirrifocommented, Jan 25, 2022

@jeddy3 Thanks! I just find how to solve my issue in the configuration of Webstorm. Preferences -> Languages & Frameworks-> Style Sheets -> Stylelint Now unselect the Process JS Files checkbox

Solve my issue

0reactions
GitHubJacksoncommented, May 26, 2022
module.exports = {
  customSyntax: 'postcss-less',
  extends: [
    'stylelint-config-html',
    'stylelint-config-recommended-vue',
    'stylelint-config-prettier',
  ],
};

this is my config,but there is some errors like this

yarn run v1.22.18
$ stylelint src/**/*.{vue,css,less}

src/App.vue
 23:1  ✖  Unknown word  CssSyntaxError

src/components/Counter.vue
 4:13  ✖  Unknown word  CssSyntaxError

the file like this

<style lang="less"><style>

package.json script is

"stylelint": "stylelint src/**/*.{vue,css,less}"

how can i solve it? it’s a vue3 project, stylelint v14.8.5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unknown word CssSyntaxError in import inside script tag in ...
Clearly describe the bug CssSyntaxError unknown word in import inside script tag in vue file Which rule, if any, is the bug related...
Read more >
How to allow // comments in scss within Stylelint (Unknown ...
The problem is that when I use // for comments, it throws Unknown word (CssSyntaxError)Stylelint(CssSyntaxError). Double slash comments ( // ) ...
Read more >
stylelint/stylelint - Gitter
client-core/src/styles/base/_buttons.scss:1:3: Unknown word ... I see this error in Unknown word CssSyntaxError in all the tsx files around import ...
Read more >
Stylelint-vscode - npm.io
Check Stylelint-vscode 7.0.0-6 package - Last release 7.0.0-6 with ISC licence at ... 'Unknown word (CssSyntaxError)', severity: 1, code: 'CssSyntaxError', ...
Read more >
stylelint-config-recommended-vue - npm package - Snyk
Not complying to this rule may result in broken Vue files parsing, generating confusing errors like Unknown word (CssSyntaxError) .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found