We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
--stdin --fix
1 parent a592d3d commit 07e2762Copy full SHA for 07e2762
cli-main.js
@@ -157,7 +157,7 @@ if (options.nodeVersion) {
157
if (options.fix) {
158
const result = xo.lintText(stdin, options).results[0];
159
// If there is no output, pass the stdin back out
160
- console.log(result.output || stdin);
+ process.stdout.write(result.output || stdin);
161
return;
162
}
163
test/cli-main.js
@@ -17,9 +17,9 @@ test('fix option', async t => {
17
18
test('fix option with stdin', async t => {
19
const {stdout} = await main(['--fix', '--stdin'], {
20
- input: 'console.log()\n'
+ input: 'console.log()'
21
});
22
- t.is(stdout.trim(), 'console.log();');
+ t.is(stdout, 'console.log();');
23
24
25
test('stdin-filename option with stdin', async t => {
0 commit comments