mirror of
https://github.com/status-im/react-native.git
synced 2025-02-20 13:18:07 +00:00
add prettier check in ci (#23382)
Summary: enforce code format Pull Request resolved: https://github.com/facebook/react-native/pull/23382 Differential Revision: D14024609 Pulled By: cpojer fbshipit-source-id: 21176cf8f009987e5a281bbead414374632eabee
This commit is contained in:
parent
62599fa8ff
commit
392e89676f
@ -358,6 +358,7 @@ jobs:
|
||||
- run: *setup-artifacts
|
||||
- run: *yarn
|
||||
- run: *run-js-tests
|
||||
- run: yarn run format-check
|
||||
- store_test_results:
|
||||
path: ~/react-native/reports/junit
|
||||
|
||||
|
8
Libraries/vendor/core/Map.js
vendored
8
Libraries/vendor/core/Map.js
vendored
@ -546,8 +546,10 @@ module.exports = (function(global, undefined) {
|
||||
}
|
||||
|
||||
if (!isES5) {
|
||||
if (hasOwn.call(o, "propertyIsEnumerable") &&
|
||||
hasOwn.call(o.propertyIsEnumerable, hashProperty)) {
|
||||
if (
|
||||
hasOwn.call(o, 'propertyIsEnumerable') &&
|
||||
hasOwn.call(o.propertyIsEnumerable, hashProperty)
|
||||
) {
|
||||
return o.propertyIsEnumerable[hashProperty];
|
||||
}
|
||||
}
|
||||
@ -571,7 +573,7 @@ module.exports = (function(global, undefined) {
|
||||
o.propertyIsEnumerable = function() {
|
||||
return propIsEnumerable.apply(this, arguments);
|
||||
};
|
||||
return o.propertyIsEnumerable[hashProperty] = ++hashCounter;
|
||||
return (o.propertyIsEnumerable[hashProperty] = ++hashCounter);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,13 +19,15 @@ function getTestMap() {
|
||||
// Wrap Object.{freeze,seal,preventExtensions} so each function adds its
|
||||
// argument to a Map first, which gives our ./Map.js polyfill a chance to
|
||||
// tag the object before it becomes non-extensible.
|
||||
["freeze", "seal", "preventExtensions"].forEach(name => {
|
||||
['freeze', 'seal', 'preventExtensions'].forEach(name => {
|
||||
const method = Object[name];
|
||||
if (typeof method === "function") {
|
||||
(Object: any)[name] = function (obj) {
|
||||
if (typeof method === 'function') {
|
||||
(Object: any)[name] = function(obj) {
|
||||
try {
|
||||
// If .set succeeds, also call .delete to avoid leaking memory.
|
||||
getTestMap().set(obj, obj).delete(obj);
|
||||
getTestMap()
|
||||
.set(obj, obj)
|
||||
.delete(obj);
|
||||
} finally {
|
||||
// If .set fails, the exception will be silently swallowed
|
||||
// by this return-from-finally statement, and the method will
|
||||
|
@ -139,7 +139,8 @@
|
||||
"flow-check-ios": "flow check",
|
||||
"flow-check-android": "flow check --flowconfig-name .flowconfig.android",
|
||||
"lint": "eslint .",
|
||||
"prettier": "prettier \"./**/*.js\" --write",
|
||||
"prettier": "prettier --write \"./**/*.js\" \"./**/*.md\"",
|
||||
"format-check": "prettier --list-different \"./**/*.js\" \"./**/*.md\"",
|
||||
"docker-setup-android": "docker pull reactnativecommunity/react-native-android",
|
||||
"docker-build-android": "docker build -t reactnativeci/android -f ContainerShip/Dockerfile.android .",
|
||||
"test-android-run-instrumentation": "docker run --cap-add=SYS_ADMIN -it reactnativeci/android bash ContainerShip/scripts/run-android-docker-instrumentation-tests.sh",
|
||||
|
Loading…
x
Reference in New Issue
Block a user