Skip to content

Commit 083db13

Browse files
committed
chore: run latest prettier
1 parent 8f057ee commit 083db13

File tree

21 files changed

+60
-60
lines changed

21 files changed

+60
-60
lines changed

demo/src/components/Home.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ onUnmounted(() => {
5858
<template #default="{ item, index, even, odd }: ListItem<Test>">
5959
<Label
6060
:text="`item: ${JSON.stringify(
61-
item
61+
item,
6262
)}\n\nindex: ${index} even: ${even} odd: ${odd}`"
6363
textWrap="true"
6464
padding="16"
@@ -69,7 +69,7 @@ onUnmounted(() => {
6969
<Label
7070
backgroundColor="red"
7171
:text="`item: ${JSON.stringify(
72-
item
72+
item,
7373
)}\n\nindex: ${index} even: ${even} odd: ${odd}`"
7474
textWrap="true"
7575
padding="16"

demo/src/components/demo_ListView.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ const items2 = ref(
4343
return {
4444
name: `Item ${i}`,
4545
};
46-
})
47-
)
46+
}),
47+
),
4848
);
4949
const name = ref('Vue 3');
5050

devtools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if (__DEV__) {
2323
_global.window ??= _global;
2424

2525
console.warn(
26-
`[VueDevtools] Connecting to ${global.__VUE_DEVTOOLS_HOST__}:${global.__VUE_DEVTOOLS_PORT__}...`
26+
`[VueDevtools] Connecting to ${global.__VUE_DEVTOOLS_HOST__}:${global.__VUE_DEVTOOLS_PORT__}...`,
2727
);
2828
require('@vue/devtools/build/hook.js');
2929
require('@vue/devtools/build/backend.js');

nativescript.webpack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function startVueDevtools(port, isAndroid = false) {
4545
console.log(`[VueDevtools] Starting standalone Vue Devtools on port ${port}`);
4646
if (isAndroid) {
4747
console.log(
48-
`[VueDevtools] If the app doesn't automatically connect, check if http traffic is allowed. (e.g. on Android, you may need to set android:usesCleartextTraffic="true" in AndroidManifest.xml)`
48+
`[VueDevtools] If the app doesn't automatically connect, check if http traffic is allowed. (e.g. on Android, you may need to set android:usesCleartextTraffic="true" in AndroidManifest.xml)`,
4949
);
5050
}
5151
spawn(require.resolve('@vue/devtools/bin.js'), [], {

packages/stackblitz-template/src/components/Details.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ref, $navigateBack } from 'nativescript-vue';
44
const items = ref(
55
Array(1000)
66
.fill(0)
7-
.map((_, index) => `Item ${index + 1}`)
7+
.map((_, index) => `Item ${index + 1}`),
88
);
99
</script>
1010

packages/template-blank/hooks/after-createProject/after-createProject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module.exports = function (hookArgs) {
5555
.resolve('@nativescript/webpack/package.json', {
5656
paths: [appRootFolder],
5757
})
58-
.replace('package.json', 'dist/bin/index.js')
58+
.replace('package.json', 'dist/bin/index.js'),
5959
);
6060

6161
// init webpack config

packages/template-blank/src/components/Details.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ref, $navigateBack } from 'nativescript-vue';
44
const items = ref(
55
Array(1000)
66
.fill(0)
7-
.map((_, index) => `Item ${index + 1}`)
7+
.map((_, index) => `Item ${index + 1}`),
88
);
99
</script>
1010

src/components/ActionBar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ export const ActionBar = /*#__PURE__*/ defineComponent({
6767
if (__DEV__) {
6868
warn(
6969
`<ActionBar> must be a direct child of a <Page> element - ` +
70-
`got <${parent.nativeView.constructor.name}> instead.`
70+
`got <${parent.nativeView.constructor.name}> instead.`,
7171
);
7272
}
7373
}
7474
},
7575
},
76-
ctx.slots.default ? ctx.slots.default() : undefined
76+
ctx.slots.default ? ctx.slots.default() : undefined,
7777
);
7878
};
7979
},

