Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

68 changes: 0 additions & 68 deletions .eslintrc

This file was deleted.

2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# prettier v3 migration
303cacdde85c94f2ef4d1408b401165ff25d263d
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea/
coverage/
dist/
node_modules/
.env
*error.log
scratchings.js
dist/
.env
coverage/
90 changes: 90 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { defineConfig } from "eslint/config";
import js from "@eslint/js";
import node from "eslint-plugin-n";
import tseslint from "typescript-eslint";
import vitest from "@vitest/eslint-plugin";
import eslintConfigPrettier from "eslint-config-prettier/flat";
import importLite from "eslint-plugin-import-lite";

export default defineConfig(
{
ignores: [
"**/node_modules/**",
"**/dist/**",
"**/__fixtures__/**",
"**/scratchings.js",
"packages/cli/bin.js",
"**/*.snap",
],
},
{
plugins: {
js,
node,
tseslint,
vitest,
},
extends: [
"js/recommended",
"node/flat/recommended",
"tseslint/recommended",
"tseslint/recommendedTypeChecked",
importLite.configs.recommended,
"vitest/recommended",
],
linterOptions: {
reportUnusedDisableDirectives: "error",
reportUnusedInlineConfigs: "error",
},
languageOptions: {
parserOptions: { projectService: true },
},
rules: {
eqeqeq: ["off", "always", { null: "never", undefined: "never" }], // TODO enable and fix errors
"prefer-const": "off", // TODO enable and fix errors

"@typescript-eslint/consistent-type-exports": [
"error",
{ fixMixedExportsWithInlineTypeSpecifier: true },
],
"@typescript-eslint/consistent-type-imports": [
"error",
{ fixStyle: "inline-type-imports", disallowTypeAnnotations: false },
],
"import-lite/consistent-type-specifier-style": [
"error",
"prefer-top-level",
],

"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "off", // TODO enable and fix errors
"@typescript-eslint/no-unnecessary-type-assertion": "off", // TODO enable and fix errors
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/require-await": "off", // TODO enable and fix errors
"@typescript-eslint/unbound-method": "off",

// these rules are slow, require extensive config, and/or don't provide much
"n/no-extraneous-import": "off",
"n/no-missing-import": "off",
"n/no-process-exit": "off",
"n/no-unpublished-import": "off",

"n/prefer-node-protocol": "off", // TODO enable and fix errors
"n/no-unsupported-features/node-builtins": [
"error",
{ ignores: ["fs/promises.cp", "import.meta.dirname"] },
],

"import-lite/no-mutable-exports": "off", // TODO enable and fix errors
},
},
{
files: ["**/*.{js,mjs}"],
...tseslint.configs.disableTypeChecked,
},
eslintConfigPrettier,
);
22 changes: 10 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"watch": "preconstruct watch",
"format": "prettier --experimental-cli --list-different \"**/*.{js,ts,tsx,md}\"",
"format:fix": "prettier --experimental-cli --write \"**/*.{js,ts,tsx,md}\"",
"lint": "eslint . --ext .ts,.tsx,.js",
"lint": "eslint",
"test": "vitest",
"types:check": "tsc",
"check-all": "node --run build && node --run test -- run && node --run types:check && node --run lint && node --run format",
Expand Down Expand Up @@ -37,22 +37,20 @@
"@babel/core": "^7.28.5",
"@babel/preset-env": "^7.28.5",
"@babel/preset-typescript": "^7.27.0",
"@eslint/js": "10.0.1",
"@manypkg/cli": "^0.25.1",
"@preconstruct/cli": "^2.8.12",
"@types/node": "^24.10.1",
"@types/node": "^24.12.2",
"@types/semver": "^7.7.1",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitest/coverage-v8": "^4.1.5",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-n": "^15.5.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-standard": "^5.0.0",
"@vitest/eslint-plugin": "^1.6.16",
"eslint": "^10.3.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import-lite": "~0.6.0",
"eslint-plugin-n": "^17.24.0",
"prettier": "^3.7.4",
"typescript": "^5.8.3",
"typescript": "^6.0.3",
"typescript-eslint": "^8.59.1",
"vitest": "^4.1.5"
},
"preconstruct": {
Expand Down
13 changes: 9 additions & 4 deletions packages/apply-release-plan/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { describe, expect, it, test } from "vitest";
import {
import type {
ComprehensiveRelease,
Config,
NewChangeset,
Expand All @@ -18,7 +17,7 @@
import applyReleasePlan from "./index.ts";
import { getPackages } from "@manypkg/get-packages";
import {
Fixture,
type Fixture,
outputFile,
temporarilySilenceLogs,
testdir,
Expand Down Expand Up @@ -86,7 +85,7 @@
fixture: Fixture,
releasePlan: ReleasePlan,
config?: Config,
snapshot?: string | undefined,
snapshot?: string,
setupFunc?: (tempDir: string) => Promise<unknown>,
) {
if (!config) {
Expand Down Expand Up @@ -2889,7 +2888,7 @@
describe("should error and not write if", () => {
// This is skipped as *for now* we are assuming we have been passed
// valid releasePlans - this may get work done on it in the future
it.skip("a package appears twice", async () => {

Check warning on line 2891 in packages/apply-release-plan/src/index.test.ts

View workflow job for this annotation

GitHub Actions / Lint

Disabled test - if you want to skip a test temporarily, use .todo() instead
let changedFiles;
try {
let testResults = await testSetup(
Expand Down Expand Up @@ -2933,6 +2932,7 @@
);
changedFiles = testResults.changedFiles;
} catch (e) {
// eslint-disable-next-line vitest/no-conditional-expect
expect((e as Error).message).toEqual("some string probably");

return;
Expand Down Expand Up @@ -2991,6 +2991,7 @@
releasePlan.config,
);
} catch (e) {
// eslint-disable-next-line vitest/no-conditional-expect
expect((e as Error).message).toEqual(
"Could not find matching package for release of: impossible-package",
);
Expand All @@ -2999,6 +3000,7 @@
nodeOptions: { cwd: tempDir },
});

// eslint-disable-next-line vitest/no-conditional-expect
expect(gitCmd.stdout.toString().includes("nothing to commit")).toEqual(
true,
);
Expand Down Expand Up @@ -3051,15 +3053,18 @@
],
});
} catch (e) {
// eslint-disable-next-line vitest/no-conditional-expect
expect((e as Error).message).toEqual("no chance");

let gitCmd = await exec("git", ["status"], {
nodeOptions: { cwd: tempDir },
});

// eslint-disable-next-line vitest/no-conditional-expect
expect(
gitCmd.stdout.toString().includes("nothing to commit"),
).toEqual(true);
// eslint-disable-next-line vitest/no-conditional-expect
expect((console.error as any).mock.calls).toMatchInlineSnapshot(`
[
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// We are doing it here to avoide adding a circular dependency and as this is only used in testing.
// This is wicked, and please don't copy us.
// eslint-disable-next-line import/no-extraneous-dependencies
export { default } from "@changesets/cli/changelog";
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// We are doing it here to avoide adding a circular dependency and as this is only used in testing.
// This is wicked, and please don't copy us.
// eslint-disable-next-line import/no-extraneous-dependencies
export { default } from "@changesets/cli/commit";
1 change: 0 additions & 1 deletion packages/assemble-release-plan/src/increment.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { describe, expect, it } from "vitest";
import { incrementVersion } from "./increment.ts";
import type { InternalRelease, PreInfo } from "./types.ts";
Expand Down
1 change: 0 additions & 1 deletion packages/assemble-release-plan/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { beforeEach, describe, expect, it } from "vitest";
import { defaultConfig } from "@changesets/config";
import assembleReleasePlan from "./index.ts";
Expand Down
4 changes: 2 additions & 2 deletions packages/assemble-release-plan/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function getCurrentHighestVersion(
return highestVersion!;
}

export function mapGetOrThrow<V extends {}>(
export function mapGetOrThrow<V>(
map: Map<string, V>,
key: string,
errorMessage: string,
Expand All @@ -68,7 +68,7 @@ export function mapGetOrThrow<V extends {}>(
return value;
}

export function mapGetOrThrowInternal<V extends {}>(
export function mapGetOrThrowInternal<V>(
map: Map<string, V>,
key: string,
errorMessage: string,
Expand Down
1 change: 1 addition & 0 deletions packages/changelog-git/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {

const getReleaseLine = async (
changeset: NewChangesetWithCommit,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_type: VersionType,
) => {
const [firstLine, ...futureLines] = changeset.summary
Expand Down
2 changes: 2 additions & 0 deletions packages/changelog-github/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ vi.mock(
commit: `[\`${data.commit}\`](https://github.com/${data.repo}/commit/${data.commit})`,
};
return {
/* eslint-disable vitest/no-standalone-expect */
async getInfo({ commit, repo }) {
expect(commit).toBe(data.commit);
expect(repo).toBe(data.repo);
Expand All @@ -37,6 +38,7 @@ vi.mock(
links,
};
},
/* eslint-enable vitest/no-standalone-expect */
};
},
);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/add/createChangeset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export default async function createChangeset(
releases,
};
}
} catch (err) {
} catch {
log(
"An error happened using external editor. Please type your summary here:",
);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default async function add(
const packages = await getPackages(cwd);
if (packages.packages.length === 0) {
error(
`No packages found. You might have ${packages.tool} workspaces configured but no packages yet?`,
`No packages found. You might have ${packages.tool.type} workspaces configured but no packages yet?`,
);
throw new ExitError(1);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/publish/npm-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function getPublishTool(
shouldAddNoGitChecks:
parsed?.major === undefined ? false : parsed.major >= 5,
};
} catch (e) {
} catch {
return {
name: "pnpm",
shouldAddNoGitChecks: false,
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/commands/publish/publishPackages.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { info, warn } from "@changesets/logger";
import type { AccessType, PreState } from "@changesets/types";
import type { Package } from "@changesets/types";
import type { AccessType, PreState, Package } from "@changesets/types";
import { resolve } from "path";
import pc from "picocolors";
import semverParse from "semver/functions/parse.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/version/version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ describe("running version in a simple project", () => {
});
});

it("should not touch package.json of an ignored package when it is not a dependent of any releasedPackages ", async () => {
it("should not touch package.json of an ignored package when it is not a dependent of any releasedPackages", async () => {
const cwd = await testdir({
"package.json": JSON.stringify({
private: true,
Expand Down
Loading
Loading