Skip to content

Commit 742eb46

Browse files
committed
style: add prettier & lint-staged
1 parent ddd256a commit 742eb46

23 files changed

+1103
-929
lines changed

.prettierrc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"semi": false,
5+
"tabWidth": 2,
6+
"overrides": [
7+
{
8+
"files": "*.md",
9+
"options": {
10+
"printWidth": 90,
11+
"useTabs": false,
12+
"trailingComma": "none",
13+
"arrowParens": "avoid",
14+
"proseWrap": "preserve"
15+
}
16+
},
17+
{
18+
"files": "*.{json,babelrc,eslintrc,remarkrc,prettierrc}",
19+
"options": {
20+
"useTabs": false
21+
}
22+
}
23+
]
24+
}

.vitepress/config.js

Lines changed: 96 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,109 @@
11
module.exports = {
2-
lang: "en-US",
3-
title: " ",
4-
description: "NativeScript docs",
2+
lang: 'en-US',
3+
title: ' ',
4+
description: 'NativeScript docs',
55

6-
head: [
7-
['link', { rel: 'stylesheet', href:'/styles.css' }]
8-
],
6+
head: [['link', { rel: 'stylesheet', href: '/styles.css' }]],
97

10-
themeConfig: {
11-
repo: "NativeScript/docs-new",
12-
docsDir: ".",
13-
logo: "/assets/images/NativeScript_Logo_Wide_White_Blue_Rounded_Blue.png",
8+
themeConfig: {
9+
repo: 'NativeScript/docs-new',
10+
docsDir: '.',
11+
logo: '/assets/images/NativeScript_Logo_Wide_White_Blue_Rounded_Blue.png',
1412

15-
editLinks: true,
16-
editLinkText: "Edit this page on GitHub",
17-
lastUpdated: "Last Updated",
13+
editLinks: true,
14+
editLinkText: 'Edit this page on GitHub',
15+
lastUpdated: 'Last Updated',
1816

19-
// algolia: {
20-
// apiKey: 'xxx',
21-
// indexName: 'xxx'
22-
// },
17+
// algolia: {
18+
// apiKey: 'xxx',
19+
// indexName: 'xxx'
20+
// },
2321

24-
nav: [
25-
{
26-
text: "Docs",
27-
link: "/introduction",
28-
activeMatch: "^/(?!plugins)",
29-
},
30-
{
31-
text: "Plugins",
32-
link: "/plugins/index",
33-
activeMatch: "^/plugins",
34-
},
35-
{
36-
text: "Capacitor",
37-
link: "https://capacitor.nativescript.org"
38-
},
39-
{
40-
text: 'Writing Guide',
41-
link: 'https://v3.vuejs.org/guide/contributing/writing-guide.html',
42-
}
43-
],
22+
nav: [
23+
{
24+
text: 'Docs',
25+
link: '/introduction',
26+
activeMatch: '^/(?!plugins)',
27+
},
28+
{
29+
text: 'Plugins',
30+
link: '/plugins/index',
31+
activeMatch: '^/plugins',
32+
},
33+
{
34+
text: 'Capacitor',
35+
link: 'https://capacitor.nativescript.org',
36+
},
37+
{
38+
text: 'Writing Guide',
39+
link: 'https://v3.vuejs.org/guide/contributing/writing-guide.html',
40+
},
41+
],
4442

45-
sidebar: {
46-
"/plugins/": getPluginsSidebar(),
43+
sidebar: {
44+
'/plugins/': getPluginsSidebar(),
4745

48-
// fallback
49-
"/": getSidebar(),
50-
},
51-
},
52-
};
46+
// fallback
47+
'/': getSidebar(),
48+
},
49+
},
50+
}
5351

