Skip to content

Commit 1c2df80

Browse files
committed
fix: linting
1 parent 688791a commit 1c2df80

12 files changed

Lines changed: 205 additions & 198 deletions

File tree

content/configuration/nativescript.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ See [Hooks Configuration Reference](#hooks-configuration-reference)
175175

176176
NativeScript supports dynamic `import()` from remote URLs. This is useful during development but carries security implications in production since NativeScript code has **direct access to native platform APIs** (file system, keychain, network, camera, etc.).
177177

178-
| Mode | Remote Modules |
179-
|------|----------------|
180-
| **Debug** | ✅ Always allowed |
178+
| Mode | Remote Modules |
179+
| -------------- | --------------------- |
180+
| **Debug** | ✅ Always allowed |
181181
| **Production** | ❌ Blocked by default |
182182

183183
#### Enabling Remote Modules in Production
@@ -190,10 +190,10 @@ import { NativeScriptConfig } from '@nativescript/core'
190190
export default {
191191
id: 'org.nativescript.myapp',
192192
appPath: 'src',
193-
193+
194194
security: {
195-
allowRemoteModules: true
196-
}
195+
allowRemoteModules: true,
196+
},
197197
} as NativeScriptConfig
198198
```
199199

@@ -208,9 +208,9 @@ export default {
208208
allowRemoteModules: true,
209209
remoteModuleAllowlist: [
210210
'https://cdn.yourcompany.com/modules/',
211-
'https://esm.sh/@yourorg/'
212-
]
213-
}
211+
'https://esm.sh/@yourorg/',
212+
],
213+
},
214214
} as NativeScriptConfig
215215
```
216216

@@ -553,9 +553,9 @@ security.allowRemoteModules: boolean = false;
553553

554554
Enable remote ES module loading in production builds.
555555

556-
| Mode | Remote Modules |
557-
|------|----------------|
558-
| **Debug** (local development) | ✅ Always allowed |
556+
| Mode | Remote Modules |
557+
| ------------------------------- | --------------------- |
558+
| **Debug** (local development) | ✅ Always allowed |
559559
| **Production** (Release builds) | ❌ Blocked by default |
560560

561561
When `false` (the default), any attempt to `import("https://...")` in production will throw an error. This is a security measure because NativeScript code has **direct access to native platform APIs** (file system, keychain, network, camera, etc.).
@@ -564,8 +564,8 @@ When `false` (the default), any attempt to `import("https://...")` in production
564564
export default {
565565
// ...
566566
security: {
567-
allowRemoteModules: true
568-
}
567+
allowRemoteModules: true,
568+
},
569569
} as NativeScriptConfig
570570
```
571571

@@ -590,19 +590,19 @@ export default {
590590
allowRemoteModules: true,
591591
remoteModuleAllowlist: [
592592
'https://cdn.yourcompany.com/modules/',
593-
'https://esm.sh/@yourorg/'
594-
]
595-
}
593+
'https://esm.sh/@yourorg/',
594+
],
595+
},
596596
} as NativeScriptConfig
597597
```
598598

599599
#### Allowlist Examples
600600

601-
| Allowlist Entry | Allowed URLs | Blocked URLs |
602-
|-----------------|--------------|--------------|
603-
| `https://cdn.example.com/` | `https://cdn.example.com/mod.js` | `https://other.com/mod.js` |
604-
| `https://esm.sh/@myorg/` | `https://esm.sh/@myorg/pkg` | `https://esm.sh/@other/pkg` |
605-
| `https://unpkg.com/` | `https://unpkg.com/lodash` | `http://unpkg.com/lodash` (http blocked) |
601+
| Allowlist Entry | Allowed URLs | Blocked URLs |
602+
| -------------------------- | -------------------------------- | ---------------------------------------- |
603+
| `https://cdn.example.com/` | `https://cdn.example.com/mod.js` | `https://other.com/mod.js` |
604+
| `https://esm.sh/@myorg/` | `https://esm.sh/@myorg/pkg` | `https://esm.sh/@other/pkg` |
605+
| `https://unpkg.com/` | `https://unpkg.com/lodash` | `http://unpkg.com/lodash` (http blocked) |
606606

