Skip to content

Commit 1649748

Browse files
committed
chore(deps): upgrade prettier v2
1 parent e3654f5 commit 1649748

File tree

8 files changed

+15
-18
lines changed

8 files changed

+15
-18
lines changed

.babelrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"presets": [
33
[
4-
"@babel/preset-env", {
4+
"@babel/preset-env",
5+
{
56
"targets": {
67
"node": "current"
78
}
89
}
910
],
1011
"@babel/preset-flow",
11-
"@babel/preset-react",
12+
"@babel/preset-react"
1213
]
1314
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"main": "dist/index.js",
1616
"scripts": {
1717
"add-contributor": "all-contributors add",
18-
"fmt": "prettier --write '**/*.{ts,json,js,md}'",
18+
"fmt": "prettier --write .",
1919
"example": "./cli.js -l=en,ja -o example/i18n -d en --extractFromFormatMessageCall=true 'example/**/*.{js,tsx}'",
2020
"prepublish": "npm run build",
2121
"build": "tsc",
@@ -81,7 +81,7 @@
8181
"husky": "^4.2.3",
8282
"jest": "^25.1.0",
8383
"lint-staged": "^10.0.8",
84-
"prettier": "^1.19.1",
84+
"prettier": "^2.0.2",
8585
"react": "^16.13.0",
8686
"react-intl": "^3.2.0",
8787
"temp-write": "^4.0.0",

src/extract-react-intl/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const concatArray = (obj: string[], src: string) => {
3030
const createResolveList = (
3131
fn: (name: string, dirname: string) => string | null
3232
) => (list: PluginItem[], cwd: string) =>
33-
list.map(x => (typeof x === 'string' ? fn(x, cwd) : x))
33+
list.map((x) => (typeof x === 'string' ? fn(x, cwd) : x))
3434

3535
const resolvePresets = createResolveList(resolvePreset)
3636
const resolvePlugins = createResolveList(resolvePlugin)
@@ -103,7 +103,7 @@ export default async (
103103

104104
if (
105105
!plugins.find(
106-
plugin => (Array.isArray(plugin) ? plugin[0] : plugin) === 'react-intl'
106+
(plugin) => (Array.isArray(plugin) ? plugin[0] : plugin) === 'react-intl'
107107
)
108108
) {
109109
// Append a the `react-intl` babel plugin only when it isn’t already included in the babel config
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"presets": [
3-
"@babel/preset-flow"
4-
],
2+
"presets": ["@babel/preset-flow"],
53
"plugins": ["react-intl-auto"]
64
}
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"presets": [
3-
"@babel/preset-flow"
4-
],
2+
"presets": ["@babel/preset-flow"],
53
"plugins": ["react-intl"]
64
}

src/extract-react-intl/test/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test('error', async () => {
3636
await m(locales, 'notfound', {
3737
defaultLocale: 'en',
3838
cwd: `${__dirname}/fixtures`
39-
}).catch(error => {
39+
}).catch((error) => {
4040
expect(error.message).toMatch('File not found')
4141
})
4242
})

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const extractMessage = async (
109109
)
110110

111111
return Promise.all(
112-
locales.map(locale => {
112+
locales.map((locale) => {
113113
// If the default locale, overwrite the origin file
114114
let localeMap =
115115
locale === defaultLocale

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5113,10 +5113,10 @@ prettier-linter-helpers@^1.0.0:
51135113
dependencies:
51145114
fast-diff "^1.1.2"
51155115

5116-
prettier@^1.19.1:
5117-
version "1.19.1"
5118-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
5119-
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
5116+
prettier@^2.0.2:
5117+
version "2.0.2"
5118+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.2.tgz#1ba8f3eb92231e769b7fcd7cb73ae1b6b74ade08"
5119+
integrity sha512-5xJQIPT8BraI7ZnaDwSbu5zLrB6vvi8hVV58yHQ+QK64qrY40dULy0HSRlQ2/2IdzeBpjhDkqdcFBnFeDEMVdg==
51205120

51215121
pretty-format@^25.1.0:
51225122
version "25.1.0"

0 commit comments

Comments
 (0)