-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work for imported .scss files by @import #89
Comments
💎 $20 bounty created by @selimdoyranli |
Hi @selimdoyranli This module uses the Try enabling the // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
...
modules: [
[
'@nuxtjs/stylelint-module',
{
chokidar: true
}
]
]
}) |
It didn't work. Please try editing the _general.scss file (in this structure: https://stackblitz.com/github/selimdoyranli/nuxt3-boilerplate-issue) to debug the issue. For example, in this file body scope's color: red; (this banned rule) When I type, I should see an error message on the browser screen after HMR, but I don't. Only error message appears in terminal |
Actually, I can't use Nuxt3 due to this issue 🤣.If there is a bug I guess other developers may see this as a serious problem when migrating to nuxt3. (fyi @ricardogobbosouza @pi0 @manniL and I would appreciate your assistances) This problem doesn't occur when I'm using Nuxt2. Stylelint is important for me. Sorry for the spam. |
Using the |
/attempt #89 |
/attempt #89 |
hi @selimdoyranli, the reason that vite build did not error out, was most likely because the underlying library I've PR-ed to |
@raphlcx Hey! Thanks for your PR! But I think it is going in the wrong direction. Correct me if I'm wrong. Thanks! 🙏 |
Actually, for Nuxt3 / Vite, would setting error on the plugin context prevent HMR from updating the browser? Should we utilise Vite's HMR API instead for handling or intercepting HMR updates? Here's my experiment with First, I start the dev server using Then, I intentionally modify // src/components/Hello.vue
<template lang="pug">
h1.hello hello 1
</template>
<script lang="ts">
console.log(1);
console.log(2);
</script>
<style lang="scss" src="./Hello.scss"></style> And I noticed there's a number of ESLint errors on the terminal console:
However, on my browser at
So, even by setting error on plugin context, the nuxt modules for ESLint also did not prevent HMR from delivering its updates to the browser, perhaps because it's not utilisng the HMR API? I might also be missing out something here. |
#89 is trying to handle this issue. |
/attempt #89 |
I was using nuxt2 + @nuxtjs/style-resources + @nuxtjs/stylelint-module in my previous projects. It was working fine in my previous projects. I decided to switch to nuxt3, I'm using nuxt3 + @nuxtjs/stylelint-module in a project I've just tried, but as I mentioned in the title, the module does not lint on scss files imported with @import. By the way I don't use @nuxtjs/style-resources as I can provide global scss with vite in my nuxt3 project.
In all other files, namely in .vue files, lint works as SFC, in .scss files in the components folder, in my /scss/app.scss entry point. But the lint doesn't work for the scss files I imported with the @import method in my /scss/app.scss file.
nuxt config of my nuxt3 project;
app.scss entry point file on my project;
.stylelintrc.js
package.json
My nuxt3 project and doesn't work on this, check link for the directory structure on my project:
https://stackblitz.com/github/selimdoyranli/nuxt3-boilerplate-issue
In addition my nuxt2 project and it works on this
https://stackblitz.com/github/selimdoyranli/nuxt2-boilerplate
The text was updated successfully, but these errors were encountered: