mirror of
https://github.com/maputnik/editor.git
synced 2026-03-23 02:30:01 +00:00
Add precommit check (#1080)
Keeps the repo clean, same as several other of our repos --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -31,7 +31,7 @@ function tryToParse(text: string) {
|
||||
last_line: parseInt(errorMatch[1], 10),
|
||||
last_column: parseInt(errorMatch[2], 10)
|
||||
};
|
||||
|
||||
|
||||
// const loc = hash.loc;
|
||||
found.push({
|
||||
from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
|
||||
@@ -49,7 +49,7 @@ CodeMirror.registerHelper("lint", "json", (text: string) => {
|
||||
});
|
||||
|
||||
CodeMirror.registerHelper("lint", "mgl", (text: string, opts: any, doc: any) => {
|
||||
|
||||
|
||||
const found: MarkerRangeWithMessage[] = tryToParse(text);
|
||||
|
||||
const {context} = opts;
|
||||
|
||||
@@ -11,4 +11,4 @@ export function undoMessages(beforeStyle: StyleSpecification, afterStyle: StyleS
|
||||
}
|
||||
export function redoMessages(beforeStyle: StyleSpecification, afterStyle: StyleSpecification) {
|
||||
return diffMessages(beforeStyle, afterStyle).map(m => 'Redo ' + m)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,3 @@ export function changeSource(mapStyle: StyleSpecification, sourceId: string, sou
|
||||
sources: changedSources
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ export default class ZoomControl {
|
||||
this._container.setAttribute("data-wd-key", "maplibre:ctrl-zoom");
|
||||
this.setLabel("Zoom:");
|
||||
this.addEventListeners();
|
||||
|
||||
|
||||
return this._container;
|
||||
}
|
||||
|
||||
|
||||
updateZoomLevel() {
|
||||
this._textEl!.innerHTML = this._map!.getZoom().toFixed(2);
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export default class ZoomControl {
|
||||
this._textEl = this._container!.querySelector("span");
|
||||
this.updateZoomLevel();
|
||||
}
|
||||
|
||||
|
||||
addEventListeners (){
|
||||
this._map!.on('render', () => this.updateZoomLevel());
|
||||
this._map!.on('zoomIn', () => this.updateZoomLevel());
|
||||
|
||||
Reference in New Issue
Block a user