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

xo --fix --quiet does not save changes on TypeScript files #562

Open
fregante opened this issue Jun 20, 2021 · 2 comments
Open

xo --fix --quiet does not save changes on TypeScript files #562

fregante opened this issue Jun 20, 2021 · 2 comments

Comments

@fregante
Copy link
Member

fregante commented Jun 20, 2021

xo --quiet reports the errors, but xo --quiet --fix acts like it fixes them, but it doesn't:

Repro

npm init -y
npm install xo
echo "console.log('hello')" > file.ts
npx xo --quiet --fix

What happens

No error is outputted, but no files are changed. This is confirmed by another run of xo

$ xo

  file.ts:1:21
  ✖  1:21  Missing semicolon.  @typescript-eslint/semi

  1 error

Omitting --quiet will fix it:

$ xo --fix
// no error

$ xo
// no error

Notes

The same ESLint version is able to save those changes when running:

npx eslint file.ts \
--rule '{"@typescript-eslint/semi": "error"}' \
--parser-options '{"sourceType": "module", ecmaVersion:2015}' \
--parser "@typescript-eslint/parser" \
--plugin "@typescript-eslint" \
--fix \
--quiet
  • Can still be reproduced in XO in 0.51.0
@fregante fregante changed the title xo --fix won't save fixes to disk, while eslint --fix can (typescript?) quiet doesn't allow xo --fix to save fixes to disk on TypeScript projects Jun 20, 2021
@fregante fregante changed the title quiet doesn't allow xo --fix to save fixes to disk on TypeScript projects quiet flag doesn't allow xo --fix to save fixes to disk on TypeScript projects Jun 20, 2021
@fregante fregante changed the title quiet flag doesn't allow xo --fix to save fixes to disk on TypeScript projects xo --fix --quiet does not save changes on TypeScript files Jun 20, 2021
fregante added a commit to refined-github/refined-github that referenced this issue Jul 8, 2021
@groenroos
Copy link

Does not seem to be limited to TypeScript files. I have the same behaviour on regular .js files with npx xo --fix --quiet.

@fisker
Copy link
Contributor

fisker commented Mar 23, 2022

xo/index.js

Line 105 in 7da6311

return processReport(report, {isQuiet: options.isQuiet});

Wrong options.isQuiet, should be the outer options.

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

No branches or pull requests

3 participants