Skip to content

Commit dede599

Browse files
authored
Merge pull request #26 from jdsantos/chore/add-prettier
Add prettier for code formatting
2 parents 37a64a1 + 8d1cdf3 commit dede599

File tree

5 files changed

+527
-544
lines changed

5 files changed

+527
-544
lines changed

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"useTabs": true,
5+
"tabWidth": 4,
6+
"semi": true,
7+
"endOfLine": "lf",
8+
"printWidth": 200,
9+
"quoteProps": "consistent",
10+
"arrowParens": "always",
11+
"bracketSpacing": true
12+
}

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"dist"
99
],
1010
"scripts": {
11+
"format": "prettier --write src/*.{js,ts}",
1112
"build": "webpack",
1213
"dev": "webpack --watch"
1314
},
@@ -33,6 +34,7 @@
3334
"convert-units": "^2.3.4"
3435
},
3536
"devDependencies": {
37+
"prettier": "^3.5.1",
3638
"webpack": "^5.75.0",
3739
"webpack-cli": "^5.0.0"
3840
},

src/maplibre-gl-measures.d.ts

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
declare module 'maplibre-gl-measures' {
2-
import {Map} from 'maplibre-gl';
3-
4-
interface MeasuresControlOptions {
5-
lang?: {
6-
areaMeasurementButtonTitle?: string;
7-
lengthMeasurementButtonTitle?: string;
8-
clearMeasurementsButtonTitle?: string;
9-
};
10-
units?: 'imperial' | 'metric';
11-
unitsGroupingSeparator?: string;
12-
style?: {
13-
text?: {
14-
radialOffset?: number;
15-
letterSpacing?: number;
16-
color?: string;
17-
haloColor?: string;
18-
haloWidth?: number;
19-
font?: string;
20-
};
21-
common?: {
22-
midPointRadius?: number;
23-
midPointColor?: string;
24-
midPointHaloRadius?: number;
25-
midPointHaloColor?: string;
26-
};
27-
areaMeasurement?: {
28-
fillColor?: string;
29-
fillOutlineColor?: string;
30-
fillOpacity?: number;
31-
lineWidth?: number;
32-
};
33-
lengthMeasurement?: {
34-
lineWidth?: number;
35-
lineColor?: string;
36-
};
37-
};
38-
onRender?: (features: any) => void;
39-
onCreate?: (features: any) => void;
40-
}
41-
42-
class MeasuresControl {
43-
constructor(options: MeasuresControlOptions);
44-
45-
onAdd(map: Map): HTMLElement;
46-
47-
onRemove(): void;
48-
}
49-
50-
export default MeasuresControl;
51-
}
1+
declare module 'maplibre-gl-measures' {
2+
import { Map } from 'maplibre-gl';
3+
4+
interface MeasuresControlOptions {
5+
lang?: {
6+
areaMeasurementButtonTitle?: string;
7+
lengthMeasurementButtonTitle?: string;
8+
clearMeasurementsButtonTitle?: string;
9+
};
10+
units?: 'imperial' | 'metric';
11+
unitsGroupingSeparator?: string;
12+
style?: {
13+
text?: {
14+
radialOffset?: number;
15+
letterSpacing?: number;
16+
color?: string;
17+
haloColor?: string;
18+
haloWidth?: number;
19+
font?: string;
20+
};
21+
common?: {
22+
midPointRadius?: number;
23+
midPointColor?: string;
24+
midPointHaloRadius?: number;
25+
midPointHaloColor?: string;
26+
};
27+
areaMeasurement?: {
28+
fillColor?: string;
29+
fillOutlineColor?: string;
30+
fillOpacity?: number;
31+
lineWidth?: number;
32+
};
33+
lengthMeasurement?: {
34+
lineWidth?: number;
35+
lineColor?: string;
36+
};
37+
};
38+
onRender?: (features: any) => void;
39+
onCreate?: (features: any) => void;
40+
}
41+
42+
class MeasuresControl {
43+
constructor(options: MeasuresControlOptions);
44+
45+
onAdd(map: Map): HTMLElement;
46+
47+
onRemove(): void;
48+
}
49+
50+
export default MeasuresControl;
51+
}

0 commit comments

Comments
 (0)