src/components/ListView.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const ListView = /*#__PURE__*/ defineComponent({
9595
props.items instanceof ObservableArray
9696
? props.items.getItem(event.index)
9797
: props.items[event.index],
98-
event.index
98+
event.index,
9999
);
100100

101101
// update the cell data with the current row
@@ -137,7 +137,7 @@ export const ListView = /*#__PURE__*/ defineComponent({
137137

138138
if (vnodes.length > 1) {
139139
warn(
140-
`ListView template must contain a single root element. Found: ${vnodes.length}. Only the first one will be used.`
140+
`ListView template must contain a single root element. Found: ${vnodes.length}. Only the first one will be used.`,
141141
);
142142
}
143143

@@ -158,7 +158,7 @@ export const ListView = /*#__PURE__*/ defineComponent({
158158
itemTemplateSelector,
159159
onitemLoading,
160160
},
161-
cellVNODES()
161+
cellVNODES(),
162162
);
163163
};
164164
},

src/dom/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export abstract class NSVNode {
6161
}
6262

6363
const selfIndex = this.parentNode.childNodes.findIndex(
64-
(n) => n.nodeId === this.nodeId
64+
(n) => n.nodeId === this.nodeId,
6565
);
6666

6767
if (selfIndex > -1 && selfIndex < this.parentNode.childNodes.length - 1) {
@@ -77,7 +77,7 @@ export abstract class NSVNode {
7777
}
7878

7979
const selfIndex = this.parentNode.childNodes.findIndex(
80-
(n) => n.nodeId === this.nodeId
80+
(n) => n.nodeId === this.nodeId,
8181
);
8282

8383
if (selfIndex > 0) {
@@ -148,7 +148,7 @@ export class NSVElement extends NSVNode {
148148
addEventListener(
149149
event: string,
150150
handler: any,
151-
options: AddEventListenerOptions = {}
151+
options: AddEventListenerOptions = {},
152152
) {
153153
const { capture, once } = options;
154154
if (capture) {
@@ -212,7 +212,7 @@ export class NSVElement extends NSVNode {
212212
}
213213

214214
const refIndex = this.childNodes.findIndex(
215-
(node) => node.nodeId === anchor.nodeId
215+
(node) => node.nodeId === anchor.nodeId,
216216
);
217217

218218
if (refIndex === -1) {
@@ -246,7 +246,7 @@ export class NSVElement extends NSVNode {
246246

247247
removeChild(el: NSVNode) {
248248
const index = this.childNodes.findIndex(
249-
(node) => node.nodeId === el.nodeId
249+
(node) => node.nodeId === el.nodeId,
250250
);
251251

252252
if (index > -1) {
@@ -277,7 +277,7 @@ export class NSVElement extends NSVNode {
277277
return text;
278278
}
279279
return text + currentNode.text;
280-
}, '')
280+
}, ''),
281281
);
282282
}
283283
}

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ declare module '@vue/runtime-core' {
2424
mount(
2525
rootContainer?: NSVRoot | string,
2626
isHydrate?: boolean,
27-
isSVG?: boolean
27+
isSVG?: boolean,
2828
): ComponentPublicInstance;
2929
registerElement: typeof registerElement;
3030
}
@@ -141,7 +141,7 @@ function wrapCreate<T>(originalFunction: T): T {
141141
return ((type: any, ...args: any) => {
142142
return (originalFunction as any)(
143143
maybeConvertToKnownComponentOrViewName(type),
144-
...args
144+
...args,
145145
);
146146
}) as T;
147147
}

src/nativescript/elements.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,66 +10,66 @@ export function registerCoreElements() {
1010
registerElement(
1111
'AbsoluteLayout',
1212
() => require('@nativescript/core').AbsoluteLayout,
13-
{ viewFlags: NSVViewFlags.LAYOUT_VIEW }
13+
{ viewFlags: NSVViewFlags.LAYOUT_VIEW },
1414
);
1515
registerElement(
1616
'DockLayout',
1717
() => require('@nativescript/core').DockLayout,
1818
{
1919
viewFlags: NSVViewFlags.LAYOUT_VIEW,
20-
}
20+
},
2121
);
2222
registerElement(
2323
'FlexboxLayout',
2424
() => require('@nativescript/core').FlexboxLayout,
25-
{ viewFlags: NSVViewFlags.LAYOUT_VIEW }
25+
{ viewFlags: NSVViewFlags.LAYOUT_VIEW },
2626
);
2727
registerElement(
2828
'GridLayout',
2929
() => require('@nativescript/core').GridLayout,
3030
{
3131
viewFlags: NSVViewFlags.LAYOUT_VIEW,
32-
}
32+
},
3333
);
3434
registerElement(
3535
'RootLayout',
3636
() => require('@nativescript/core').RootLayout,
3737
{
3838
viewFlags: NSVViewFlags.LAYOUT_VIEW,
39-
}
39+
},
4040
);
4141
registerElement(
4242
'StackLayout',
4343
() => require('@nativescript/core').StackLayout,
44-
{ viewFlags: NSVViewFlags.LAYOUT_VIEW }
44+
{ viewFlags: NSVViewFlags.LAYOUT_VIEW },
4545
);
4646
registerElement(
4747
'WrapLayout',
4848
() => require('@nativescript/core').WrapLayout,
4949
{
5050
viewFlags: NSVViewFlags.LAYOUT_VIEW,
51-
}
51+
},
5252
);
5353

5454
// ContentViews
5555
registerElement(
5656
'ContentView',
5757
() => require('@nativescript/core').ContentView,
58-
{ viewFlags: NSVViewFlags.CONTENT_VIEW }
58+
{ viewFlags: NSVViewFlags.CONTENT_VIEW },
5959
);
6060
registerElement(
6161
'ScrollView',
6262
() => require('@nativescript/core').ScrollView,
6363
{
6464
viewFlags: NSVViewFlags.CONTENT_VIEW,
65-
}
65+
},
6666
);
6767

