Skip to content

Commit 56deffa

Browse files
Chore: upgrade prettier to ^1.6.1 (#49)
1 parent 5ea0526 commit 56deffa

File tree

5 files changed

+25
-86
lines changed

5 files changed

+25
-86
lines changed

build/release.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ const CHANGELOG_PATH = path.join(process.cwd(), 'CHANGELOG.md');
1010
const packageFile = require(PACKAGE_JSON_PATH);
1111

1212
function exec(command) {
13-
return childProcess.execSync(command).toString().slice(0, -1);
13+
return childProcess
14+
.execSync(command)
15+
.toString()
16+
.slice(0, -1);
1417
}
1518

1619
const githubRepoUrl = exec('git config --get remote.origin.url').replace(
@@ -48,7 +51,9 @@ function getAbbreviatedCommitHash(commitHash) {
4851
}
4952

5053
function getCommitLink(commitHash) {
51-
return `[${getAbbreviatedCommitHash(commitHash)}](${githubRepoUrl}/commit/${commitHash})`;
54+
return `[${getAbbreviatedCommitHash(
55+
commitHash
56+
)}](${githubRepoUrl}/commit/${commitHash})`;
5257
}
5358

5459
function replaceIssueLinks(message) {

eslint-plugin-prettier.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,10 @@ module.exports = {
306306
]
307307
},
308308
create(context) {
309-
const prettierOptions = context.options[0] === 'fb'
310-
? FB_PRETTIER_OPTIONS
311-
: context.options[0];
309+
const prettierOptions =
310+
context.options[0] === 'fb'
311+
? FB_PRETTIER_OPTIONS
312+
: context.options[0];
312313

313314
const pragma = context.options[1]
314315
? context.options[1].slice(1) // Remove leading @
@@ -326,10 +327,12 @@ module.exports = {
326327
const allComments = sourceCode.getAllComments();
327328
const firstComment = hasShebang ? allComments[1] : allComments[0];
328329
if (
329-
!(firstComment &&
330+
!(
331+
firstComment &&
330332
firstComment.type === 'Block' &&
331333
firstComment.loc.start.line === (hasShebang ? 2 : 1) &&
332-
firstComment.loc.start.column === 0)
334+
firstComment.loc.start.column === 0
335+
)
333336
) {
334337
return {};
335338
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"eslint-plugin-self": "^1.0.1",
4242
"mocha": "^3.1.2",
4343
"moment": "^2.18.1",
44-
"prettier": "^1.3.1",
44+
"prettier": "^1.6.1",
4545
"semver": "^5.3.0"
4646
},
4747
"engines": {

test/prettier.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ ruleTester.run('prettier', rule, {
3434
// No pragma = No prettier check.
3535
{ code: '""\n', options: [null, '@format'] },
3636
// Facebook style uses single quotes.
37-
{ code: `'';\n`, options: ['fb'] },
37+
{ code: `('');\n`, options: ['fb'] },
3838
// Facebook style but missing pragma.
3939
{ code: `"";\n`, options: ['fb', '@format'] },
4040
// Facebook style with pragma.
41-
{ code: `/** @format */\n'';\n`, options: ['fb', '@format'] },
41+
{ code: `/** @format */\n('');\n`, options: ['fb', '@format'] },
4242
// Shebang with pragma.
4343
{ code: `#!/bin/node\n/** @format */\n"";\n`, options: [null, '@format'] }
4444
],

yarn.lock

+7-76
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ ansi-styles@^2.2.1:
3939
version "2.2.1"
4040
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
4141

42-
ansi-styles@^3.0.0:
43-
version "3.0.0"
44-
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.0.0.tgz#5404e93a544c4fec7f048262977bebfe3155e0c1"
45-
dependencies:
46-
color-convert "^1.0.0"
47-
4842
argparse@^1.0.7:
4943
version "1.0.9"
5044
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
@@ -65,22 +59,14 @@ arrify@^1.0.0:
6559
version "1.0.1"
6660
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
6761

68-
ast-types@0.9.8:
69-
version "0.9.8"
70-
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.8.tgz#6cb6a40beba31f49f20928e28439fc14a3dab078"
71-
72-
babel-code-frame@6.22.0, babel-code-frame@^6.16.0:
62+
babel-code-frame@^6.16.0:
7363
version "6.22.0"
7464
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4"
7565
dependencies:
7666
chalk "^1.1.0"
7767
esutils "^2.0.2"
7868
js-tokens "^3.0.0"
7969

80-
babylon@7.0.0-beta.8:
81-
version "7.0.0-beta.8"
82-
resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.8.tgz#2bdc5ae366041442c27e068cce6f0d7c06ea9949"
83-
8470
balanced-match@^0.4.1:
8571
version "0.4.2"
8672
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838"
@@ -110,7 +96,7 @@ callsites@^0.2.0:
11096
version "0.2.0"
11197
resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca"
11298

113-
chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
99+
chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
114100
version "1.1.3"
115101
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
116102
dependencies:
@@ -142,16 +128,6 @@ code-point-at@^1.0.0:
142128
version "1.1.0"
143129
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
144130

145-
color-convert@^1.0.0:
146-
version "1.9.0"
147-
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a"
148-
dependencies:
149-
color-name "^1.1.1"
150-
151-
color-name@^1.1.1:
152-
version "1.1.2"
153-
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d"
154-
155131
commander@2.9.0:
156132
version "2.9.0"
157133
resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4"
@@ -378,7 +354,7 @@ estraverse@~4.1.0:
378354
version "4.1.1"
379355
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2"
380356

381-
esutils@2.0.2, esutils@^2.0.2:
357+
esutils@^2.0.2:
382358
version "2.0.2"
383359
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
384360

@@ -424,10 +400,6 @@ flat-cache@^1.2.1:
424400
graceful-fs "^4.1.2"
425401
write "^0.2.1"
426402

427-
flow-parser@0.45.0:
428-
version "0.45.0"
429-
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.45.0.tgz#aa29d4ae27f06aa02817772bba0fcbefef7e62f0"
430-
431403
fs.realpath@^1.0.0:
432404
version "1.0.0"
433405
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@@ -442,7 +414,7 @@ generate-object-property@^1.1.0:
442414
dependencies:
443415
is-property "^1.0.0"
444416

445-
get-stdin@5.0.1, get-stdin@^5.0.1:
417+
get-stdin@^5.0.1:
446418
version "5.0.1"
447419
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398"
448420

@@ -588,22 +560,6 @@ jest-docblock@^20.0.1:
588560
version "20.0.3"
589561
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712"
590562

591-
jest-matcher-utils@^19.0.0:
592-
version "19.0.0"
593-
resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d"
594-
dependencies:
595-
chalk "^1.1.3"
596-
pretty-format "^19.0.0"
597-
598-
jest-validate@19.0.0:
599-
version "19.0.0"
600-
resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.0.tgz#8c6318a20ecfeaba0ba5378bfbb8277abded4173"
601-
dependencies:
602-
chalk "^1.1.1"
603-
jest-matcher-utils "^19.0.0"
604-
leven "^2.0.0"
605-
pretty-format "^19.0.0"
606-
607563
js-tokens@^3.0.0:
608564
version "3.0.1"
609565
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7"
@@ -633,10 +589,6 @@ jsonpointer@^4.0.0:
633589
version "4.0.1"
634590
resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"
635591

636-
leven@^2.0.0:
637-
version "2.1.0"
638-
resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580"
639-
640592
levn@^0.3.0, levn@~0.3.0:
641593
version "0.3.0"
642594
resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
@@ -705,10 +657,6 @@ minimist@0.0.8:
705657
version "0.0.8"
706658
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
707659

708-
minimist@1.2.0:
709-
version "1.2.0"
710-
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
711-
712660
mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1:
713661
version "0.5.1"
714662
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
@@ -814,26 +762,9 @@ prelude-ls@~1.1.2:
814762
version "1.1.2"
815763
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
816764

817-
prettier@^1.3.1:
818-
version "1.3.1"
819-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.3.1.tgz#fa0ea84b45ac0ba6de6a1e4cecdcff900d563151"
820-
dependencies:
821-
ast-types "0.9.8"
822-
babel-code-frame "6.22.0"
823-
babylon "7.0.0-beta.8"
824-
chalk "1.1.3"
825-
esutils "2.0.2"
826-
flow-parser "0.45.0"
827-
get-stdin "5.0.1"
828-
glob "7.1.1"
829-
jest-validate "19.0.0"
830-
minimist "1.2.0"
831-
832-
pretty-format@^19.0.0:
833-
version "19.0.0"
834-
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84"
835-
dependencies:
836-
ansi-styles "^3.0.0"
765+
prettier@^1.6.1:
766+
version "1.6.1"
767+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.6.1.tgz#850f411a3116226193e32ea5acfc21c0f9a76d7d"
837768

838769
process-nextick-args@~1.0.6:
839770
version "1.0.7"

0 commit comments

Comments
 (0)