Skip to content

Commit e3d36f3

Browse files
authored
feat: migrate from Flow to TypeScript (#727)
- Migrated all Flow files to TypeScript - Disabled `dot-notation` ESLint rule conflicting with TypeScript - Use more default Prettier settings - Moved ESLint and Prettier config into `package.json`
1 parent 49cdfa4 commit e3d36f3

40 files changed

+1204
-1172
lines changed

.circleci/config.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ default config for macOS: &macos_defaults
2626
macos:
2727
xcode: '12.5.1'
2828

29-
3029
config for macOS (android): &macos_defaults_android
3130
<<: *defaults
3231
resource_class: 'medium'
@@ -143,13 +142,13 @@ jobs:
143142
name: Lint check
144143
command: yarn test:lint
145144

146-
"Test: flow":
145+
"Test: TypeScript":
147146
<<: *js_defaults
148147
steps:
149148
- *addWorkspace
150149
- run:
151-
name: Flow check
152-
command: yarn test:flow
150+
name: TypeScript check
151+
command: yarn test:ts
153152

154153
"Test: Android unit":
155154
<<: *android_defaults
@@ -322,7 +321,7 @@ workflows:
322321
- "Test: lint":
323322
requires:
324323
- "Setup environment"
325-
- "Test: flow":
324+
- "Test: TypeScript":
326325
requires:
327326
- "Setup environment"
328327
- "Test: Android unit":
@@ -331,11 +330,11 @@ workflows:
331330
- "Test: iOS e2e":
332331
requires:
333332
- "Test: lint"
334-
- "Test: flow"
333+
- "Test: TypeScript"
335334
- "Build: Android release apk":
336335
requires:
337336
- "Test: lint"
338-
- "Test: flow"
337+
- "Test: TypeScript"
339338
- "Test: Android unit"
340339
- "Test: Android e2e":
341340
requires:

.eslintrc

-17
This file was deleted.

.flowconfig

-75
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ body:
2121
attributes:
2222
label: Version
2323
description: What version of `@react-native-async-storage/async-storage` are you using?
24-
placeholder: "Example: 1.15.9"
24+
placeholder: 'Example: 1.15.9'
2525
validations:
2626
required: true
2727
- type: checkboxes
2828
id: platforms
2929
attributes:
3030
label: What platforms are you seeing this issue on?
31-
description: "Select all that apply:"
31+
description: 'Select all that apply:'
3232
options:
3333
- label: Android
3434
- label: iOS

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
jobs:
88
macos:
9-
name: "macOS"
9+
name: 'macOS'
1010
runs-on: macos-latest
1111
steps:
1212
- name: Set up Node.js
@@ -34,7 +34,7 @@ jobs:
3434
run: |
3535
yarn test:e2e:macos
3636
windows:
37-
name: "Windows"
37+
name: 'Windows'
3838
runs-on: windows-latest
3939
steps:
4040
- name: Set up MSBuild

.github/workflows/stale.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: Mark stale issues and pull requests
22
on:
33
schedule:
4-
- cron: "30 1 * * *"
4+
- cron: '30 1 * * *'
55
jobs:
66
stale:
77
runs-on: ubuntu-latest
88
permissions:
99
issues: write
1010
pull-requests: write
1111
steps:
12-
- uses: actions/stale@v4
13-
with:
14-
repo-token: ${{ secrets.GITHUB_TOKEN }}
15-
stale-issue-message: 'This issue has been marked as stale due to inactivity. Please respond or otherwise resolve the issue within 7 days or it will be closed.'
16-
stale-pr-message: 'This PR has been marked as stale due to inactivity. Please address any comments within 7 days or it will be closed.'
17-
exempt-issue-labels: 'help wanted :octocat:'
18-
exempt-pr-labels: 'WIP'
12+
- uses: actions/stale@v4
13+
with:
14+
repo-token: ${{ secrets.GITHUB_TOKEN }}
15+
stale-issue-message: 'This issue has been marked as stale due to inactivity. Please respond or otherwise resolve the issue within 7 days or it will be closed.'
16+
stale-pr-message: 'This PR has been marked as stale due to inactivity. Please address any comments within 7 days or it will be closed.'
17+
exempt-issue-labels: 'help wanted :octocat:'
18+
exempt-pr-labels: 'WIP'

.github/workflows/website-deployment.yml

+19-22
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,30 @@ name: Website Deployment
22
on:
33
push:
44
branches:
5-
- master
5+
- master
66
paths:
7-
- 'website/**'
7+
- 'website/**'
88

99
jobs:
1010
deploy:
1111
name: Deploy website
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
16-
- name: Cache/restore dependencies
17-
uses: actions/cache@v1
18-
id: cache
19-
with:
20-
path: ./website/node_modules
21-
key: website-${{ hashFiles('website/yarn.lock') }}
22-
- name: Install dependencies
23-
if: steps.cache.outputs.cache-hit != 'true'
24-
run: yarn install --frozen-lockfile --cwd ./website
25-
- name: Release
26-
working-directory: ./website
27-
run: |
28-
git config --global user.name ${{ secrets.GH_DEPLOY_NAME }}
29-
git config --global user.email ${{ secrets.GH_DEPLOY_EMAIL }}
30-
echo "machine github.com login ${{ secrets.GH_DEPLOY_NAME }} password ${{ secrets.GH_DEPLOY_TOKEN }}" > ~/.netrc
31-
GIT_USER=${{ secrets.GH_DEPLOY_NAME }} yarn run deploy
32-
33-
34-
15+
- uses: actions/checkout@v2
16+
- name: Cache/restore dependencies
17+
uses: actions/cache@v1
18+
id: cache
19+
with:
20+
path: ./website/node_modules
21+
key: website-${{ hashFiles('website/yarn.lock') }}
22+
- name: Install dependencies
23+
if: steps.cache.outputs.cache-hit != 'true'
24+
run: yarn install --frozen-lockfile --cwd ./website
25+
- name: Release
26+
working-directory: ./website
27+
run: |
28+
git config --global user.name ${{ secrets.GH_DEPLOY_NAME }}
29+
git config --global user.email ${{ secrets.GH_DEPLOY_EMAIL }}
30+
echo "machine github.com login ${{ secrets.GH_DEPLOY_NAME }} password ${{ secrets.GH_DEPLOY_TOKEN }}" > ~/.netrc
31+
GIT_USER=${{ secrets.GH_DEPLOY_NAME }} yarn run deploy

.npmignore

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ README.md
1010
babel.config.js
1111
.clang-format
1212
.eslintrc
13-
.flowconfig
1413
.watchmanconfig
1514
.npmrc
1615
.circleci

.prettierrc

-8
This file was deleted.

.releaserc

-19
This file was deleted.

0 commit comments

Comments
 (0)