Skip to content
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

ESC color block in error-log #1072

Closed
1sm23 opened this issue Dec 20, 2021 · 8 comments · Fixed by #1265
Closed

ESC color block in error-log #1072

1sm23 opened this issue Dec 20, 2021 · 8 comments · Fixed by #1265

Comments

@1sm23
Copy link

1sm23 commented Dec 20, 2021

Description

I don't know when it started, some color block with ESC text came out in my error-log.

image

Steps to reproduce

Just run lint-staged

Debug Logs

expand to view
> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -

> vben-admin@2.7.2 lint:lint-staged
> lint-staged --debug

Running lint-staged with the following config:
{
  '*.{js,jsx,ts,tsx}': [
    'eslint --fix',
    'prettier --write'
  ],
  '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': [
    'prettier --write--parser json'
  ],
  'package.json': [
    'prettier --write'
  ],
  '*.vue': [
    'eslint --fix',
    'prettier --write',
    'stylelint --fix'
  ],
  '*.{scss,less,styl,html}': [
    'stylelint --fix',
    'prettier --write'
  ],
  '*.md': [
    'prettier --write'
  ]
}
[STARTED] Preparing...
[SUCCESS] Preparing...
[STARTED] Running tasks...
[STARTED] Running tasks for *.{js,jsx,ts,tsx}
[STARTED] Running tasks for {!(package)*.json,*.code-snippets,.!(browserslist)*rc}
[STARTED] Running tasks for package.json
[STARTED] Running tasks for *.vue
[STARTED] Running tasks for *.{scss,less,styl,html}
[STARTED] Running tasks for *.md
[SKIPPED] No staged files match {!(package)*.json,*.code-snippets,.!(browserslist)*rc}
[SKIPPED] No staged files match package.json
[SKIPPED] No staged files match *.md
[STARTED] eslint --fix
[STARTED] eslint --fix
[STARTED] stylelint --fix
[SUCCESS] stylelint --fix
[STARTED] prettier --write
[SUCCESS] prettier --write
[SUCCESS] Running tasks for *.{scss,less,styl,html}
[SUCCESS] eslint --fix
[STARTED] prettier --write
[SUCCESS] prettier --write
[SUCCESS] Running tasks for *.{js,jsx,ts,tsx}
[SUCCESS] eslint --fix
[STARTED] prettier --write
[SUCCESS] prettier --write
[STARTED] stylelint --fix
[FAILED] �[91mstylelint --fix�[39m �[2m[FAILED]�[22m
[SUCCESS] Running tasks...
[STARTED] Applying modifications...
[SKIPPED] Skipped because of errors from tasks.
[STARTED] Reverting to original state because of errors...
[SUCCESS] Reverting to original state because of errors...
[STARTED] Cleaning up...
[SUCCESS] Cleaning up...

�[91m�[91m�[91m stylelint --fix:�[39m

�[4msrc/views/config-manage/label-manage/Modal.vue�[24m
 �[2m15:29�[22m  �[31m�[31m✖�[39m  Unknown word  �[2mCssSyntaxError�[22m

�[4msrc/views/config-manage/label-manage/ModalTemplateAdd.vue�[24m
 �[2m46:53�[22m  �[31m�[31m✖�[39m  Unknown word  �[2mCssSyntaxError�[22m

�[4msrc/views/config-manage/label-manage/ModalTemplateDetail.vue�[24m
 �[2m2:12�[22m  �[31m�[31m✖�[39m  Unknown word  �[2mCssSyntaxError�[22m

�[4msrc/views/config-manage/label-manage/index.vue�[24m
 �[2m42:18�[22m  �[31m�[31m✖�[39m  Unknown word  �[2mCssSyntaxError�[22m

husky - pre-commit hook exited with code 1 (error)

Environment

  • OS: Windows 11
  • Node.js: 16.13.0
  • lint-staged: 11.2.6
@bencemagyar
Copy link

I have the same issue after eslinting my project via lint-staged in a husky pre-commit hook.
I couldn't resolve the problem so far, but after my search the issue seems to be related to this:
typicode/husky#968

@Musante
Copy link

Musante commented Jun 26, 2022

I have the same problem, any update?

@iiroj
Copy link
Member

iiroj commented Jun 26, 2022

Please update to the latest lint-staged, and post your debug logs. I can't really give any support without those. Does adding the FORCE_COLOR=1 env variable help?

@AGDevX
Copy link

AGDevX commented Jul 6, 2022

I have the same issue. FORCE_COLOR=0 didn't help. Neither did FORCE_COLOR=1.

Environment

  • OS: Windows 10
  • Node.js: 16.14.0
  • lint-staged: 13.0.3
  • Editor: VS Code 1.68.1

Debug Output
image

@Lawlzer
Copy link

Lawlzer commented Sep 22, 2022

I have the same issue. I can provide an example repo of this issue + specs if it would help. FORCE_COLOR=1 does not help.

image

@iiroj
Copy link
Member

iiroj commented Mar 5, 2023

Can you try installing lint-staged@next (version 13.1.3) to see if it helps? I restored supports-color in place of colorette's isColorSupported util, a change that was introduced in 13.0.0.

This was linked to pull requests Mar 5, 2023
@AGDevX
Copy link

AGDevX commented Mar 12, 2023

Hey @iiroj, I can confirm the latest version of lint-staged (version 13.2.0) is working as expected. Thank you for the fix!

@sharathdaniel
Copy link

sharathdaniel commented Jul 19, 2023

@iiroj Still having this issue with latest version inside VS Code
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

7 participants