stylelint / vscode-stylelint

The official Visual Studio Code extension for Stylelint
https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint
MIT License
311 stars 29 forks source link

Unreasonably high CPU usage #222

Closed aidenlangley closed 2 years ago

aidenlangley commented 3 years ago

Clearly describe the bug

This seems a bit excessive, and I'm tempted to run without the VS Code extension and just lint before building, but this means I'll be backtracking and fixing code when I could be writing lint-passing code at the time.

Is it constantly linting my entire repo? Just linting the open file would be preferable.

image

What code is needed to reproduce this issue?

My repo is hosted here: https://github.com/aidenlangley/wowhub.co.nz

All configs and code can be found & inspected if you'd like. I'll include my VS code user settings & workspace settings also.

What vscode-stylelint configuration is needed to reproduce the bug?

My only user space VS code stylelint setting is as follows:

"stylelint.snippet": ["css", "less", "scss"],

My workspace settings, really simple too:

"stylelint.packageManager": "npm",
...
"css.validate": false,
"less.validate": false,
"scss.validate": false,

My other extensions

code --install-extension arcanis.vscode-zipfs
code --install-extension be5invis.toml
code --install-extension bierner.markdown-emoji
code --install-extension bmalehorn.vscode-fish
code --install-extension bradlc.vscode-tailwindcss
code --install-extension burkeholland.simple-react-snippets
code --install-extension DavidAnson.vscode-markdownlint
code --install-extension dbaeumer.vscode-eslint
code --install-extension EditorConfig.EditorConfig
code --install-extension eg2.vscode-npm-script
code --install-extension esbenp.prettier-vscode
code --install-extension foxundermoon.shell-format
code --install-extension GitHub.github-vscode-theme
code --install-extension golang.go
code --install-extension matklad.rust-analyzer
code --install-extension mikestead.dotenv
code --install-extension ms-azuretools.vscode-docker
code --install-extension ms-python.python
code --install-extension ms-python.vscode-pylance
code --install-extension ms-toolsai.jupyter
code --install-extension ms-toolsai.jupyter-keymap
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-vscode.vscode-typescript-next
code --install-extension naumovs.color-highlight
code --install-extension octref.vetur
code --install-extension rust-lang.rust
code --install-extension silvenon.mdx
code --install-extension streetsidesoftware.code-spell-checker
code --install-extension stylelint.vscode-stylelint
code --install-extension svelte.svelte-vscode
code --install-extension vscode-icons-team.vscode-icons
code --install-extension xabikos.JavaScriptSnippets
code --install-extension yzhang.markdown-all-in-one
code --install-extension zhuangtongfa.material-theme

Is this issue related to autofix? (editor.codeActionsOnSave)

No

Which version of vscode-stylelint are you using?

v0.86.0

Which version of stylelint are you using?

13.13.1

Does your issue relate to non-standard syntax (e.g. SCSS, nesting, etc.)?

I am using PostCSS & TailwindCSS, here is the config & plugins:

const mode = process.env.NODE_ENV
const dev = mode === 'development'

const config = {
  plugins: [
    require('postcss-import'),
    require('tailwindcss/nesting')(require('postcss-nesting')),
    require('tailwindcss'),
    require('autoprefixer'),
    !dev &&
      require('cssnano')({
        preset: 'default',
      }),
  ],
}

module.exports = config

What did you expect to happen?

Less fan noise please, less CPU usage.

What actually happened (e.g. what warnings or errors you are getting)?

My laptop is noisier than it ought to be.

adalinesimonian commented 2 years ago

Thanks for the report. In the last few weeks we've released vscode-stylelint 1.x, which targets Stylelint 14.x, and 0.x is no longer maintained (migration guide). Is this still an issue you're experiencing with 1.x?

Is it constantly linting my entire repo? Just linting the open file would be preferable.

Speaking for 1.x, the linter runs:

In all these instances, Stylelint itself is only run if the extension's configuration indicates that it should validate a given document. With default settings, for instance, a JS file won't be included in any of the above scenarios.

adalinesimonian commented 2 years ago

Closing this now since it's been a week. Feel free to re-open if this is continuing to be a problem. Thanks!