607607
If the allowlist is empty or not provided (and `allowRemoteModules` is `true`), all HTTPS URLs are allowed — this is **not recommended** for production.
608608

@@ -612,7 +612,7 @@ When remote module loading is blocked, you'll see clear error messages:
612612

613613
```
614614
// Remote modules disabled
615-
Remote ES modules are not allowed in production. URL: https://example.com/mod.js.
615+
Remote ES modules are not allowed in production. URL: https://example.com/mod.js.
616616
Enable via security.allowRemoteModules in nativescript.config.ts
617617
618618
// URL not in allowlist

content/configuration/vite.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ This page contains examples of common things you might want to change in the [Ex
154154
Type checking diagnostics come from the project's `tsconfig.json`. By default, the build follows `compilerOptions.noEmitOnError` to decide whether type errors should fail the build. If you want to override that behavior for Vite, pass a `typeCheck` option to the framework helper:
155155

156156
```ts
157-
import { defineConfig } from 'vite';
158-
import { vueConfig } from '@nativescript/vite/vue';
157+
import { defineConfig } from 'vite'
158+
import { vueConfig } from '@nativescript/vite/vue'
159159

160160
export default defineConfig(({ mode }) =>
161-
vueConfig({ mode }, { typeCheck: 'warn' })
162-
);
161+
vueConfig({ mode }, { typeCheck: 'warn' }),
162+
)
163163
```
164164

165165
Supported values are `typeCheck: 'error' | 'warn' | 'off'`.

content/core/utils.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ const labelHierarchy: Array<string> = Utils.getBaseClasses(new Label())
8787
] */
8888
```
8989

