Skip to content

Commit fd4fafa

Browse files
committed
Prettier all the things
1 parent 2442114 commit fd4fafa

19 files changed

+349
-325
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ package.json
22
es
33
lib
44
umd
5+
website/dist
56

build/babel-preset.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const plugins = [
88
[
99
"transform-react-remove-prop-types",
1010
{
11-
"mode": "unsafe-wrap"
11+
mode: "unsafe-wrap"
1212
}
1313
],
1414
[

examples/crud/config/env.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
'use strict';
1+
"use strict";
22

3-
const fs = require('fs');
4-
const path = require('path');
5-
const paths = require('./paths');
3+
const fs = require("fs");
4+
const path = require("path");
5+
const paths = require("./paths");
66

77
// Make sure that including paths.js after env.js will read .env variables.
8-
delete require.cache[require.resolve('./paths')];
8+
delete require.cache[require.resolve("./paths")];
99

1010
const NODE_ENV = process.env.NODE_ENV;
1111
if (!NODE_ENV) {
1212
throw new Error(
13-
'The NODE_ENV environment variable is required but was not specified.'
13+
"The NODE_ENV environment variable is required but was not specified."
1414
);
1515
}
1616

@@ -21,8 +21,8 @@ var dotenvFiles = [
2121
// Don't include `.env.local` for `test` environment
2222
// since normally you expect tests to produce the same
2323
// results for everyone
24-
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
25-
paths.dotenv,
24+
NODE_ENV !== "test" && `${paths.dotenv}.local`,
25+
paths.dotenv
2626
].filter(Boolean);
2727

2828
// Load environment variables from .env* files. Suppress warnings using silent
@@ -32,9 +32,9 @@ var dotenvFiles = [
3232
// https://github.com/motdotla/dotenv-expand
3333
dotenvFiles.forEach(dotenvFile => {
3434
if (fs.existsSync(dotenvFile)) {
35-
require('dotenv-expand')(
36-
require('dotenv').config({
37-
path: dotenvFile,
35+
require("dotenv-expand")(
36+
require("dotenv").config({
37+
path: dotenvFile
3838
})
3939
);
4040
}
@@ -50,7 +50,7 @@ dotenvFiles.forEach(dotenvFile => {
5050
// https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421
5151
// We also resolve them to make sure all tools using them work consistently.
5252
const appDirectory = fs.realpathSync(process.cwd());
53-
process.env.NODE_PATH = (process.env.NODE_PATH || '')
53+
process.env.NODE_PATH = (process.env.NODE_PATH || "")
5454
.split(path.delimiter)
5555
.filter(folder => folder && !path.isAbsolute(folder))
5656
.map(folder => path.resolve(appDirectory, folder))
@@ -71,20 +71,20 @@ function getClientEnvironment(publicUrl) {
7171
{
7272
// Useful for determining whether we’re running in production mode.
7373
// Most importantly, it switches React into the correct mode.
74-
NODE_ENV: process.env.NODE_ENV || 'development',
74+
NODE_ENV: process.env.NODE_ENV || "development",
7575
// Useful for resolving the correct path to static assets in `public`.
7676
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
7777
// This should only be used as an escape hatch. Normally you would put
7878
// images into the `src` and `import` them in code to get their paths.
79-
PUBLIC_URL: publicUrl,
79+
PUBLIC_URL: publicUrl
8080
}
8181
);
8282
// Stringify all values so we can feed into Webpack DefinePlugin
8383
const stringified = {
84-
'process.env': Object.keys(raw).reduce((env, key) => {
84+
"process.env": Object.keys(raw).reduce((env, key) => {
8585
env[key] = JSON.stringify(raw[key]);
8686
return env;
87-
}, {}),
87+
}, {})
8888
};
8989

9090
return { raw, stringified };
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
'use strict';
1+
"use strict";
22

33
// This is a custom Jest transformer turning style imports into empty objects.
44
// http://facebook.github.io/jest/docs/en/webpack.html
55

66
module.exports = {
77
process() {
8-
return 'module.exports = {};';
8+
return "module.exports = {};";
99
},
1010
getCacheKey() {
1111
// The output is always the same.
12-
return 'cssTransform';
13-
},
12+
return "cssTransform";
13+
}
1414
};
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
'use strict';
1+
"use strict";
22

3-
const path = require('path');
3+
const path = require("path");
44

55
// This is a custom Jest transformer turning file imports into filenames.
66
// http://facebook.github.io/jest/docs/en/webpack.html
77

88
module.exports = {
99
process(src, filename) {
1010
return `module.exports = ${JSON.stringify(path.basename(filename))};`;
11-
},
11+
}
1212
};

examples/crud/config/paths.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
'use strict';
1+
"use strict";
22

3-
const path = require('path');
4-
const fs = require('fs');
5-
const url = require('url');
3+
const path = require("path");
4+
const fs = require("fs");
5+
const url = require("url");
66

77
// Make sure any symlinks in the project folder are resolved:
88
// https://github.com/facebookincubator/create-react-app/issues/637
@@ -12,7 +12,7 @@ const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
1212
const envPublicUrl = process.env.PUBLIC_URL;
1313

1414
function ensureSlash(path, needsSlash) {
15-
const hasSlash = path.endsWith('/');
15+
const hasSlash = path.endsWith("/");
1616
if (hasSlash && !needsSlash) {
1717
return path.substr(path, path.length - 1);
1818
} else if (!hasSlash && needsSlash) {
@@ -34,22 +34,22 @@ const getPublicUrl = appPackageJson =>
3434
function getServedPath(appPackageJson) {
3535
const publicUrl = getPublicUrl(appPackageJson);
3636
const servedUrl =
37-
envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : '/');
37+
envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : "/");
3838
return ensureSlash(servedUrl, true);
3939
}
4040

4141
// config after eject: we're in ./config/
4242
module.exports = {
43-
dotenv: resolveApp('.env'),
44-
appBuild: resolveApp('build'),
45-
appPublic: resolveApp('public'),
46-
appHtml: resolveApp('public/index.html'),
47-
appIndexJs: resolveApp('src/index.js'),
48-
appPackageJson: resolveApp('package.json'),
49-
appSrc: resolveApp('src'),
50-
yarnLockFile: resolveApp('yarn.lock'),
51-
testsSetup: resolveApp('src/setupTests.js'),
52-
appNodeModules: resolveApp('node_modules'),
53-
publicUrl: getPublicUrl(resolveApp('package.json')),
54-
servedPath: getServedPath(resolveApp('package.json')),
43+
dotenv: resolveApp(".env"),
44+
appBuild: resolveApp("build"),
45+
appPublic: resolveApp("public"),
46+
appHtml: resolveApp("public/index.html"),
47+
appIndexJs: resolveApp("src/index.js"),
48+
appPackageJson: resolveApp("package.json"),
49+
appSrc: resolveApp("src"),
50+
yarnLockFile: resolveApp("yarn.lock"),
51+
testsSetup: resolveApp("src/setupTests.js"),
52+
appNodeModules: resolveApp("node_modules"),
53+
publicUrl: getPublicUrl(resolveApp("package.json")),
54+
servedPath: getServedPath(resolveApp("package.json"))
5555
};

examples/crud/config/polyfills.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
'use strict';
1+
"use strict";
22

3-
if (typeof Promise === 'undefined') {
3+
if (typeof Promise === "undefined") {
44
// Rejection tracking prevents a common issue where React gets into an
55
// inconsistent state due to an error, but it gets swallowed by a Promise,
66
// and the user has no idea what causes React's erratic future behavior.
7-
require('promise/lib/rejection-tracking').enable();
8-
window.Promise = require('promise/lib/es6-extensions.js');
7+
require("promise/lib/rejection-tracking").enable();
8+
window.Promise = require("promise/lib/es6-extensions.js");
99
}
1010

1111
// fetch() polyfill for making API calls.
12-
require('whatwg-fetch');
12+
require("whatwg-fetch");
1313

1414
// Object.assign() is commonly used with React.
1515
// It will use the native implementation if it's present and isn't buggy.
16-
Object.assign = require('object-assign');
16+
Object.assign = require("object-assign");
1717

1818
// In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet.
1919
// We don't polyfill it in the browser--this is user's responsibility.
20-
if (process.env.NODE_ENV === 'test') {
21-
require('raf').polyfill(global);
20+
if (process.env.NODE_ENV === "test") {
21+
require("raf").polyfill(global);
2222
}

0 commit comments

Comments
 (0)