Skip to content

Commit e053d90

Browse files
committed
style: cs fixes
Signed-off-by: prisis <[email protected]>
1 parent 5f9d6fe commit e053d90

File tree

7 files changed

+22
-44
lines changed

7 files changed

+22
-44
lines changed

Diff for: packages/commitlint-config/src/index.ts

+2-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// eslint-disable-next-line unicorn/better-regex
2-
const automaticCommitPattern = /^chore\(release\):.*\[skip ci\]/;
1+
const automaticCommitPattern = /^chore\(release\):.*\[skip ci\]/u;
32

43
const config = {
54
extends: ["@commitlint/config-conventional"],
@@ -24,22 +23,7 @@ const config = {
2423
"type-enum": [
2524
2,
2625
"always",
27-
[
28-
"build",
29-
"chore",
30-
"ci",
31-
"deps",
32-
"docs",
33-
"feat",
34-
"fix",
35-
"perf",
36-
"refactor",
37-
"revert",
38-
"security",
39-
"style",
40-
"test",
41-
"translation",
42-
],
26+
["build", "chore", "ci", "deps", "docs", "feat", "fix", "perf", "refactor", "revert", "security", "style", "test", "translation"],
4327
],
4428
},
4529
};

Diff for: packages/lint-staged-config/__tests__/groups/eslint/remove-ignored-files.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe("remove-ignored-files", () => {
99

1010
expect(result).toHaveLength(files.length);
1111

12-
result.forEach((file) => expect(file).toMatch(/"file\d"/));
12+
result.forEach((file) => expect(file).toMatch(/"file\d"/u));
1313
});
1414

1515
// TODO: find a good way to mock eslint.isPathIgnored
@@ -20,6 +20,6 @@ describe("remove-ignored-files", () => {
2020

2121
expect(result).toHaveLength(files.length - 2);
2222

23-
result.forEach((file) => expect(file).toMatch(/"file\d"/));
23+
result.forEach((file) => expect(file).toMatch(/"file\d"/u));
2424
});
2525
});

Diff for: packages/lint-staged-config/src/utils/is-windows.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { env, platform } from "node:process";
22

33
// eslint-disable-next-line regexp/no-unused-capturing-group
4-
const isWindows = platform === "win32" || /^(msys|cygwin)$/.test(env["OSTYPE"] ?? "");
4+
const isWindows = platform === "win32" || /^(msys|cygwin)$/u.test(env["OSTYPE"] ?? "");
55

66
export default isWindows;

Diff for: packages/prettier-config/src/postinstall.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { existsSync, writeFile } from "node:fs";
22
import { join } from "node:path";
3+
import { env, exit } from "node:process";
34
import { promisify } from "node:util";
45

56
import { packageIsTypeModule, projectPath } from "@anolilab/package-json-utils";
67

78
import content from ".";
89

9-
if (process.env["CI"]) {
10-
// eslint-disable-next-line unicorn/no-process-exit
11-
process.exit(0);
10+
if (env["CI"] !== undefined) {
11+
exit(0);
1212
}
1313

1414
const writeFileAsync = promisify(writeFile);
@@ -86,13 +86,11 @@ const writePrettierIgnore = async () => {
8686

8787
console.log("😎 Everything went well, have fun!");
8888

89-
// eslint-disable-next-line unicorn/no-process-exit
90-
process.exit(0);
89+
exit(0);
9190
} catch (error) {
9291
console.log("😬 something went wrong:");
9392
console.error(error);
9493

95-
// eslint-disable-next-line unicorn/no-process-exit
96-
process.exit(1);
94+
exit(1);
9795
}
9896
})();

Diff for: packages/semantic-release-preset/src/postinstall.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { promisify } from "node:util";
55

66
import { hasDependencies, hasDevDependencies, pkg, projectPath } from "@anolilab/package-json-utils";
77

8-
if (env["CI"]) {
8+
if (env["CI"] !== undefined) {
99
exit(0);
1010
}
1111

@@ -18,7 +18,7 @@ console.log("Configuring @anolilab/semantic-release-preset", projectPath, "\n");
1818
*/
1919
const writeReleaseRc = async () => {
2020
if (
21-
pkg &&
21+
pkg !== undefined &&
2222
(hasDevDependencies(["multi-semantic-release", "@qiwi/multi-semantic-release"]) ||
2323
hasDependencies(["multi-semantic-release", "@qiwi/multi-semantic-release"]))
2424
) {

Diff for: packages/stylelint-config/src/postinstall.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { existsSync, writeFile } from "node:fs";
22
import { join } from "node:path";
3+
import { env, exit } from "node:process";
34
import { promisify } from "node:util";
45

56
import { packageIsTypeModule, projectPath } from "@anolilab/package-json-utils";
67

7-
if (process.env["CI"]) {
8-
// eslint-disable-next-line unicorn/no-process-exit
9-
process.exit(0);
8+
if (env["CI"] !== undefined) {
9+
exit(0);
1010
}
1111

1212
const writeFileAsync = promisify(writeFile);
@@ -73,13 +73,11 @@ node_modules/**
7373

7474
console.log("😎 Everything went well, have fun!");
7575

76-
// eslint-disable-next-line unicorn/no-process-exit
77-
process.exit(0);
76+
exit(0);
7877
} catch (error) {
7978
console.log("😬 something went wrong:");
8079
console.error(error);
8180

82-
// eslint-disable-next-line unicorn/no-process-exit
83-
process.exit(1);
81+
exit(1);
8482
}
8583
})();

Diff for: packages/textlint-config/src/postinstall.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { existsSync, writeFile } from "node:fs";
22
import { join } from "node:path";
3+
import { env, exit } from "node:process";
34
import { promisify } from "node:util";
45

56
import { projectPath } from "@anolilab/package-json-utils";
67

7-
if (process.env["CI"]) {
8-
// eslint-disable-next-line unicorn/no-process-exit
9-
process.exit(0);
8+
if (env["CI"] !== undefined) {
9+
exit(0);
1010
}
1111

1212
const writeFileAsync = promisify(writeFile);
@@ -193,13 +193,11 @@ const writeTextLintIgnore = async () => {
193193

194194
console.log("😎 Everything went well, have fun!");
195195

196-
// eslint-disable-next-line unicorn/no-process-exit
197-
process.exit(0);
196+
exit(0);
198197
} catch (error) {
199198
console.log("😬 something went wrong:");
200199
console.error(error);
201200

202-
// eslint-disable-next-line unicorn/no-process-exit
203-
process.exit(1);
201+
exit(1);
204202
}
205203
})();

0 commit comments

Comments
 (0)