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

23 Коммитов

Автор SHA1 Сообщение Дата
Blake Friedman eba1828a83 directly call community-cli-plugin in react-native-xcode.sh (#44721)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44721

For iOS builds of `react-native`, the [react-native-xcode.sh](https://www.internalfb.com/code/fbsource/[7ad79aae3e8bf565d53f087ac7f7b7622b19acec]/xplat/js/react-native-github/packages/react-native/scripts/react-native-xcode.sh) script is executed as one of the build phases.  This phase bundles the JS application (dev or production).

I've updated this to use the new `bundle.js` script instead of calling the `react-native/cli.js`.  This is identical except with how the config is captured:

{F1669960016}

This is similar to our approach with the Gradle plugin, giving Framework authors more control.

**Other:** formatting changes for the Privacy Manifest that Xcode keeps updating.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57915368

fbshipit-source-id: f52ea4b3cb94212ac97a3d7edeb68747418fe0a9
2024-06-05 09:08:16 -07:00
Eric Rozell bac714d877 Add desktop out-of-tree platform files to .eslintignore (#42267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42267

In case anyone was to try linting the react-native repo with desktop out-of-tree platform files there, this makes things easier.

## Changelog
[Internal]

Reviewed By: christophpurrer

Differential Revision: D52746379

fbshipit-source-id: d59a1c1f9c84c6bee529d6bdd151a7ba680b6680
2024-01-15 14:49:22 -08:00
Oskar Kwaśniewski 1e0fc76325 fix: add build generated files to *ignore config (#41826)
Summary:
This PR adds build generated files to *ignore config files. This allows to locally run `yarn lint`

## Changelog:

[INTERNAL] [ADDED] - Add build generated files to local config files

Pull Request resolved: https://github.com/facebook/react-native/pull/41826

Test Plan: CI Green

Reviewed By: huntie

Differential Revision: D51939024

Pulled By: cortinico

fbshipit-source-id: cfd6c1c13dd23c692859cd06fa5955024fafc522
2023-12-08 10:17:31 -08:00
Moti Zilberman b27607f853 Add debugger-frontend package and manual build script (#39161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39161

Changelog: [Internal]

Creates a new stub package named `react-native/debugger-frontend`, which will contain a minimal build of the Chrome DevTools frontend adapted for React Native. Initially, the compiled frontend assets will be checked into the React Native repo, but we intend to replace this with a fully automated build in CI at a later date.

Reviewed By: huntie

Differential Revision: D48680624

fbshipit-source-id: a24c8b019881187963d0be88e773bc0a97a2437d
2023-08-31 08:34:33 -07:00
Ruslan Lesiutin 714b502b0c | RN Monorepo | Migrate to package (#36434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36434

Changelog: [Internal]

This is a squashed stack of 18 commits, starting from D43202126

allow-large-files

Reviewed By: cortinico

Differential Revision: D43977381

fbshipit-source-id: 0da552ddb85f2f61a0be0ef071915b35f3f8555c
2023-03-17 05:03:25 -07:00
Tim Yung 4363626701 RN: Enforce `flow-typed` Signatures
Summary:
Creates a new `valid-flow-typed-signature` ESLint rule that validates the `flow-typed` signatures at the top of each file.

This lint rule will discourage contributors from locally forking the `flow-typed` definitions. Instead, any changes should be submitted as patches to the upstream definition in: https://github.com/flow-typed/flow-typed

Changelog:
[Internal]

Reviewed By: rickhanlonii

Differential Revision: D39868721

fbshipit-source-id: e5e3ffe7568dbe52c9b598b53110b0fcbcad3e38
2022-09-30 14:28:48 -07:00
Tim Yung 868be00d8c RN: Create Portable `sort-imports` ESLint Rule
Summary:
Introduces a portable bundle that implements the `sort-imports` ESLint rule that we use internally at Meta, to the React Native repository.

As a consequence of the rapid changes that occur to this rule internally (and the desire to minimize red tape for Meta engineers), the portable bundle is built with Rollup with a lot of context omitted.

Changelog:
[Internal]

Reviewed By: skinsshark

Differential Revision: D39907799

fbshipit-source-id: 58fb6dc08030f20ac02c0e3fd1b175e22e4d74c0
2022-09-30 14:28:48 -07:00
Luna Wei dc56eb99f1 Fix missing renames from bots to react-native-bots (#34713)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34713

Changelog: [Internal] - Fix up missing bots usage after we moved everything to packages/react-native-bots in 767f8e0249

Reviewed By: NickGerleman

Differential Revision: D39583230

fbshipit-source-id: 6cc6b7923e67139dc3c81dfe0c39005dde905248
2022-09-16 12:41:06 -07:00
Tim Yung b8425c8ee5 RN: Cleanup Existing ESLint Warnings
Summary:
Sometime over the past few months (and with changes such as migrating to the `hermes-eslint` parser), a bunch of lint warnings crept into the codebase.

This does a pass to clean them all up, ignore generated files, and refactor some code to be... better.

There should be no observable behavior changes as a result of this.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D38646643

fbshipit-source-id: a7b55d1e4cd5700340cc5c21f928baf3ea1d5a58
2022-08-12 17:16:40 -07:00
simek 6c21f15d71 Lint: fix few "no-unused-var" warnings for imports (#30157)
Summary:
This small PR fixes few "no-unused-var" issues and  and removes two old entries for no longer existing files from the `.eslintignore`.

## Changelog

[Internal] [Fixed] - Lint: fix few "no-unused-var" warnings for imports

Pull Request resolved: https://github.com/facebook/react-native/pull/30157

Test Plan: Successfully run of `yarn lint` script. Warnings count has been reduced from `61` to `58`.

Reviewed By: yungsters

Differential Revision: D24288226

Pulled By: appden

fbshipit-source-id: 06e4ef015a331e3f2eac3b9aa6f757a3764e3ed9
2020-10-26 17:19:14 -07:00
Christoph Nakazawa 4d4992c790 Upgrade to Jest 26.5.2.
Summary: Changelog: [Internal]

Reviewed By: kacieb

Differential Revision: D24154865

fbshipit-source-id: 04d637a3944b6f030fee342c4e8a181eb4b14458
2020-10-07 02:14:55 -07:00
empyrical c67e1fe42f Codegen: Add prepublish script to build Flow files (#28827)
Summary:
*This is a follow-up to https://github.com/facebook/react-native/issues/28645, redone using a build script based off of Metro's build script instead of using `flow-remove-types` and `flow-copy-source`.*

This pull request adds a build step to `react-native-codegen` that builds the Flow-annotated JS files so that users of the NPM module `react-native-codegen` do not need to use require hooks to be able to import it.

A new build script, `scripts/build.js` is added that builds every JS file in `src/` into a `lib/` folder, and also copies over the original Flow annotated files to `lib/` with a `.js.flow` extension, so users of `react-native-codegen` can still typecheck against it using Flow. The shell scripts in `src` are also copied over. It is based off of the [build script from Metro](00867816eb/scripts/build.js)

## Changelog

[General] [Added] - Codegen: Add prepublish script to build Flow files
Pull Request resolved: https://github.com/facebook/react-native/pull/28827

Test Plan:
I am able to make use of the Codegen scripts without needing to use the `flow-node` CLI or the `flow-remove-types/register`
require hook.

Reviewed By: cpojer

Differential Revision: D21412173

Pulled By: hramos

fbshipit-source-id: 26ae67cdd04652ca4700a069a234a25558773cb1
2020-05-08 15:41:35 -07:00
Jesse Katsumata 5b8f4ef195 Clear some lint warnings (#27893)
Summary:
Applied linting for warnings that seemed trivial.

## Changelog

[Internal] [Fixed] - clear lint warnings
Pull Request resolved: https://github.com/facebook/react-native/pull/27893

Test Plan: yarn lint

Differential Revision: D19619569

Pulled By: cpojer

fbshipit-source-id: f9f02838c56e94abc1590686c8443c6c6e6f44ca
2020-01-29 04:36:28 -08:00
Matt Hargett e67aa427a8 Eliminate eslint npm version mismatch warnings and bump some to latest (#23969)
Summary:
I was annoyed by warnings from yarn/npm about eslint peer dependencies not being met, so I dived in to try and get rid of some of them. Sometimes it meant bumping a plugin, but then that plugin needed a newer babel-eslint, so it was a dance.

Some we can't easily update to latest (eslint-plugin-prettier) because the rule format has changed a bit. Happy to do that in this PR if folks think its a good idea. eslint-config-fbjs itself needs to be updated and republished to eliminate the last few warnings.

There are a few new warnings (the repo wasn't linting cleanly for me from the start). I can fix those in this PR, or a separate one, based on people's preferences.

[internal] [chore] - Eliminate some peer dependency warnings and bump some eslint packages to latest.
Pull Request resolved: https://github.com/facebook/react-native/pull/23969

Differential Revision: D14519076

Pulled By: cpojer

fbshipit-source-id: aa44cfd05814d7b79069414aa78d089e448c2235
2019-03-19 11:14:30 -07:00
Héctor Ramos 937c79e2f2 Suggest running yarn lint --fix (#23413)
Summary:
This PR expands the code analysis script to allow for customizing the GitHub Review left by analysis-bot whenever it finds code-level issues.

Some, but not all, `eslint` errors are fixable by running `yarn lint --fix`. When the `eslint` converter finds warnings or errors, the bot will suggest running the command as part of the review.

The script could be adjusted to only suggest this when `eslint` returns a non-zero `fixableErrorCount` or `fixableWarningCount`, but I think this is a good first step to get people to unblock themselves when they see this type of review from the bot.

I've also excluded `bots/` and `scripts/` from eslint as these have several `eslint` errors that need to be addressed. These directories do not contain core RN code, so they can be excluded for now.

[GENERAL] [Changed] - analysis-bot will suggest fixing eslint warnings on code reviews
Pull Request resolved: https://github.com/facebook/react-native/pull/23413

Differential Revision: D14065757

Pulled By: cpojer

fbshipit-source-id: cc588643f7ddb3c4631d89c26b799f7a7244e616
2019-02-13 08:46:03 -08:00
Héctor Ramos 2d86618e7e Split out docs to their own repo
Reviewed By: yungsters

Differential Revision: D6462045

fbshipit-source-id: c4fe1e3bd2ccf4dbd344587456f027d6404ccbe7
2017-12-05 13:02:54 -08:00
Hector Ramos d5fe05fd67 Exclude the dangerfile from eslint.
Summary:
Before:

```
$ npm run lint

> react-native@1000.0.0 lint /Users/hramos/git/react-native
> eslint .

Cannot find module 'ljharb/eslint-config'
Referenced from: /Users/hramos/git/react-native/danger/node_modules/extend/.eslintrc
Error: Cannot find module 'ljharb/eslint-config'
Referenced from: /Users/hramos/git/react-native/danger/node_modules/extend/.eslintrc
    at ModuleResolver.resolve (/Users/hramos/git/react-native/node_modules/eslint/lib/util/module-resolver.js:74:19)
    at resolve (/Users/hramos/git/react-native/node_modules/eslint/lib/config/config-file.js:515:25)
    at load (/Users/hramos/git/react-native/node_modules/eslint/lib/config/config-file.js:532:26)
    at configExtends.reduceRight (/Users/hramos/git/react-native/node_modules/eslint/lib/config/config-file.js:424:36)
    at Array.reduceRight (native)
    at applyExtends (/Users/hramos/git/react-native/node_modules/eslint/lib/config/config-file.js:408:28)
    at Object.load (/Users/hramos/git/react-native/node_modules/eslint/lib/config/config-file.js:566:22)
    at loadConfig (/Users/hramos/git/react-native/node_modules/eslint/lib/config.js:63:33)
    at getLocalConfig (/Users/hramos/git/react-native/node_modules/eslint/lib/config.js:130:29)
    at Config.getConfig (/Users/hramos/git/react-native/node_modules/eslint/lib/config.js:260:26)

```

After:

```
$ npm run lint

> react-native@1000.0.0 lint /Users/hramos/git/react-native
> eslint .

/Users/hramos/git/react-native/babel-preset/configs/internal.js
  11:5  warning  'resolvePlugins' is assigned a value but never used  no-unused-vars
  16:2  warning  Missing semicolon
...
✖ 5047 problems (1001 errors, 4046 warnings)
```
Closes https://github.com/facebook/react-native/pull/15109

Differential Revision: D5455350

Pulled By: hramos

fbshipit-source-id: e76dae2804018ccb3da526f14cc0df2424e0d6b4
2017-07-19 13:49:32 -07:00
Eli White fc86f25f9a Run eslint on all js files
Reviewed By: zertosh

Differential Revision: D5405047

fbshipit-source-id: 5ade9d8beb3688d8bb08a208709c0dbf1ec671b2
2017-07-12 14:09:53 -07:00
Eli White 40fdd6d91c Enable eslint on circle ci
Reviewed By: zertosh

Differential Revision: D5374369

fbshipit-source-id: 5ffd246bc6fa735d781ed71cd293b7883184b786
2017-07-10 12:08:32 -07:00
James Ide 6e13adbf56 Remove remnants of the packager
Summary:
There were still some references to "packager/" that are no longer used since the `packager` directory has been deleted after moving to Metro. Cleaned up the ones that were doing nothing and updated the references that are still meaningful.
Closes https://github.com/facebook/react-native/pull/14881

Reviewed By: cpojer

Differential Revision: D5380731

Pulled By: javache

fbshipit-source-id: 1355268f48db47343d0d38fae2598b64c8c01475
2017-07-07 03:06:21 -07:00
Jean Lauliac e5920e710c packager: fork local version of worker-farm
Summary:
I suggest we grab our own version of worker-farm, since there are a few changes we'd like to do. There are two reasons for forking:

* the original project does not seem maintained anymore, with a PR remaining unanswered (https://github.com/rvagg/node-worker-farm/pull/42);
* we don't need to keep the level of genericity of the original project: for example, we don't need the option `maxConcurrentCallsPerWorker`, that we always keep to one.

Forking gives us opportunity to simplify the code for our use case. Later on we could reuse it for other projects such as `jest`.

A few things we'd like to do:

* remove special node options from the forks, such as `--inspect`, or even, allow adding special options (if you want to debug a worker specifically for example);
* allow us to pipe `stdout` and `stderr` instead of having transform spit stuff out to the parent process output;
* remove code managing `maxConcurrentCallsPerWorker` and clean up the code in general;
* add `flow` typing.

Reviewed By: davidaurelio

Differential Revision: D4993300

fbshipit-source-id: 10f0c2a18b010c2a8b2e2afebcb3aab3504d7923
2017-05-03 09:46:04 -07:00
Spencer Ahrens 11b515b1b0 [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -08:00
Ben Alpert a15603d8f1 Initial commit 2015-01-29 17:10:49 -08:00