Skip to content

Commit 31c3ee8

Browse files
committed
run prettier on this commit
1 parent 7feeb95 commit 31c3ee8

File tree

3 files changed

+46
-28
lines changed

3 files changed

+46
-28
lines changed

checkbox.android.ts

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,48 @@
1-
import { Color } from 'tns-core-modules/color'
2-
import { device } from "tns-core-modules/platform"
3-
import app = require("tns-core-modules/application")
1+
import { Color } from "tns-core-modules/color";
2+
import { device } from "tns-core-modules/platform";
3+
import app = require("tns-core-modules/application");
44
import { CheckBoxInterface } from ".";
5-
import { View, Property, CssProperty, Style, booleanConverter} from "tns-core-modules/ui/core/view"
5+
import {
6+
View,
7+
Property,
8+
CssProperty,
9+
Style,
10+
booleanConverter
11+
} from "tns-core-modules/ui/core/view";
612
declare const android: any;
713

814
export const checkedProperty = new Property<CheckBox, boolean>({
915
name: "checked",
1016
defaultValue: false,
1117
valueConverter: booleanConverter,
1218
valueChanged: onCheckedPropertyChanged
13-
})
19+
});
1420

1521
export const textProperty = new Property<CheckBox, string>({
1622
name: "text",
1723
defaultValue: "",
1824
valueChanged: onTextPropertyChanged
19-
})
25+
});
2026

2127
export const fillColorProperty = new CssProperty<Style, string>({
2228
name: "fillColor",
2329
cssName: "fill-color",
2430
valueConverter: v => {
2531
return String(v);
2632
}
27-
})
33+
});
2834

2935
export const tintColorProperty = new CssProperty<Style, string>({
3036
name: "tintColor",
3137
cssName: "tint-color",
3238
defaultValue: "#0075ff",
3339
valueConverter: v => {
34-
return String(v)
40+
return String(v);
3541
}
36-
})
42+
});
3743

3844
export class CheckBox extends View implements CheckBoxInterface {
39-
private _android: any /// android.widget.CheckBox
45+
private _android: any; /// android.widget.CheckBox
4046
private _checkStyle: string;
4147
private _checkPadding: string;
4248
private _checkPaddingLeft: string;

checkbox.ios.ts

+23-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
import { CheckBoxInterface } from "./index"
2-
import { Property, CssProperty, Style, booleanConverter} from "tns-core-modules/ui/core/view"
3-
import { Color } from "tns-core-modules/color"
4-
import { Button } from "tns-core-modules/ui/button"
1+
import { CheckBoxInterface } from "./index";
2+
import {
3+
Property,
4+
CssProperty,
5+
Style,
6+
booleanConverter
7+
} from "tns-core-modules/ui/core/view";
8+
import { Color } from "tns-core-modules/color";
9+
import { Button } from "tns-core-modules/ui/button";
510

611
declare const CGRectMake: any, CGPointMake: any;
712
const checkBoxBackgroundColorProperty = new CssProperty<Style, string>({
@@ -16,48 +21,48 @@ const onCheckColorProperty = new CssProperty<Style, string>({
1621
cssName: "on-check-color",
1722
defaultValue: "#ffffff",
1823
valueConverter: v => {
19-
return String(v)
24+
return String(v);
2025
}
21-
})
26+
});
2227

2328
const tintColorProperty = new CssProperty<Style, string>({
2429
name: "tintColor",
2530
cssName: "tint-color",
2631
// defaultValue: "#0075ff",
2732
valueConverter: v => {
28-
return String(v)
33+
return String(v);
2934
}
30-
})
35+
});
3136

3237
const onTintColorProperty = new CssProperty<Style, string>({
3338
name: "onTintColor",
3439
cssName: "on-tint-color",
3540
valueConverter: v => {
36-
return String(v)
41+
return String(v);
3742
}
38-
})
43+
});
3944

4045
const fillColorProperty = new CssProperty<Style, string>({
4146
name: "fillColor",
4247
cssName: "fill-color",
4348
valueConverter: v => {
44-
return String(v)
49+
return String(v);
4550
}
46-
})
51+
});
4752

4853
const checkedProperty = new Property<CheckBox, boolean>({
4954
name: "checked",
5055
defaultValue: false,
5156
valueConverter: booleanConverter,
5257
valueChanged: onCheckedPropertyChanged
53-
})
58+
});
5459

5560
export class CheckBox extends Button implements CheckBoxInterface {
56-
_onCheckColor: string
57-
_checkBoxBackgroundColor: any
58-
_onTintColor: string
59-
_tintColor: string
60-
_onFillColor: string
61+
_onCheckColor: string;
62+
_checkBoxBackgroundColor: any;
63+
_onTintColor: string;
64+
_tintColor: string;
65+
_onFillColor: string;
6166
_fillColor: string;
6267
private _iosCheckbox: BEMCheckBox;
6368
private _delegate: BEMCheckBoxDelegateImpl;

package.json

+7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
}
1212
},
1313
"scripts": {
14+
"precommit": "lint-staged",
1415
"build": "tsc",
1516
"copy.ios": "cp -R checkbox.*.js demo/node_modules/nativescript-checkbox && cd demo && tns run ios --syncAllFiles",
1617
"copy.android": "cp -R checkbox.*.js demo/node_modules/nativescript-checkbox && cd demo && tns run android --syncAllFiles",
@@ -25,6 +26,12 @@
2526
"preparedemong": "npm run build && cd demo-ng && tns plugin remove nativescript-checkbox && tns plugin add .. && tns install",
2627
"setup": "cd demo && npm install && cd .. && npm run build && cd demo && tns plugin add .. && cd .."
2728
},
29+
"lint-staged": {
30+
"*.ts": [
31+
"prettier --write",
32+
"git add"
33+
]
34+
},
2835
"repository": {
2936
"type": "git",
3037
"url": "https://github.com/bradmartin/nativescript-checkbox.git"

0 commit comments

Comments
 (0)