mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-25 07:34:45 +00:00
Update prettier and reformat code
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const isDirectory = source => fs.lstatSync(source).isDirectory();
|
||||
const getDirectories = source =>
|
||||
fs.readdirSync(source).filter(name => isDirectory(path.join(source, name)));
|
||||
const isDirectory = (source) => fs.lstatSync(source).isDirectory();
|
||||
const getDirectories = (source) =>
|
||||
fs.readdirSync(source).filter((name) => isDirectory(path.join(source, name)));
|
||||
|
||||
const packagesDir = path.join(__dirname, '../../packages/');
|
||||
const exportsDir = path.join(packagesDir, 'react-native-web/src/exports');
|
||||
|
||||
@@ -36,7 +36,7 @@ const createConfig = ({ modules }) => ({
|
||||
].concat(modules ? ['babel-plugin-add-module-exports'] : [])
|
||||
});
|
||||
|
||||
module.exports = function() {
|
||||
module.exports = function () {
|
||||
return process.env.BABEL_ENV === 'commonjs' || process.env.NODE_ENV === 'test'
|
||||
? createConfig({ modules: 'commonjs' })
|
||||
: createConfig({ modules: false });
|
||||
|
||||
@@ -29,7 +29,7 @@ function createSerializer(styleSheet) {
|
||||
const children = node.children || node.props.children;
|
||||
if (children) {
|
||||
if (Array.isArray(children)) {
|
||||
children.forEach(child => {
|
||||
children.forEach((child) => {
|
||||
args.push(flattenNodeStyles(child));
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -17,7 +17,7 @@ console.log(`Publishing ${version}`);
|
||||
const workspacePaths = require('../../package.json').workspaces.concat(['./']);
|
||||
const workspaces = workspacePaths.reduce((acc, curr) => {
|
||||
const packageDirectories = glob.sync(path.resolve(curr));
|
||||
packageDirectories.forEach(directory => {
|
||||
packageDirectories.forEach((directory) => {
|
||||
const packageJsonPath = path.join(directory, 'package.json');
|
||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf-8' }));
|
||||
acc.push({ directory, packageJson, packageJsonPath });
|
||||
@@ -29,7 +29,7 @@ const workspaces = workspacePaths.reduce((acc, curr) => {
|
||||
const workspaceNames = workspaces.map(({ packageJson }) => packageJson.name);
|
||||
workspaces.forEach(({ directory, packageJson, packageJsonPath }) => {
|
||||
packageJson.version = version;
|
||||
workspaceNames.forEach(name => {
|
||||
workspaceNames.forEach((name) => {
|
||||
if (packageJson.dependencies && packageJson.dependencies[name]) {
|
||||
packageJson.dependencies[name] = version;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user