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.

Unknown word CssSyntaxError in import inside script tag in vue file

See original GitHub issue

Clearly describe the bug

CssSyntaxError unknown word in import inside script tag in vue file image

Which rule, if any, is the bug related to?

What code is needed to reproduce the bug?

<script>
    import {ref, nextTick, onBeforeUnmount, watch, inject} from 'vue';
</script>

What Stylelint configuration is needed to reproduce the bug?

Which version of Stylelint are you using?

e.g. 14.0.0

How are you running stylelint: CLI, PostCSS plugin, Node.js API?

VSCode via stylelint plugin

Does the bug relate to non-standard syntax (e.g. SCSS, Less etc.)?

What did you expect to happen?

“No warnings to be flagged.”

What actually happened (e.g. what warnings or errors did you get)?

CssSyntaxError unknown word in import inside script tag in vue file

Issue Analytics

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

github_iconTop GitHub Comments

24reactions
ybiquitouscommented, Oct 22, 2021

Maybe, you may need to configure customSyntax: "postcss-html" in your Stylelint config files. (see also the v14 migration guide)

If you want to check Vue files, stylelint-config-recommended-vue may help you.

2reactions
jeddy3commented, Dec 1, 2022

I’ll open to issue to discuss whether we can add more validation to the configuration object.

We surface an error already for CLI, e.g.

// .stylelintrc
{}

Gives:

Error: No rules found within configuration. Have you provided a "rules" property?

It seems the VS Code extension doesn’t surface the error, though. One for that issue tracker, I think.

Thank you thank you thank you!

No worries.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is unknown word in vue scss compile? - Stack Overflow
I have vue application using typescript and when I ...
Read more >
Use Laravel mix to share sass variables between javascript ...
Here is my package.json file and webpack.mix.js file. ... element-admin\resources\js\components\ErrorLog\index.vue Unknown word 1 | > 2 | import API from "!
Read more >
Webpack Build Error: Can't resolve subcomponents within a ...
Coding example for the question Webpack Build Error: Can't resolve subcomponents within a PrimeVue UI component-Vue.js.
Read more >
Changelog | Stylelint
Fixed: TS compilation error due to needless file-entry-cache import (#6393) ... Fixed: false negatives for template literals within script tags by updating ...
Read more >
Using with Preprocessors - Tailwind CSS
The place you are most likely to run into this situation is in your main CSS file that includes your @tailwind declarations. Won't...
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