6868
// ActionBar
6969
registerElement('ActionItem', () => require('@nativescript/core').ActionItem);
7070
registerElement(
7171
'NavigationButton',
72-
() => require('@nativescript/core').NavigationButton
72+
() => require('@nativescript/core').NavigationButton,
7373
);
7474

7575
// navigation
@@ -88,7 +88,7 @@ export function registerCoreElements() {
8888
if (__DEV__) {
8989
warn(
9090
`<Frame> must only contain <Page> elements - ` +
91-
`got <${child.nativeView.constructor.name}> instead.`
91+
`got <${child.nativeView.constructor.name}> instead.`,
9292
);
9393
}
9494
}
@@ -110,7 +110,7 @@ export function registerCoreElements() {
110110
// components
111111
registerElement(
112112
'ActivityIndicator',
113-
() => require('@nativescript/core').ActivityIndicator
113+
() => require('@nativescript/core').ActivityIndicator,
114114
);
115115
registerElement('Button', () => require('@nativescript/core').Button);
116116
registerElement(
@@ -121,7 +121,7 @@ export function registerCoreElements() {
121121
prop: 'date',
122122
event: 'dateChange',
123123
},
124-
}
124+
},
125125
);
126126
registerElement(
127127
'FormattedString',
@@ -143,7 +143,7 @@ export function registerCoreElements() {
143143
}
144144
},
145145
},
146-
}
146+
},
147147
);
148148
registerElement('Image', () => require('@nativescript/core').Image);
149149
registerElement('Label', () => require('@nativescript/core').Label);
@@ -155,11 +155,11 @@ export function registerCoreElements() {
155155
prop: 'selectedIndex',
156156
event: 'selectedIndexChange',
157157
},
158-
}
158+
},
159159
);
160160
registerElement(
161161
'Placeholder',
162-
() => require('@nativescript/core').Placeholder
162+
() => require('@nativescript/core').Placeholder,
163163
);
164164
registerElement('Progress', () => require('@nativescript/core').Progress);
165165
registerElement('SearchBar', () => require('@nativescript/core').SearchBar, {
@@ -176,11 +176,11 @@ export function registerCoreElements() {
176176
prop: 'selectedIndex',
177177
event: 'selectedIndexChange',
178178
},
179-
}
179+
},
180180
);
181181
registerElement(
182182
'SegmentedBarItem',
183-
() => require('@nativescript/core').SegmentedBarItem
183+
() => require('@nativescript/core').SegmentedBarItem,
184184
);
185185
registerElement('Slider', () => require('@nativescript/core').Slider, {
186186
model: {
@@ -215,6 +215,6 @@ export function registerCoreElements() {
215215
prop: 'time',
216216
event: 'timeChange',
217217
},
218-
}
218+
},
219219
);
220220
}

src/plugins/modals.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ declare module '@vue/runtime-core' {
1818
*/
1919
$showModal: <T = any>(
2020
component: Component,
21-
options?: ModalOptions
21+
options?: ModalOptions,
2222
) => Promise<T | false | undefined>;
2323
$closeModal: (arg: any) => void;
2424
$modal: {
@@ -42,7 +42,7 @@ export function install(app: App) {
4242
}
4343

4444
function resolveModalTarget(
45-
target: Ref<ResolvableModalTarget> | ResolvableModalTarget
45+
target: Ref<ResolvableModalTarget> | ResolvableModalTarget,
4646
): View | false {
4747
const ob = unref<ResolvableModalTarget>(target);
4848

@@ -59,10 +59,10 @@ function resolveModalTarget(
5959

6060
export async function $showModal<T = any>(
6161
component: Component,
62-
options: ModalOptions = {}
62+
options: ModalOptions = {},
6363
): Promise<T | false | undefined> {
6464
const modalTarget = resolveModalTarget(
65-
options.target ?? Application.getRootView()
65+
options.target ?? Application.getRootView(),
6666
);
6767

6868
if (!modalTarget) {

src/plugins/navigation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function resolveFrame(frame?: ResolvableFrame): Frame {
6060

6161
export function $navigateTo(
6262
target: Component,
63-
options?: NavigationOptions
63+
options?: NavigationOptions,
6464
): Page {
6565
try {
6666
const frame = resolveFrame(options?.frame);

src/registry/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ export function normalizeElementName(elementName: string): string {
7777
export function registerElement(
7878
elementName: string,
7979
resolver?: NSVElementResolver,
80-
meta?: Partial<NSVViewMeta>
80+
meta?: Partial<NSVViewMeta>,
8181
) {
8282
const normalizedName = normalizeElementName(elementName);
8383
const mergedMeta = Object.assign({}, defaultViewMeta, meta);
8484

8585
if (elementMap[normalizedName] && !mergedMeta.overwriteExisting) {
8686
throw new Error(
8787
`Element for ${elementName} already registered.\n` +
88-
`If this is intentional set 'overwriteExisting: true' in 'meta'`
88+
`If this is intentional set 'overwriteExisting: true' in 'meta'`,
8989
);
9090
}
9191

0 commit comments

Comments
 (0)