Skip to content

Commit

Permalink
chore: update eslint-plugin-unicorn (#15219)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Jul 27, 2024
1 parent d669eed commit b113b44
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 61 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"eslint-plugin-markdown": "^3.0.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^54.0.0",
"eslint-plugin-unicorn": "^55.0.0",
"execa": "^5.0.0",
"find-process": "^1.4.1",
"glob": "^10.3.10",
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-reporters/src/GitHubActionsReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default class GitHubActionsReporter extends BaseReporter {
private printFullResult(context: TestContext, results: TestResult): void {
const rootDir = context.config.rootDir;
let testDir = results.testFilePath.replace(rootDir, '');
testDir = testDir.slice(1, testDir.length);
testDir = testDir.slice(1);
const resultTree = this.getResultTree(
results.testResults,
testDir,
Expand Down Expand Up @@ -409,7 +409,7 @@ export default class GitHubActionsReporter extends BaseReporter {
for (const result of results) {
let testDir = result.testFilePath;
testDir = testDir.replace(rootDir, '');
testDir = testDir.slice(1, testDir.length);
testDir = testDir.slice(1);
if (result.failureMessage) {
if (!written) {
this.log('');
Expand Down
9 changes: 2 additions & 7 deletions packages/jest-reporters/src/trimAndFormatPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ export default function trimAndFormatPath(
const basenameLength = basename.length;
if (basenameLength + 4 < maxLength) {
const dirnameLength = maxLength - 4 - basenameLength;
dirname = `...${dirname.slice(
dirname.length - dirnameLength,
dirname.length,
)}`;
dirname = `...${dirname.slice(dirname.length - dirnameLength)}`;
return slash(chalk.dim(dirname + path.sep) + chalk.bold(basename));
}

Expand All @@ -44,8 +41,6 @@ export default function trimAndFormatPath(

// can't fit dirname, but can fit trimmed basename
return slash(
chalk.bold(
`...${basename.slice(basename.length - maxLength - 4, basename.length)}`,
),
chalk.bold(`...${basename.slice(basename.length - maxLength - 4)}`),
);
}
7 changes: 2 additions & 5 deletions packages/jest-reporters/src/wrapAnsiString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function wrapAnsiString(
}

if (lastIndex !== string.length - 1) {
tokens.push(['string', string.slice(lastIndex, string.length)]);
tokens.push(['string', string.slice(lastIndex)]);
}

let lastLineLength = 0;
Expand All @@ -44,10 +44,7 @@ export default function wrapAnsiString(
if (lastLineLength + token.length > terminalWidth) {
while (token.length > 0) {
const chunk = token.slice(0, terminalWidth - lastLineLength);
const remaining = token.slice(
terminalWidth - lastLineLength,
token.length,
);
const remaining = token.slice(terminalWidth - lastLineLength);
lines[lines.length - 1] += chunk;
lastLineLength += chunk.length;
token = remaining;
Expand Down
57 changes: 11 additions & 46 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2886,23 +2886,6 @@ __metadata:
languageName: node
linkType: hard

"@eslint/eslintrc@npm:^3.0.2":
version: 3.1.0
resolution: "@eslint/eslintrc@npm:3.1.0"
dependencies:
ajv: ^6.12.4
debug: ^4.3.2
espree: ^10.0.1
globals: ^14.0.0
ignore: ^5.2.0
import-fresh: ^3.2.1
js-yaml: ^4.1.0
minimatch: ^3.1.2
strip-json-comments: ^3.1.1
checksum: b0a9bbd98c8b9e0f4d975b042ff9b874dde722b20834ea2ff46551c3de740d4f10f56c449b790ef34d7f82147cbddfc22b004a43cc885dbc2664bb134766b5e4
languageName: node
linkType: hard

"@eslint/js@npm:8.57.0":
version: 8.57.0
resolution: "@eslint/js@npm:8.57.0"
Expand Down Expand Up @@ -3412,7 +3395,7 @@ __metadata:
eslint-plugin-markdown: ^3.0.0
eslint-plugin-prettier: ^5.0.0
eslint-plugin-promise: ^6.1.1
eslint-plugin-unicorn: ^54.0.0
eslint-plugin-unicorn: ^55.0.0
execa: ^5.0.0
find-process: ^1.4.1
glob: ^10.3.10
Expand Down Expand Up @@ -6588,7 +6571,7 @@ __metadata:
languageName: node
linkType: hard

"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.11.0, acorn@npm:^8.12.0, acorn@npm:^8.4.1, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0":
"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.11.0, acorn@npm:^8.4.1, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0":
version: 8.12.1
resolution: "acorn@npm:8.12.1"
bin:
Expand Down Expand Up @@ -10146,17 +10129,17 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-unicorn@npm:^54.0.0":
version: 54.0.0
resolution: "eslint-plugin-unicorn@npm:54.0.0"
"eslint-plugin-unicorn@npm:^55.0.0":
version: 55.0.0
resolution: "eslint-plugin-unicorn@npm:55.0.0"
dependencies:
"@babel/helper-validator-identifier": ^7.24.5
"@eslint-community/eslint-utils": ^4.4.0
"@eslint/eslintrc": ^3.0.2
ci-info: ^4.0.0
clean-regexp: ^1.0.0
core-js-compat: ^3.37.0
esquery: ^1.5.0
globals: ^15.7.0
indent-string: ^4.0.0
is-builtin-module: ^3.2.1
jsesc: ^3.0.2
Expand All @@ -10168,7 +10151,7 @@ __metadata:
strip-indent: ^3.0.0
peerDependencies:
eslint: ">=8.56.0"
checksum: f071c79e7b7416be4d6e5b1900f20b995b841393baf7c31c56534a4e7b144bf728a07bf107585a8d1e0525010df448d16862aaa38cb9309f798a59bd91efbe4d
checksum: c925254406e687c5caaf7e019c083107b9d309569c78ec8d32e5d7c539cfb6331b5f88dc647c35e26f07493c287d39970f05fa0279787ba86bfc6edd7701bd8c
languageName: node
linkType: hard

Expand Down Expand Up @@ -10199,13 +10182,6 @@ __metadata:
languageName: node
linkType: hard

"eslint-visitor-keys@npm:^4.0.0":
version: 4.0.0
resolution: "eslint-visitor-keys@npm:4.0.0"
checksum: 5c09f89cf29d87cdbfbac38802a880d3c2e65f8cb61c689888346758f1e24a4c7f6caefeac9474dfa52058a99920623599bdb00516976a30134abeba91275aa2
languageName: node
linkType: hard

"eslint@npm:^8.8.0":
version: 8.57.0
resolution: "eslint@npm:8.57.0"
Expand Down Expand Up @@ -10254,17 +10230,6 @@ __metadata:
languageName: node
linkType: hard

"espree@npm:^10.0.1":
version: 10.1.0
resolution: "espree@npm:10.1.0"
dependencies:
acorn: ^8.12.0
acorn-jsx: ^5.3.2
eslint-visitor-keys: ^4.0.0
checksum: a4708ab987f6c03734b8738b1588e9f31b2e305e869ca4677c60d82294eb05f7099b6687eb39eeb0913bb2d49bdf0bd0f31c511599ea7ee171281f871a9c897e
languageName: node
linkType: hard

"espree@npm:^9.6.0, espree@npm:^9.6.1":
version: 9.6.1
resolution: "espree@npm:9.6.1"
Expand Down Expand Up @@ -11577,10 +11542,10 @@ __metadata:
languageName: node
linkType: hard

"globals@npm:^14.0.0":
version: 14.0.0
resolution: "globals@npm:14.0.0"
checksum: 534b8216736a5425737f59f6e6a5c7f386254560c9f41d24a9227d60ee3ad4a9e82c5b85def0e212e9d92162f83a92544be4c7fd4c902cb913736c10e08237ac
"globals@npm:^15.7.0":
version: 15.8.0
resolution: "globals@npm:15.8.0"
checksum: 92d0522c47226ca12f6fd8938df04b37852d812cc5a84e31890d919497f102a818d2081570bc08c2dd6353cd8b2699e7180bc468abbbec8c858a19e0fa53aeb8
languageName: node
linkType: hard

Expand Down

0 comments on commit b113b44

Please sign in to comment.