Граф коммитов

13 Коммитов

Автор SHA1 Сообщение Дата
Tim Yung 494c47360f RN: Sort Imports via ESLint
Summary:
Applies the autofix from the newly introduced `lint/sort-imports` ESLint rule.

Changelog:
[Internal]

Reviewed By: cortinico, skinsshark

Differential Revision: D39907798

fbshipit-source-id: 17f5f11b08a5b4bb66286816b78eb26e07e829b8
2022-09-30 14:28:48 -07:00
Tim Yung 7c08d07115 RN: Change Internal Imports to Relative Paths
Summary:
Fixes all internal import statements directly referencing the `react-native` package to instead use relative paths.

Changelog:
[Internal]

Reviewed By: christophpurrer

Differential Revision: D39831223

fbshipit-source-id: 510123e5fc8f6845f96d1b55c67e0e59cb401beb
2022-09-27 09:22:58 -07:00
Pieter Vanderwerff 66c6a75650 Suppress missing annotations in xplat/js
Summary: Add annotations to function parameters required for Flow's Local Type Inference project. This codemod prepares the codebase to match Flow's new typechecking algorithm. The new algorithm will make Flow more reliable and predictable.

Reviewed By: bradzacher

Differential Revision: D37388949

fbshipit-source-id: cdcbc98035ce9b6994842005ea46df42de54f9b8
2022-06-23 16:54:29 -07:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Tim Yung 148c98ec80 RN: Resolve Outstanding ESLint Warnings
Summary:
Resolves outstanding ESLint warnings in React Native.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D32291912

fbshipit-source-id: 61337d5a5a0e6ed55f732675e029f4b76d850af9
2021-11-09 21:46:21 -08:00
Michael Bolin 0b9ea60b4f Back out "Upgrade Prettier from 1.17 to 2.0.2."
Differential Revision: D20639755

fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd
2020-03-24 21:47:35 -07:00
Michael Bolin cf44650b3f Upgrade Prettier from 1.17 to 2.0.2.
Summary:
This gets us on the latest Prettier 2.x:
https://prettier.io/blog/2020/03/21/2.0.0.html

Notably, this adds support for TypeScript 3.8,
which introduces new syntax, such as `import type`.

Reviewed By: zertosh

Differential Revision: D20636268

fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a
2020-03-24 20:24:47 -07:00
Rick Hanlon 64bc400c77 LogBox - Fix code frame whitespace trimming
Summary:
This diff fixes whitespace trimming in codeframes by setting the whitespace size to 0 instead of infinity for lines that's don't have whitespace. This fixes a bug in frames where lines with 0 whitespace would not be considered.

So frames like this, where the common whitespace should be 0:

```
  217 | function Hi(a?: String) {
> 218 |   return Platform.OS === 'android' ? obj.die() : obj.die();
      |                                                  ^
  219 | }
  220 |
  221 | export default CrashReactApp;
```

Are instead trimmed at the second most common whitespace, which is 2. That's because line 217 has a whitespace length of 0, but we consider it as Infinity. When we get to line 218, we set the whitespace to 2. Then on line 19 we consider if 2 < Infinity and decide that the common whitespace is 2 resulting in:

```
  217 | nction Hi(a?: String) {
> 218 | return Platform.OS === 'android' ? obj.die() : obj.die();
      |                                                ^
  219 |
  220 |
  221 | port default CrashReactApp;
```

By setting the whitespace per line to 0 when there's no whitespace match, lines without whitespace can accurately report their size and move the pointer back to the 0 position.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D20030301

fbshipit-source-id: f1dec8cc57479f37ffa8128f93f7c8b3c6baaf91
2020-02-21 10:23:31 -08:00
Eli White c24c8a039c Core files should depend on internals directly
Summary:
By depending on react-native, these files can't be flow strict until index.js is flow strict. By depending on the internals directly they can be flow strict as soon as their dependents are flow strict.

Changelog:
[Internal] Refactoring some core file imports to depend on internals directly

Reviewed By: zackargyle

Differential Revision: D18828324

fbshipit-source-id: 2a347c4e234a64edbb3e6f0ef6387ef1ce78badc
2019-12-05 13:33:58 -08:00
Jordan Brown 90ab8b89e8 Last pass over non-generated files for explicit inexact object rollout
Summary:
The flow team is rolling out exact-by-default object types to xplat/js. In order to do that, we need to take all inexact objects `{}` and turn them into explicitly inexact objects `{...}`.

This codemod does not change any type checking behavior. Prettier was run on all of the modified files with `format`.

drop-conflicts

Changelog: [Internal]

Reviewed By: zackargyle

Differential Revision: D18785076

fbshipit-source-id: c89c7fcc9eabe69859c8a488e03185fba5d06f80
2019-12-04 21:41:16 -08:00
Christoph Nakazawa 03766d6a08 Remove unnecessary whitespace from code frames
Summary:
This removes common whitespace from a code frame to show more code. This is especially useful for heavily intended code that may not even be visible in the small window.

I am not 100% confident I wrote the right code because I'm under time pressure but it seems to work. I'm an intern and it's my last day.

Changelog: [Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: rickhanlonii

Differential Revision: D18657572

fbshipit-source-id: 6b93999c4482891f2123d67005843ce5db0d2976
2019-11-22 09:09:10 -08:00
Christoph Nakazawa 89be2d00ea Remove the vertical bar next to the code frame
Summary:
This vertical bar doesn't really add any value. This diff removes it. At first I tried to use regex but ansi codes make that hard. We can just use the structured data and rely on the fact that the second item is always the one with the vertical bar.

(Note: this ignores all push blocking failures!)

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18656911

fbshipit-source-id: b72d4c93d0008c7da54647d072a4c4eb7646b694
2019-11-22 09:09:09 -08:00
Christoph Nakazawa 16e72ad370 Syntax highlighting for LogBox Code Frames
Summary:
This diff adds syntax highlighting to LogBox CodeFrames. It works by turning Ansi codes into "JSON" (it's actually just a JS object but the third-party API uses JSON as terminology) and then turning that into `<Text>` elements.

The syntax theme is called Afterglow and I took it from https://iterm2colorschemes.com/. Happy for anyone who wants to further tweak it! I installed this into iTerm and extracted the colors from there as it has a color picker and the labels directly map to the color classes exposed by the `anser` package.

Changelog: [Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: rickhanlonii

Differential Revision: D18618897

fbshipit-source-id: 64815619fc482e08b5671f492dabda8c8c0ceca5
2019-11-22 09:09:09 -08:00