lint commas

pull/5428/head
Milan Hauth 5 years ago
parent 6d06b7b8da
commit 433213a5e4

@ -20,7 +20,7 @@ function get_end_location(s: string): SourceLocation {
const parts = s.split("\n"); const parts = s.split("\n");
return { return {
line: parts.length - 1, line: parts.length - 1,
column: parts[parts.length - 1].length - 1, column: parts[parts.length - 1].length - 1
}; };
} }
@ -49,7 +49,7 @@ export function sourcemap_add_offset(
return { return {
sources: map.sources, sources: map.sources,
mappings: new_mappings, mappings: new_mappings
} as SourceMappings; } as SourceMappings;
} }
@ -86,7 +86,7 @@ export class StringWithSourcemap {
version: 3, version: 3,
sources: this.map.sources, sources: this.map.sources,
names: [], names: [],
mappings: sourcemap_encode(this.map.mappings as any), mappings: sourcemap_encode(this.map.mappings as any)
}; };
} }
@ -173,7 +173,7 @@ export class StringWithSourcemap {
this.generated + other.generated, { this.generated + other.generated, {
sources: new_sources, sources: new_sources,
names: new_names, names: new_names,
mappings: new_mappings, mappings: new_mappings
}); });
} }
@ -186,7 +186,7 @@ export class StringWithSourcemap {
const replacement_map: SourceMappings = { const replacement_map: SourceMappings = {
names: [], names: [],
sources: [], sources: [],
mappings: [], mappings: []
}; };
if (generated.length == 0) if (generated.length == 0)
@ -211,7 +211,7 @@ export class StringWithSourcemap {
const map: SourceMappings = { const map: SourceMappings = {
names: [], names: [],
sources: [source_file], sources: [source_file],
mappings: [], mappings: []
}; };
if (source.length == 0) return new StringWithSourcemap(source, map); if (source.length == 0) return new StringWithSourcemap(source, map);
@ -231,7 +231,7 @@ export class StringWithSourcemap {
0, 0,
line_idx + offset.line, line_idx + offset.line,
// shift first line // shift first line
pos + (line_idx == 0 ? offset.column : 0), pos + (line_idx == 0 ? offset.column : 0)
]; ];
pos = pos + s.length; pos = pos + s.length;
return seg; return seg;

@ -21,6 +21,6 @@ export default {
options: { options: {
// options.filename is preferred over preprocessor.filename // options.filename is preferred over preprocessor.filename
// see function preprocess // see function preprocess
filename: 'file.svelte', filename: 'file.svelte'
} }
}; };

Loading…
Cancel
Save