Skip to content

Commit 381bc18

Browse files
committed
chore(lint): format files sync with .vscode and prettier
1 parent a99d40a commit 381bc18

File tree

102 files changed

+5084
-5155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+5084
-5155
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
docs/
22
example/
3+
example-expo/
34
build/
45
node_modules/
56
*.d.ts

.eslintrc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ module.exports = {
1818
paths: [
1919
{
2020
name: '.',
21-
message: "Avoid `import from '.'`; use './index' or an explicit path.",
21+
message:
22+
"Avoid `import from '.'`; use './index' or an explicit path.",
2223
},
2324
],
2425
},
@@ -29,8 +30,7 @@ module.exports = {
2930
paths: [
3031
{
3132
name: '.',
32-
message:
33-
"Avoid `require('.')`; use './index' or an explicit path.",
33+
message: "Avoid `require('.')`; use './index' or an explicit path.",
3434
},
3535
],
3636
},

.prettierrc.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
// prettier.config.js or .prettierrc.js
2+
// Single Prettier source of truth for CLI and VS Code
3+
// VS Code is configured to use this file via .vscode/settings.json (prettier.configPath)
24
module.exports = {
5+
// Style
6+
singleQuote: true,
7+
semi: true,
38
trailingComma: 'all',
49
arrowParens: 'always',
5-
singleQuote: true,
610
jsxSingleQuote: false,
711
bracketSpacing: false,
12+
tabWidth: 2,
13+
useTabs: false,
14+
// Markdown/docs
815
proseWrap: 'never',
916
};

AGENTS.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@
9292
Example:
9393

9494
```ts
95-
const { fetchProducts, products } = useIAP()
96-
await fetchProducts({ skus: ['p1'] })
95+
const {fetchProducts, products} = useIAP();
96+
await fetchProducts({skus: ['p1']});
9797
// then read products from state
9898
```
9999

@@ -145,11 +145,11 @@ Usage example:
145145
try {
146146
await requestPurchase({
147147
/* ... */
148-
})
148+
});
149149
} catch (e) {
150-
const err = parseErrorStringToJsonObj(e)
151-
if (isUserCancelledError(err)) return
152-
console.error('IAP failed:', err.code, err.message)
150+
const err = parseErrorStringToJsonObj(e);
151+
if (isUserCancelledError(err)) return;
152+
console.error('IAP failed:', err.code, err.message);
153153
}
154154
```
155155

@@ -201,20 +201,20 @@ try {
201201

202202
```ts
203203
// src/specs/RnIap.nitro.ts
204-
export type Purchase = { id: string; productId: string; date: Date }
204+
export type Purchase = {id: string; productId: string; date: Date};
205205
export type Result<T> =
206-
| { kind: 'ok'; value: T }
207-
| { kind: 'err'; code: string; message: string }
206+
| {kind: 'ok'; value: T}
207+
| {kind: 'err'; code: string; message: string};
208208

209209
export interface RnIapSpec {
210-
init(): Promise<void>
211-
fetchProducts(ids: string[]): Promise<Product[]>
210+
init(): Promise<void>;
211+
fetchProducts(ids: string[]): Promise<Product[]>;
212212
requestPurchase(
213213
id: string,
214-
opts?: { quantity?: number }
215-
): Promise<Result<Purchase>>
216-
addPurchaseListener(cb: (p: Purchase) => void): void
217-
getStorefrontIOS?(): string
214+
opts?: {quantity?: number},
215+
): Promise<Result<Purchase>>;
216+
addPurchaseListener(cb: (p: Purchase) => void): void;
217+
getStorefrontIOS?(): string;
218218
}
219219
```
220220

app.plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('./plugin/build/withIAP.js');
1+
module.exports = require('./plugin/build/withIAP.js');

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
22
presets: ['module:@react-native/babel-preset'],
3-
}
3+
};

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = { extends: ['@commitlint/config-conventional'] };
1+
module.exports = {extends: ['@commitlint/config-conventional']};

0 commit comments

Comments
 (0)