5452
function getSidebar() {
55-
return [
56-
{
57-
text: 'Setup',
58-
children: [
59-
{ text: 'Introduction', link: '/introduction' },
60-
{ text: 'Environment Setup', link: '/environment-setup' },
61-
{ text: 'Development Workflow', link: '/development-workflow' }
62-
]
63-
},
64-
{
65-
text: 'UI & Styling',
66-
children: [
67-
{ text: 'UI & Styling', link: '/ui-and-styling' },
68-
{ text: 'Interaction', link: '/interaction' },
69-
]
70-
},
71-
{
72-
text: 'Networking & Security',
73-
children: [
74-
{ text: 'Networking', link: '/networking' },
75-
{ text: 'Security', link: '/security' },
76-
]
77-
},
78-
{
79-
text: 'Performance',
80-
children: [
81-
{ text: 'Performance', link: '/performance' },
82-
]
83-
},
84-
{
85-
text: 'Advanced Concepts',
86-
children: [
87-
{ text: 'Advanced Concepts', link: '/advanced-concepts' },
88-
]
89-
},
90-
{
91-
text: 'Distribution',
92-
children: [
93-
{ text: 'Releasing your app', link: '/releasing' },
94-
]
95-
},
96-
{
97-
text: 'Troubleshooting',
98-
children: [
99-
{ text: 'Common Pitfalls', link: '/common-pitfalls' }
100-
]
101-
},
102-
];
53+
return [
54+
{
55+
text: 'Setup',
56+
children: [
57+
{ text: 'Introduction', link: '/introduction' },
58+
{ text: 'Environment Setup', link: '/environment-setup' },
59+
{ text: 'Development Workflow', link: '/development-workflow' },
60+
],
61+
},
62+
{
63+
text: 'UI & Styling',
64+
children: [
65+
{ text: 'UI & Styling', link: '/ui-and-styling' },
66+
{ text: 'Interaction', link: '/interaction' },
67+
],
68+
},
69+
{
70+
text: 'Networking & Security',
71+
children: [
72+
{ text: 'Networking', link: '/networking' },
73+
{ text: 'Security', link: '/security' },
74+
],
75+
},
76+
{
77+
text: 'Performance',
78+
children: [{ text: 'Performance', link: '/performance' }],
79+
},
80+
{
81+
text: 'Advanced Concepts',
82+
children: [{ text: 'Advanced Concepts', link: '/advanced-concepts' }],
83+
},
84+
{
85+
text: 'Distribution',
86+
children: [{ text: 'Releasing your app', link: '/releasing' }],
87+
},
88+
{
89+
text: 'Troubleshooting',
90+
children: [{ text: 'Common Pitfalls', link: '/common-pitfalls' }],
91+
},
92+
]
10393
}
10494

10595
function getPluginsSidebar() {
106-
return [
107-
{
108-
text: 'Plugins',
109-
children: [
110-
{ text: 'Developing Plugins', link: '/developing-plugins' },
111-
{ text: '-----------', link: '#' },
112-
{ text: 'Background HTTP', link: '/plugins/background-http'},
113-
{ text: 'Brightness', link: '/plugins/brightness'},
114-
{ text: 'Camera', link: '/plugins/camera'},
115-
{ text: 'DateTimePicker', link: '/plugins/datetimepicker'}
116-
]
117-
}
118-
]
119-
}
96+
return [
97+
{
98+
text: 'Plugins',
99+
children: [
100+
{ text: 'Developing Plugins', link: '/developing-plugins' },
101+
{ text: '-----------', link: '#' },
102+
{ text: 'Background HTTP', link: '/plugins/background-http' },
103+
{ text: 'Brightness', link: '/plugins/brightness' },
104+
{ text: 'Camera', link: '/plugins/camera' },
105+
{ text: 'DateTimePicker', link: '/plugins/datetimepicker' },
106+
],
107+
},
108+
]
109+
}

.vitepress/theme/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import DefaultTheme from 'vitepress/dist/client/theme-default'
22

33
export default {
4-
...DefaultTheme,
4+
...DefaultTheme,
55
}

README.md

Lines changed: 64 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Writing Guide from the Vue team we can refer to and follow:
2-
https://v3.vuejs.org/guide/contributing/writing-guide.html
1+
Writing Guide from the Vue team we can refer to and follow: https://v3.vuejs.org/guide/contributing/writing-guide.html
32

