Skip to content

Commit 0e4ecd3

Browse files
committed
fix: @putout/cli-process-file: startLine: 1 -> 0
1 parent 805d0ef commit 0e4ecd3

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

packages/cli-process-file/.madrun.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const {run} = require('madrun');
44

55
module.exports = {
66
'test': () => `tape 'lib/**/*.spec.*'`,
7-
'watch:test': async () => `nodemon -w lib -x ${await run('test')}`,
7+
'watch:test': async () => `nodemon -w lib -x "${await run('test')}"`,
88
'lint': () => `putout .`,
99
'fresh:lint': () => run('lint', '--fresh'),
1010
'lint:fresh': () => run('lint', '--fresh'),

packages/cli-process-file/lib/process-file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ module.exports = ({fix, fixCount, logError, raw}) => async function processFile(
8282
};
8383
};
8484

85-
function formatPlaces(line = 1, places) {
85+
function formatPlaces(line = 0, places) {
8686
const newPlaces = [];
8787

8888
for (const place of places) {

packages/cli-process-file/lib/process-file.spec.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ test('putout: cli: process-file: options for inner data', async (t) => {
180180
message: `Use 'String (on/off)' instead of 'Boolean (true/false)'`,
181181
position: {
182182
column: 50,
183-
line: 2,
183+
line: 1,
184184
},
185185
rule: 'putout-config/convert-boolean-to-string',
186186
}];
@@ -252,14 +252,14 @@ test('putout: cli: process-file: ruler', async (t) => {
252252
message: `Use 'String (on/off)' instead of 'Boolean (true/false)'`,
253253
position: {
254254
column: 50,
255-
line: 2,
255+
line: 1,
256256
},
257257
rule: 'putout-config/convert-boolean-to-string',
258258
}, {
259259
message: 'Missing semicolon.',
260260
position: {
261261
column: 58,
262-
line: 3,
262+
line: 2,
263263
},
264264
rule: 'semi (eslint)',
265265
}];
@@ -449,7 +449,7 @@ test('putout: cli: process-file: plugin not found', async (t) => {
449449
message: `Cannot find package 'putout-plugin-travis'`,
450450
position: {
451451
column: 1,
452-
line: 2,
452+
line: 1,
453453
},
454454
rule: 'parser',
455455
}],
@@ -530,7 +530,7 @@ test('putout: cli: process-file: goldstein', async (t) => {
530530
message: `'x' is not defined.`,
531531
position: {
532532
column: 12,
533-
line: 3,
533+
line: 2,
534534
},
535535
rule: 'no-undef (eslint)',
536536
}],
@@ -576,14 +576,14 @@ test('putout: cli: process-file: goldstein: no braces', async (t) => {
576576
message: `'a' is not defined.`,
577577
position: {
578578
column: 5,
579-
line: 2,
579+
line: 1,
580580
},
581581
rule: 'no-undef (eslint)',
582582
}, {
583583
message: 'Empty block statement.',
584584
position: {
585585
column: 12,
586-
line: 2,
586+
line: 1,
587587
},
588588
rule: 'no-empty (eslint)',
589589
}],
@@ -624,14 +624,14 @@ test('putout: cli: process-file: syntax error', async (t) => {
624624
message: 'Unexpected token',
625625
position: {
626626
column: 10,
627-
line: 2,
627+
line: 1,
628628
},
629629
rule: 'parser',
630630
}, {
631631
message: 'Parsing error: Unexpected token {',
632632
position: {
633633
column: 11,
634-
line: 2,
634+
line: 1,
635635
},
636636
rule: 'parser (eslint)',
637637
}],
@@ -774,14 +774,14 @@ test('putout: cli: process-file: recursion: infinite loop', async (t) => {
774774
message: 'Unexpected token, expected "{"',
775775
position: {
776776
column: 13,
777-
line: 2,
777+
line: 1,
778778
},
779779
rule: 'parser',
780780
}, {
781781
message: 'Parsing error: Unexpected token =>',
782782
position: {
783783
column: 14,
784-
line: 2,
784+
line: 1,
785785
},
786786
rule: 'parser (eslint)',
787787
}],

0 commit comments

Comments
 (0)