| #
8a424beb |
| 11-Aug-2023 |
James Ide <[email protected]> |
[lint] Upgrade to Prettier v3, typescript-eslint to v6 (#23544)
Why
---
Prettier 3 is out. Add support for it with this linter config.
**Note for reviewer:** the first commit is the one with th
[lint] Upgrade to Prettier v3, typescript-eslint to v6 (#23544)
Why
---
Prettier 3 is out. Add support for it with this linter config.
**Note for reviewer:** the first commit is the one with the actual
changes. The rest of this PR are changes to get the linter passing
(mostly autofix).
How
---
Update eslint-config-prettier and eslint-plugin-prettier. To address
deprecation warnings, also update typescript-eslint/parser and
typescript-eslint/eslint-plugin.
Because of an update to typescript-eslint/parser, we need to suppress
deprecation warnings (documented in a comment).
Regenerated test snapshots. Due to the upgraded dependencies, typecasts
and optional chaining are now auto-fixable by lint. This converts
warnings into autofixes.
Test Plan
---
`yarn test` in the linter config. Run `expotools check --all --fix-lint
--no-build --no-test --no-uniformity-check` to try this config on the
whole repo.
---------
Co-authored-by: Expo Bot <[email protected]>
show more ...
|
| #
1117330a |
| 07-Apr-2023 |
Mark Lawlor <[email protected]> |
feat: typed route generation for expo router (#21651)
> Draft PR - just seeking feedback on the implementation.
# Why
WIP implementation of route generation for Expo Router.
# How
## Typ
feat: typed route generation for expo router (#21651)
> Draft PR - just seeking feedback on the implementation.
# Why
WIP implementation of route generation for Expo Router.
# How
## Typescript bootstrapping
This is expands the Typescript bootstrapping to also accommodate for
long-lived typescript watchers.
- Changes `waitForMetroToObserveTypeScriptFile` to
`metroWatchTypeScriptFiles`
- Processes are now responsible to disabling their watcher
- tsconfig can optionally be watched
## Type generation
`typedRouteGenerator` is invokes after the CLI has bootstrapped
TypeScript.
- Generates types only for absolute paths
- Supports static and dynamic routes
- Supports URL normalisation (TODO: Need unit tests for these!)
- Supports dynamic route parameter typing
# Test Plan
`EXPO_ROUTER_TYPED_ROUTES=true nexpo start`
// Todo
# Checklist
- [x] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [x] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [x] This diff will work correctly for `expo prebuild` & EAS Build (eg:
updated a module plugin).
---------
Co-authored-by: Evan Bacon <[email protected]>
show more ...
|
| #
d8009c4b |
| 24-Feb-2023 |
Evan Bacon <[email protected]> |
feat(cli): add support for path aliases and absolute imports (#21262)
# Why
- In Expo Router, you have to import outside of the `app` directory
which does not spark joy at scale (e.g. `../../../
feat(cli): add support for path aliases and absolute imports (#21262)
# Why
- In Expo Router, you have to import outside of the `app` directory
which does not spark joy at scale (e.g. `../../../../../../`).
- This is pretty standard functionality in web development, feels odd
not having it in our "Metro for web" system.
<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->
# How
- Add support for `compilerOptions.baseUrl` from `tsconfig.json` and
`jsconfig.json` files to Metro. This enables absolute imports.
- Add support for `compilerOptions.paths` aliases from `tsconfig.json`
and `jsconfig.json` files to Metro. This enables path aliases. Tried to
keep the implementation as close to TypeScript as possible to reduce
maintenance.
- Absolute imports utilize built-in Metro behavior making it more
reliable. We basically just register the baseUrl as a location to search
for node modules.
- Couldn't decide where to document the feature so I put it in multiple
places.
- We might need to update expo jest to have similar functionality in the
future (it might already support these fields, didn't check).
<!--
How did you build this feature or fix this bug and why?
-->
# Test Plan
- Added some unit tests for path aliases (non-exhaustive).
- For correctness, you can use this feature in vscode and all
autocomplete suggestions should work as the bundling now matches the
built-in resolution.
<!--
Please describe how you tested this change and how a reviewer could
reproduce your test, especially if this PR does not include automated
tests! If possible, please also provide terminal output and/or
screenshots demonstrating your test/reproduction.
-->
# Checklist
<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->
- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg:
updated a module plugin).
---------
Co-authored-by: Expo Bot <[email protected]>
show more ...
|