Skip to content

Commit

Permalink
chore: update to eslint v9
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jul 18, 2024
1 parent 7f714c9 commit fd40be9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

9 changes: 0 additions & 9 deletions .eslintrc

This file was deleted.

12 changes: 12 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import unjs from "eslint-config-unjs";

// https://github.com/unjs/eslint-config
export default unjs({
ignores: [],
rules: {
"unicorn/no-null": 0,
"unicorn/prefer-top-level-await": 0,
"unicorn/template-indent": 0,
"unicorn/no-process-exit": 0
},
});
4 changes: 3 additions & 1 deletion src/repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ export function getRepoConfig(repoUrl = ""): RepoConfig {
let url;
try {
url = new URL(repoUrl);
} catch {}
} catch {
// Ignore error
}

const m = repoUrl.match(providerURLRegex)?.groups ?? {};
if (m.repo && m.provider) {
Expand Down
1 change: 0 additions & 1 deletion src/semver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export async function bumpVersion(
if (config.newVersion) {
pkg.version = config.newVersion;
} else if (type || opts.preid) {
// eslint-disable-next-line import/no-named-as-default-member
pkg.version = semver.inc(currentVersion, type, opts.preid);
config.newVersion = pkg.version;
}
Expand Down
6 changes: 3 additions & 3 deletions test/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe("git", () => {
);

expect(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
parsed.map(({ body: _, author: __, authors: ___, ...rest }) => rest)
).toMatchObject([
{
Expand Down Expand Up @@ -112,7 +112,7 @@ describe("git", () => {
const commits = await getGitDiff(COMMIT_FROM, COMMIT_TO);
commits[1].message =
"fix(scope)!: breaking change example, close #123 (#134)";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
expect(commits.map(({ body: _, ...rest }) => rest)).toMatchInlineSnapshot(`
[
{
Expand Down Expand Up @@ -203,7 +203,7 @@ describe("git", () => {
});
const parsed = parseCommits(commits, config);

// eslint-disable-next-line @typescript-eslint/no-unused-vars
expect(parsed.map(({ body: _, author: __, authors: ___, ...rest }) => rest))
.toMatchInlineSnapshot(`
[
Expand Down

0 comments on commit fd40be9

Please # to comment.