43
```shell
54
git clone https://github.com/NativeScript/docs-new.git
@@ -9,68 +8,68 @@ npm start
98

109
The outline of the docs:
1110

12-
* [Introduction](/introduction.md)
13-
* How to use the docs
14-
* Prerequisites
15-
* Learn the basics
16-
* Templates
17-
* Versioning Scheme
18-
* [Environment Setup](/environment-setup.md)
19-
* Setting up your system
20-
* Integrating with native apps
21-
* Building for Other Platforms/Devices
22-
* Building for TV devices
23-
* Building for Smart Watches
24-
* Potentially desktop in the future?
25-
* [Development Workflow](/development-workflow.md)
26-
* Running on virtual device
27-
* Running on physical device
28-
* HMR
29-
* Debugging
30-
* Testing
31-
* Using packages
32-
* Updating
33-
* [UI & Styling](/ui-and-styling.md)
34-
* Layouts
35-
* Components
36-
* CSS
37-
* [Interaction](/interaction.md)
38-
* Gestures
39-
* Navigation
40-
* Animations
41-
* Accessibility
42-
* [Networking](/networking.md)
43-
* [Security](/security.md)
44-
* [Performance](/performance.md)
45-
* Profiling
46-
* Scroll Performance
47-
* Navigation Performance
48-
* [Advanced Concepts](/advanced-concepts.md)
49-
* Marshalling
50-
* Multithreading & Workers
51-
* Metadata filtering
52-
* [Releasing your app](/releasing.md)
53-
* [Developing Plugins](/developing-plugins.md)
54-
* [Common Pitfalls](/common-pitfalls.md)
55-
* Layout Nesting
56-
* Heavy work on main thread
11+
- [Introduction](/introduction.md)
12+
- How to use the docs
13+
- Prerequisites
14+
- Learn the basics
15+
- Templates
16+
- Versioning Scheme
17+
- [Environment Setup](/environment-setup.md)
18+
- Setting up your system
19+
- Integrating with native apps
20+
- Building for Other Platforms/Devices
21+
- Building for TV devices
22+
- Building for Smart Watches
23+
- Potentially desktop in the future?
24+
- [Development Workflow](/development-workflow.md)
25+
- Running on virtual device
26+
- Running on physical device
27+
- HMR
28+
- Debugging
29+
- Testing
30+
- Using packages
31+
- Updating
32+
- [UI & Styling](/ui-and-styling.md)
33+
- Layouts
34+
- Components
35+
- CSS
36+
- [Interaction](/interaction.md)
37+
- Gestures
38+
- Navigation
39+
- Animations
40+
- Accessibility
41+
- [Networking](/networking.md)
42+
- [Security](/security.md)
43+
- [Performance](/performance.md)
44+
- Profiling
45+
- Scroll Performance
46+
- Navigation Performance
47+
- [Advanced Concepts](/advanced-concepts.md)
48+
- Marshalling
49+
- Multithreading & Workers
50+
- Metadata filtering
51+
- [Releasing your app](/releasing.md)
52+
- [Developing Plugins](/developing-plugins.md)
53+
- [Common Pitfalls](/common-pitfalls.md)
5754

55+
- Layout Nesting
56+
- Heavy work on main thread
5857

59-
* Uncategorized
60-
* Code Sharing (ng):
61-
* https://github.com/NativeScript/docs/tree/master/docs/code-sharing
62-
* Flavor Choice:
63-
* [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/guides/architecture-choice.md
64-
* Cloud backends (Kinvey/Firebase)
65-
* [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/guides/wire-backend.md
66-
* Probably should live under a guides/cookbook type of page (blog post style)
67-
* Troubleshooting - Perhaps under Development Workflow?
68-
* [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/troubleshooting.md
69-
* Configuration
70-
* [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/tooling/changing-appid.md
71-
* [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/tooling/custom-webpack-configuration.md
72-
* ios stuff
73-
* [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/tooling/ios-app-extensions.md
74-
* CLI related
75-
* [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/tooling/package-managers.md
76-
* (obsolete?) [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/tooling/transpilers.md
58+
- Uncategorized
59+
- Code Sharing (ng):
60+
- https://github.com/NativeScript/docs/tree/master/docs/code-sharing
61+
- Flavor Choice:
62+
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/guides/architecture-choice.md
63+
- Cloud backends (Kinvey/Firebase)
64+
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/guides/wire-backend.md
65+
- Probably should live under a guides/cookbook type of page (blog post style)
66+
- Troubleshooting - Perhaps under Development Workflow?
67+
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/troubleshooting.md
68+
- Configuration
69+
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/tooling/changing-appid.md
70+
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/tooling/custom-webpack-configuration.md
71+
- ios stuff
72+
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/tooling/ios-app-extensions.md
73+
- CLI related
74+
- [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/tooling/package-managers.md
75+
- (obsolete?) [REFERENCE] https://github.com/NativeScript/docs/blob/master/docs/tooling/transpilers.md

0 commit comments

Comments
 (0)