Skip to content

Commit 72412a0

Browse files
author
Robert Jackson
authored
Merge pull request #299 from ember-codemods/dependabot/npm_and_yarn/prettier-2.0.5
2 parents 0732511 + a741c51 commit 72412a0

6 files changed

Lines changed: 18 additions & 21 deletions

File tree

lib/logger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { createLogger, format, transports } = require('winston');
22
const { combine, timestamp, printf } = format;
33

4-
const logFormatter = printf(info => {
4+
const logFormatter = printf((info) => {
55
return `${info.timestamp} [${info.level}] ${info.message}`;
66
});
77

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"eslint-plugin-prettier": "^3.1.3",
4949
"execa": "^4.0.0",
5050
"jest": "^25.4.0",
51-
"prettier": "^1.19.1",
51+
"prettier": "^2.0.5",
5252
"release-it": "^13.5.6",
5353
"release-it-lerna-changelog": "^2.3.0"
5454
},

test/run-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const execOpts = { cwd: inputDir, stderr: 'inherit' };
2121
emberServe.stderr.pipe(process.stderr);
2222
emberServe.stdout.pipe(process.stdout);
2323

24-
await new Promise(resolve => {
25-
emberServe.stdout.on('data', data => {
24+
await new Promise((resolve) => {
25+
emberServe.stdout.on('data', (data) => {
2626
if (data.toString().includes('Build successful')) {
2727
resolve();
2828
}

transforms/angle-brackets/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function getOptions() {
3636
return options;
3737
}
3838

39-
module.exports = function(file) {
39+
module.exports = function (file) {
4040
const options = getOptions();
4141
let invokableData = options.telemetry ? getInvokableData(getTelemetry()) : {};
4242
try {

transforms/angle-brackets/transform.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function isAttribute(key) {
2525
*/
2626
function shouldSkipAttribute(key, config) {
2727
if (config.skipAttributesThatMatchRegex && config.skipAttributesThatMatchRegex.length) {
28-
return config.skipAttributesThatMatchRegex.some(rx => {
28+
return config.skipAttributesThatMatchRegex.some((rx) => {
2929
// Get the user provided string and convert it to regex.
3030
const match = /^\/(.*)\/([a-z]*)$/.exec(rx);
3131
if (match) {
@@ -82,7 +82,7 @@ function transformTagName(tagName) {
8282
}
8383

8484
function transformNestedSubExpression(subExpression) {
85-
let positionalArgs = subExpression.params.map(param => {
85+
let positionalArgs = subExpression.params.map((param) => {
8686
if (param.type === 'SubExpression') {
8787
return transformNestedSubExpression(param);
8888
} else if (param.type === 'StringLiteral') {
@@ -94,7 +94,7 @@ function transformNestedSubExpression(subExpression) {
9494

9595
let namedArgs = [];
9696
if (subExpression.hash.pairs.length > 0) {
97-
namedArgs = subExpression.hash.pairs.map(pair => {
97+
namedArgs = subExpression.hash.pairs.map((pair) => {
9898
if (pair.value.type === 'SubExpression') {
9999
let nestedValue = transformNestedSubExpression(pair.value);
100100
return `${pair.key}=${nestedValue}`;
@@ -125,7 +125,7 @@ function shouldSkipFile(fileInfo, config) {
125125
}
126126

127127
function transformAttrs(tagName, attrs, config) {
128-
return attrs.map(a => {
128+
return attrs.map((a) => {
129129
let _key = a.key;
130130
let _valueType = a.value.type;
131131
let _value;
@@ -144,7 +144,7 @@ function transformAttrs(tagName, attrs, config) {
144144
_value = a.value;
145145
} else {
146146
const params = a.value.params
147-
.map(p => {
147+
.map((p) => {
148148
if (p.type === 'SubExpression') {
149149
return transformNestedSubExpression(p);
150150
} else if (p.type === 'StringLiteral') {
@@ -290,7 +290,7 @@ function shouldSkipDataTestParams(params, includeValuelessDataTestAttributes) {
290290
const dataAttrs = getDataAttributesFromParams(params);
291291
// This is true for nodes with data-* attributes too,
292292
// as long as there is one with data-test-* attribute.
293-
return !dataAttrs.some(attr => attr.original.startsWith('data-test-'));
293+
return !dataAttrs.some((attr) => attr.original.startsWith('data-test-'));
294294
}
295295
return true;
296296
}
@@ -305,11 +305,11 @@ function isDataAttrPathExpression(node) {
305305
}
306306

307307
function getDataAttributesFromParams(params) {
308-
return params.filter(it => isDataAttrPathExpression(it));
308+
return params.filter((it) => isDataAttrPathExpression(it));
309309
}
310310

311311
function getNonDataAttributesFromParams(params) {
312-
return params.filter(it => !isDataAttrPathExpression(it));
312+
return params.filter((it) => !isDataAttrPathExpression(it));
313313
}
314314

315315
function shouldIgnoreMustacheStatement(fullName, config, invokableData) {
@@ -319,10 +319,7 @@ function shouldIgnoreMustacheStatement(fullName, config, invokableData) {
319319
let name = fullName;
320320
// replace `::` with `/`, and ignore the path before $
321321
if (isWallStreet(name)) {
322-
name = name
323-
.split('$')
324-
.pop()
325-
.replace('::', '/');
322+
name = name.split('$').pop().replace('::', '/');
326323
}
327324

328325
if (isTelemetryData) {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5467,10 +5467,10 @@ prettier-linter-helpers@^1.0.0:
54675467
dependencies:
54685468
fast-diff "^1.1.2"
54695469

5470-
prettier@^1.19.1:
5471-
version "1.19.1"
5472-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
5473-
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
5470+
prettier@^2.0.5:
5471+
version "2.0.5"
5472+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
5473+
integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
54745474

54755475
pretty-format@^25.4.0:
54765476
version "25.4.0"

0 commit comments

Comments
 (0)