90-
9190
To hide a soft keyboard on the screen, use the [dismissKeyboard()](#dismisskeyboard) method.
9291

9392
```ts
@@ -98,7 +97,7 @@ Utils.dismissKeyboard()
9897

9998
### MajorVersion
10099

101-
```ts
100+
````ts
102101
const majorVersion: number = Utils.ios
103102

104103
(`iOS only`) Gets the iOS device major version. For example, for `16.0` ,it returns `16`.
@@ -109,11 +108,10 @@ const majorVersion: number = Utils.ios
109108

110109
```ts
111110
const isFileOrResourcePath: boolean = Utils.isFileOrResourcePath(path)
112-
```
111+
````
113112
114113
Returns `true` if the specified path points to a resource or local file.
115114
116-
117115
### isDataURI()
118116
119117
```ts
@@ -138,8 +136,7 @@ Opens the passed url using the default application.
138136
const escapedString: string = Utils.escapeRegexSymbols(string)
139137
```
140138

141-
Escapes special regex characters (`.`, `*`, `^`, `$` and so on) in a string and returns a valid regex.
142-
---
139+
## Escapes special regex characters (`.`, `*`, `^`, `$` and so on) in a string and returns a valid regex.
143140

144141
### convertString()
145142

@@ -167,21 +164,20 @@ A utility function that invokes garbage collection on the JavaScript side.
167164
Utils.queueMacrotask(task: () => void)
168165
```
169166

170-
171167
### queueGC()
172168

173169
```ts
170+
174171
```
175172

176173
- _Optional_: `delay` time, in milliseconds, to wait before garbage collection starts.
177174
- _Optional_: `useThrottle` If set to `true` throttling is used instead of default debounce strategy.
178175

179176
A utility function that queues a garbage collection. Multiple calls in quick succession are debounced by default and only one gc will be executed after 900ms.
180177

181-
182178
### debounce()
183179

184-
```ts
180+
````ts
185181
const debouncedFn = Utils.debounce(fn, delay)
186182

187183
debouncedFn()
@@ -198,19 +194,21 @@ A simple debounce utility.
198194
const throttledFn = Utils.throttle(fn, delay)
199195
200196
throttledFn()
201-
```
197+
````
202198
203199
A simple throttle utility.
204200
205201
- `fn` The function to throttle.
206202
- _Optional_:`delay` delays the throttling, in milliseconds. Defaults to 300ms.
203+
207204
---
208205
209206
### isFontIconURI()
210207
211208
```ts
212209
const isFontIconURI: boolean = Utils.isFontIconURI('font://&#xf51e;')
213210
```
211+
214212
Returns true if the specified URI is a font icon URI.
215213

216214
---
@@ -222,7 +220,6 @@ Utils.executeOnMainThread(fn: Function)
222220
223221
```
224222

225-
226223
:::warning Important!
227224

228225
This will be made synchronously when invoked from the main thread, or asynchronously if it's not.
@@ -594,6 +591,7 @@ Enables full edge-to-edge rendering on Android and lets you customize system UI
594591
- `handleDarkMode` Decide whether light or dark system UI should be used for the given bar based on your own logic. Return `true` to use light appearance, `false` for dark.
595592

596593
Notes:
594+
597595
- Works together with Page `androidOverflowEdge` and `androidOverflowInset` to control inset application/consumption.
598596
- When insets are applied, they are added to the view's padding.
599597

@@ -751,7 +749,7 @@ const resId: number = Utils.android.resources.getResource(name, type?)
751749
```
752750

753751
Gets a resource identifier by name with an optional type. This sets an explicit package name under the hood.
754-
See Android's [`Resources.getIdentifier`](https://developer.android.com/reference/android/content/res/Resources#getIdentifier(java.lang.String,%20java.lang.String,%20java.lang.String)).
752+
See Android's [`Resources.getIdentifier`](<https://developer.android.com/reference/android/content/res/Resources#getIdentifier(java.lang.String,%20java.lang.String,%20java.lang.String)>).
755753

756754
---
757755

@@ -772,7 +770,7 @@ Gets a color from the current theme.
772770
const window: android.view.Window = Utils.android.getWindow()
773771
```
774772

775-
*Deprecated*. Use the generic `Utils.getWindow<android.view.Window>()` instead.
773+
_Deprecated_. Use the generic `Utils.getWindow<android.view.Window>()` instead.
776774

777775
---
778776

@@ -962,7 +960,7 @@ const window: UIWindow = Utils.ios.getWindow()
962960

963961
Gets the UIWindow of the app.
964962

965-
*Deprecated*. Use the generic `Utils.getWindow<UIWindow>()` instead.
963+
_Deprecated_. Use the generic `Utils.getWindow<UIWindow>()` instead.
966964

967965
---
968966

content/guide/agentic-coding.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ curl -o CLAUDE.md https://docs.nativescript.org/assets/agentic/NATIVESCRIPT.md
6262
This is a NativeScript Vue 3 application for managing recipes.
6363

6464
## Project-Specific Patterns
65+
6566
- We use Pinia for state management
6667
- API calls go through `src/services/api.ts`
6768
- All components are in `src/components/`
6869

6970
---
7071

7172
# NativeScript AI Agent Context
73+
7274
... (rest of NATIVESCRIPT.md content)
7375
```
7476

@@ -86,12 +88,12 @@ Claude will automatically read the `CLAUDE.md` file and use it to inform all cod
8688
With the context file in place, you can give high-level instructions:
8789

8890
```
89-
Create a settings page with switches for notifications, dark mode, and location tracking.
91+
Create a settings page with switches for notifications, dark mode, and location tracking.
9092
Save preferences using ApplicationSettings.
9193
```
9294

9395
```
94-
Build a ListView that shows products with images, names, and prices.
96+
Build a ListView that shows products with images, names, and prices.
9597
Use template selectors for featured vs regular items.
9698
```
9799

@@ -201,16 +203,19 @@ For team projects, consider extending the base context file with project-specifi
201203
# Project: Recipe Manager App
202204

203205
## Architecture
206+
204207
- Feature-based folder structure (`src/features/recipes/`, `src/features/auth/`)
205208
- Shared components in `src/shared/components/`
206209
- All API calls through `src/core/api/client.ts`
207210

208211
## Conventions
212+
209213
- Use `const` for all variables unless reassignment is needed
210214
- Prefer composition over inheritance
211215
- All async operations use async/await (no raw promises)
212216

213217
## State Management
218+
214219
- Pinia stores in `src/stores/`
215220
- Each feature has its own store
216221

0 commit comments

Comments
 (0)