Skip to content

Commit e4f9a85

Browse files
committed
more snake case
1 parent dd6220a commit e4f9a85

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/mapping.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class GeneratedFragmentMapper {
99
this.tag_info = tag_info;
1010
}
1111

12-
get_position_relative_to_fragment(positionRelativeToFile) {
13-
const fragment_offset = this.offset_in_fragment(offset_at(positionRelativeToFile, this.generated_code));
12+
get_position_relative_to_fragment(position_relative_to_file) {
13+
const fragment_offset = this.offset_in_fragment(offset_at(position_relative_to_file, this.generated_code));
1414
return position_at(fragment_offset, this.tag_info.generated_content);
1515
}
1616

@@ -28,8 +28,8 @@ class OriginalFragmentMapper {
2828
this.tag_info = tag_info;
2929
}
3030

31-
get_position_relative_to_file(positionRelativeToFragment) {
32-
const parent_offset = this.offset_in_parent(offset_at(positionRelativeToFragment, this.tag_info.original_content));
31+
get_position_relative_to_file(position_relative_to_fragment) {
32+
const parent_offset = this.offset_in_parent(offset_at(position_relative_to_fragment, this.tag_info.original_content));
3333
return position_at(parent_offset, this.original_code);
3434
}
3535

@@ -43,7 +43,7 @@ class SourceMapper {
4343
this.raw_source_map = raw_source_map;
4444
}
4545

46-
getOriginalPosition(generated_position) {
46+
get_original_position(generated_position) {
4747
if (generated_position.line < 0) {
4848
return { line: -1, column: -1 };
4949
}
@@ -117,13 +117,13 @@ export class DocumentMapper {
117117
return this.to_ESLint_position(original_position);
118118
}
119119

120-
map(mapper, generatedPosition) {
120+
map(mapper, generated_position) {
121121
// Map the position to be relative to the transpiled fragment
122122
const position_in_transpiled_fragment = mapper.generated_fragment_mapper.get_position_relative_to_fragment(
123-
generatedPosition
123+
generated_position
124124
);
125125
// Map the position, using the sourcemap, to the original position in the source fragment
126-
const position_in_original_fragment = mapper.source_mapper.getOriginalPosition(
126+
const position_in_original_fragment = mapper.source_mapper.get_original_position(
127127
position_in_transpiled_fragment
128128
);
129129
// Map the position to be in the original fragment's parent

src/preprocess.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ export const preprocess = text => {
6767
state.var_names = new Set(vars.map(v => v.name));
6868

6969
// convert warnings to linting messages
70-
const filteredWarnings = processor_options.ignore_warnings ? warnings.filter(warning => !processor_options.ignore_warnings(warning)) : warnings;
71-
state.messages = filteredWarnings.map(({ code, message, start, end }) => {
70+
const filtered_warnings = processor_options.ignore_warnings ? warnings.filter(warning => !processor_options.ignore_warnings(warning)) : warnings;
71+
state.messages = filtered_warnings.map(({ code, message, start, end }) => {
7272
const start_pos = processor_options.typescript && start ?
7373
mapper.get_original_position(start) :
7474
start && { line: start.line, column: start.column + 1 };
@@ -87,7 +87,7 @@ export const preprocess = text => {
8787
});
8888

8989
// build strings that we can send along to ESLint to get the remaining messages
90-
90+
9191
// Things to think about:
9292
// - not all Svelte files may be typescript -> do we need a distinction on a file basis by analyzing the attribute + a config option to tell "treat all as TS"?
9393
const with_file_ending = (filename) => `${filename}${processor_options.typescript ? '.ts' : '.js'}`;

0 commit comments

Comments
 (0)