Skip to content

chore: upgrade knip & config #1898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 17, 2025
Merged
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: 2 additions & 2 deletions knip.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://unpkg.com/knip@5.41.1/schema.json",
"$schema": "https://unpkg.com/knip@5.42.2/schema.json",
"entry": ["script/*e2e.js", "src/index.ts", "src/**/*.test.*"],
"ignoreDependencies": ["all-contributors-cli", "cspell-populate-words"],
"ignoreDependencies": ["cspell-populate-words", "remove-dependencies"],
"ignoreExportsUsedInFile": { "interface": true, "type": true },
"project": ["src/**/*.ts", "script/**/*.js"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@
"eslint-plugin-yml": "1.16.0",
"globby": "14.0.2",
"husky": "9.1.7",
"knip": "5.41.1",
"knip": "5.42.2",
"lint-staged": "15.3.0",
"markdownlint": "0.37.2",
"markdownlint-cli": "0.43.0",
235 changes: 121 additions & 114 deletions pnpm-lock.yaml

Unchanged files with check annotations Beta

{ type: "deletion" },
{
parameters: {
// @ts-expect-error -- https://github.com/github/rest-api-description/issues/4405

Check failure on line 42 in src/next/blocks/blockRepositoryBranchRuleset.ts

GitHub Actions / Are The Types Wrong?

Unused '@ts-expect-error' directive.

Check failure on line 42 in src/next/blocks/blockRepositoryBranchRuleset.ts

GitHub Actions / Build

Unused '@ts-expect-error' directive.

Check failure on line 42 in src/next/blocks/blockRepositoryBranchRuleset.ts

GitHub Actions / Lint

Unused '@ts-expect-error' directive.

Check failure on line 42 in src/next/blocks/blockRepositoryBranchRuleset.ts

GitHub Actions / Test Creation Script

Unused '@ts-expect-error' directive.

Check failure on line 42 in src/next/blocks/blockRepositoryBranchRuleset.ts

GitHub Actions / Test Initialization Script

Unused '@ts-expect-error' directive.

Check failure on line 42 in src/next/blocks/blockRepositoryBranchRuleset.ts

GitHub Actions / Test Migration Script

Unused '@ts-expect-error' directive.

Check failure on line 42 in src/next/blocks/blockRepositoryBranchRuleset.ts

GitHub Actions / Type Check

Unused '@ts-expect-error' directive.
allowed_merge_methods: ["squash"],
dismiss_stale_reviews_on_push: false,
require_code_owner_review: false,
options: optionsBase,
});
expect(creation).toMatchInlineSnapshot(`

Check failure on line 17 in src/next/blocks/blockKnip.test.ts

GitHub Actions / Test

src/next/blocks/blockKnip.test.ts > blockKnip > without addons

Error: Snapshot `blockKnip > without addons 1` mismatched - Expected + Received @@ -31,19 +31,19 @@ }, { "addons": { "properties": { "devDependencies": { - "knip": "5.41.1", + "knip": "5.42.2", }, "scripts": { "lint:knip": "knip", }, }, }, "block": [Function], }, ], "files": { - "knip.json": "{"$schema":"https://unpkg.com/knip@5.41.1/schema.json","entry":["src/index.ts","src/**/*.test.*"],"ignoreExportsUsedInFile":{"interface":true,"type":true},"project":["src/**/*.ts"]}", + "knip.json": "{"$schema":"https://unpkg.com/knip@5.42.2/schema.json","entry":["src/index.ts","src/**/*.test.*"],"ignoreExportsUsedInFile":{"interface":true,"type":true},"project":["src/**/*.ts"]}", }, } ❯ src/next/blocks/blockKnip.test.ts:17:20
{
"addons": [
{
options: optionsBase,
});
expect(creation).toMatchInlineSnapshot(`

Check failure on line 78 in src/next/blocks/blockKnip.test.ts

GitHub Actions / Test

src/next/blocks/blockKnip.test.ts > blockKnip > with addons

Error: Snapshot `blockKnip > with addons 1` mismatched - Expected + Received @@ -31,19 +31,19 @@ }, { "addons": { "properties": { "devDependencies": { - "knip": "5.41.1", + "knip": "5.42.2", }, "scripts": { "lint:knip": "knip", }, }, }, "block": [Function], }, ], "files": { - "knip.json": "{"$schema":"https://unpkg.com/knip@5.41.1/schema.json","entry":["src/index.ts","src/**/*.test.*"],"ignoreDependencies":["abc","def"],"ignoreExportsUsedInFile":{"interface":true,"type":true},"project":["src/**/*.ts"]}", + "knip.json": "{"$schema":"https://unpkg.com/knip@5.42.2/schema.json","entry":["src/index.ts","src/**/*.test.*"],"ignoreDependencies":["abc","def"],"ignoreExportsUsedInFile":{"interface":true,"type":true},"project":["src/**/*.ts"]}", }, } ❯ src/next/blocks/blockKnip.test.ts:78:20
{
"addons": [
{
delete next[rootFile];
}
expect(next).toEqual(baseline);

Check failure on line 284 in src/steps/writing/creation/index.test.ts

GitHub Actions / Test

src/steps/writing/creation/index.test.ts > createStructure > base minimal > matches current and next

AssertionError: expected { …(3) } to deeply equal { …(3) } - Expected + Received Object { "eslint.config.js": "import comments from \"@eslint-community/eslint-plugin-eslint-comments/configs\"; import eslint from \"@eslint/js\"; import vitest from \"@vitest/eslint-plugin\"; import jsdoc from \"eslint-plugin-jsdoc\"; import jsonc from \"eslint-plugin-jsonc\"; import markdown from \"eslint-plugin-markdown\"; import n from \"eslint-plugin-n\"; import packageJson from \"eslint-plugin-package-json/configs/recommended\"; import perfectionist from \"eslint-plugin-perfectionist\"; import * as regexp from \"eslint-plugin-regexp\"; import yml from \"eslint-plugin-yml\"; import tseslint from \"typescript-eslint\"; export default tseslint.config( { ignores: [\"**/*.snap\", \"coverage\", \"lib\", \"node_modules\", \"pnpm-lock.yaml\"], }, { linterOptions: { reportUnusedDisableDirectives: \"error\" } }, eslint.configs.recommended, comments.recommended, jsdoc.configs[\"flat/contents-typescript-error\"], jsdoc.configs[\"flat/logical-typescript-error\"], jsdoc.configs[\"flat/stylistic-typescript-error\"], jsonc.configs[\"flat/recommended-with-json\"], markdown.configs.recommended, n.configs[\"flat/recommended\"], packageJson, perfectionist.configs[\"recommended-natural\"], regexp.configs[\"flat/recommended\"], { extends: [ tseslint.configs.strictTypeChecked, tseslint.configs.stylisticTypeChecked, ], files: [\"**/*.js\", \"**/*.ts\"], languageOptions: { parserOptions: { projectService: { allowDefaultProject: [\"*.config.*s\", \"bin/index.js\"], }, tsconfigRootDir: import.meta.dirname, }, }, rules: { // Stylistic concerns that don't interfere with Prettier \"logical-assignment-operators\": [ \"error\", \"always\", { enforceForIfStatements: true }, ], \"no-useless-rename\": \"error\", \"object-shorthand\": \"error\", \"operator-assignment\": \"error\", }, settings: { perfectionist: { partitionByComment: true, type: \"natural\" } }, }, - { - extends: [tseslint.configs.disableTypeChecked], - files: [\"**/*.md/*.ts\"], - rules: { - \"n/no-missing-import\": [\"error\", { allowModules: [\"test-repo\"] }], - }, - }, + { extends: [tseslint.configs.disableTypeChecked], files: [\"**/*.md/*.ts\"] }, { extends: [vitest.configs.recommended], files: [\"**/*.test.*\"], rules: { \"@typescript-eslint/no-unsafe-assignment\": \"off\" }, }, { extends: [yml.configs[\"flat/recommended\"], yml.configs[\"flat/prettier\"]], files: [\"**/*.{yml,yaml}\"], rules: { \"yml/file-extension\": [\"error\", { extension: \"yml\" }], \"yml/sort-keys\": [ \"error\", { order: { type: \"asc\" }, pathPattern: \"^.*$\" }, ], \"yml/sort-sequence-values\": [ \"error\", { order: { type: \"asc\" }, pathPattern: \"^.*$\" }, ], }, }, ); ", "knip.json": "{ \"$schema\": \"https://unpkg.com/knip@5.42.2/schema.json\", - \"entry\": [\"src/index.ts\"], + \"entry\": [\"src/index.ts\", \"src/**/*.test.*\"], \"ignoreExportsUsedInFile\": { \"interface\": true, \"type\": true }, \"project\": [\"src/**/*.ts\"] } ", "package.json": "{ \"name\": \"test-repo\", \"version\": \"2.0.0-beta.6\", \"description\": \"Test Description\", \"keywords\": [ \"test\", \"keywords\" ], \"repository\": { \"type\": \"git\", \"url\": \"git+https://github.com/Test Owner/test-repo.git\" }, \"license\": \"MIT\", \"author\": { \"name\": \"Test Author\", \"email\": \"npm@example.com\" }, \"type\": \"module\", \"main\": \"lib/index.js\", \"bin\": \"bin/index.js\", \"files\": [ \"LICENSE.md\", \"README.md\", \"bin/index.js\", \"lib/\", \"package.json\" ], \"scripts\": { \"build\": \"tsup\", \"format\": \"prettier .\", \"initialize\": \"pnpm build --no-dts && tsx bin/index.js --mode initialize

Check failure on line 284 in src/steps/writing/creation/index.test.ts

GitHub Actions / Test

src/steps/writing/creation/index.test.ts > createStructure > base common > matches current and next

AssertionError: expected { …(3) } to deeply equal { …(3) } - Expected + Received Object { "eslint.config.js": "import comments from \"@eslint-community/eslint-plugin-eslint-comments/configs\"; import eslint from \"@eslint/js\"; import vitest from \"@vitest/eslint-plugin\"; import jsdoc from \"eslint-plugin-jsdoc\"; import jsonc from \"eslint-plugin-jsonc\"; import markdown from \"eslint-plugin-markdown\"; import n from \"eslint-plugin-n\"; import packageJson from \"eslint-plugin-package-json/configs/recommended\"; import perfectionist from \"eslint-plugin-perfectionist\"; import * as regexp from \"eslint-plugin-regexp\"; import yml from \"eslint-plugin-yml\"; import tseslint from \"typescript-eslint\"; export default tseslint.config( { ignores: [\"**/*.snap\", \"coverage\", \"lib\", \"node_modules\", \"pnpm-lock.yaml\"], }, { linterOptions: { reportUnusedDisableDirectives: \"error\" } }, eslint.configs.recommended, comments.recommended, jsdoc.configs[\"flat/contents-typescript-error\"], jsdoc.configs[\"flat/logical-typescript-error\"], jsdoc.configs[\"flat/stylistic-typescript-error\"], jsonc.configs[\"flat/recommended-with-json\"], markdown.configs.recommended, n.configs[\"flat/recommended\"], packageJson, perfectionist.configs[\"recommended-natural\"], regexp.configs[\"flat/recommended\"], { extends: [ tseslint.configs.strictTypeChecked, tseslint.configs.stylisticTypeChecked, ], files: [\"**/*.js\", \"**/*.ts\"], languageOptions: { parserOptions: { projectService: { allowDefaultProject: [\"*.config.*s\", \"bin/index.js\"], }, tsconfigRootDir: import.meta.dirname, }, }, rules: { // Stylistic concerns that don't interfere with Prettier \"logical-assignment-operators\": [ \"error\", \"always\", { enforceForIfStatements: true }, ], \"no-useless-rename\": \"error\", \"object-shorthand\": \"error\", \"operator-assignment\": \"error\", }, settings: { perfectionist: { partitionByComment: true, type: \"natural\" } }, }, - { - extends: [tseslint.configs.disableTypeChecked], - files: [\"**/*.md/*.ts\"], - rules: { - \"n/no-missing-import\": [\"error\", { allowModules: [\"test-repo\"] }], - }, - }, + { extends: [tseslint.configs.disableTypeChecked], files: [\"**/*.md/*.ts\"] }, { extends: [vitest.configs.recommended], files: [\"**/*.test.*\"], rules: { \"@typescript-eslint/no-unsafe-assignment\": \"off\" }, }, { extends: [yml.configs[\"flat/recommended\"], yml.configs[\"flat/prettier\"]], files: [\"**/*.{yml,yaml}\"], rules: { \"yml/file-extension\": [\"error\", { extension: \"yml\" }], \"yml/sort-keys\": [ \"error\", { order: { type: \"asc\" }, pathPattern: \"^.*$\" }, ], \"yml/sort-sequence-values\": [ \"error\", { order: { type: \"asc\" }, pathPattern: \"^.*$\" }, ], }, }, ); ", "knip.json": "{ \"$schema\": \"https://unpkg.com/knip@5.42.2/schema.json\", - \"entry\": [\"src/index.ts\"], + \"entry\": [\"src/index.ts\", \"src/**/*.test.*\"], \"ignoreExportsUsedInFile\": { \"interface\": true, \"type\": true }, \"project\": [\"src/**/*.ts\"] } ", "package.json": "{ \"name\": \"test-repo\", \"version\": \"2.0.0-beta.6\", \"description\": \"Test Description\", \"keywords\": [ \"test\", \"keywords\" ], \"repository\": { \"type\": \"git\", \"url\": \"git+https://github.com/Test Owner/test-repo.git\" }, \"license\": \"MIT\", \"author\": { \"name\": \"Test Author\", \"email\": \"npm@example.com\" }, \"type\": \"module\", \"main\": \"lib/index.js\", \"bin\": \"bin/index.js\", \"files\": [ \"LICENSE.md\", \"README.md\", \"bin/index.js\", \"lib/\", \"package.json\" ], \"scripts\": { \"build\": \"tsup\", \"format\": \"prettier .\", \"initialize\": \"pnpm build --no-dts && tsx bin/index.js --mode initialize

Check failure on line 284 in src/steps/writing/creation/index.test.ts

GitHub Actions / Test

src/steps/writing/creation/index.test.ts > createStructure > base everything > matches current and next

AssertionError: expected { …(3) } to deeply equal { …(3) } - Expected + Received Object { "eslint.config.js": "import comments from \"@eslint-community/eslint-plugin-eslint-comments/configs\"; import eslint from \"@eslint/js\"; import vitest from \"@vitest/eslint-plugin\"; import jsdoc from \"eslint-plugin-jsdoc\"; import jsonc from \"eslint-plugin-jsonc\"; import markdown from \"eslint-plugin-markdown\"; import n from \"eslint-plugin-n\"; import packageJson from \"eslint-plugin-package-json/configs/recommended\"; import perfectionist from \"eslint-plugin-perfectionist\"; import * as regexp from \"eslint-plugin-regexp\"; import yml from \"eslint-plugin-yml\"; import tseslint from \"typescript-eslint\"; export default tseslint.config( { ignores: [\"**/*.snap\", \"coverage\", \"lib\", \"node_modules\", \"pnpm-lock.yaml\"], }, { linterOptions: { reportUnusedDisableDirectives: \"error\" } }, eslint.configs.recommended, comments.recommended, jsdoc.configs[\"flat/contents-typescript-error\"], jsdoc.configs[\"flat/logical-typescript-error\"], jsdoc.configs[\"flat/stylistic-typescript-error\"], jsonc.configs[\"flat/recommended-with-json\"], markdown.configs.recommended, n.configs[\"flat/recommended\"], packageJson, perfectionist.configs[\"recommended-natural\"], regexp.configs[\"flat/recommended\"], { extends: [ tseslint.configs.strictTypeChecked, tseslint.configs.stylisticTypeChecked, ], files: [\"**/*.js\", \"**/*.ts\"], languageOptions: { parserOptions: { projectService: { allowDefaultProject: [\"*.config.*s\", \"bin/index.js\"], }, tsconfigRootDir: import.meta.dirname, }, }, rules: { // Stylistic concerns that don't interfere with Prettier \"logical-assignment-operators\": [ \"error\", \"always\", { enforceForIfStatements: true }, ], \"no-useless-rename\": \"error\", \"object-shorthand\": \"error\", \"operator-assignment\": \"error\", }, settings: { perfectionist: { partitionByComment: true, type: \"natural\" } }, }, - { - extends: [tseslint.configs.disableTypeChecked], - files: [\"**/*.md/*.ts\"], - rules: { - \"n/no-missing-import\": [\"error\", { allowModules: [\"test-repo\"] }], - }, - }, + { extends: [tseslint.configs.disableTypeChecked], files: [\"**/*.md/*.ts\"] }, { extends: [vitest.configs.recommended], files: [\"**/*.test.*\"], rules: { \"@typescript-eslint/no-unsafe-assignment\": \"off\" }, }, { extends: [yml.configs[\"flat/recommended\"], yml.configs[\"flat/prettier\"]], files: [\"**/*.{yml,yaml}\"], rules: { \"yml/file-extension\": [\"error\", { extension: \"yml\" }], \"yml/sort-keys\": [ \"error\", { order: { type: \"asc\" }, pathPattern: \"^.*$\" }, ], \"yml/sort-sequence-values\": [ \"error\", { order: { type: \"asc\" }, pathPattern: \"^.*$\" }, ], }, }, ); ", "knip.json": "{ \"$schema\": \"https://unpkg.com/knip@5.42.2/schema.json\", - \"entry\": [\"src/index.ts\"], + \"entry\": [\"src/index.ts\", \"src/**/*.test.*\"], \"ignoreExportsUsedInFile\": { \"interface\": true, \"type\": true }, \"project\": [\"src/**/*.ts\"] } ", "package.json": "{ \"name\": \"test-repo\", \"version\": \"2.0.0-beta.6\", \"description\": \"Test Description\", \"keywords\": [ \"test\", \"keywords\" ], \"repository\": { \"type\": \"git\", \"url\": \"git+https://github.com/Test Owner/test-repo.git\" }, \"license\": \"MIT\", \"author\": { \"name\": \"Test Author\", \"email\": \"npm@example.com\" }, \"type\": \"module\", \"main\": \"lib/index.js\", \"bin\": \"bin/index.js\", \"files\": [ \"LICENSE.md\", \"README.md\", \"bin/index.js\", \"lib/\", \"package.json\" ], \"scripts\": { \"build\": \"tsup\", \"format\": \"prettier .\", \"initialize\": \"pnpm build --no-dts && tsx bin/index.js --mode initialize
});
});
});
{ type: "deletion" },
{
parameters: {
// @ts-expect-error -- https://github.com/github/rest-api-description/issues/4405

Check failure on line 35 in src/steps/initializeGitHubRepository/initializeBranchProtectionSettings.ts

GitHub Actions / Type Check

Unused '@ts-expect-error' directive.
allowed_merge_methods: ["squash"],
dismiss_stale_reviews_on_push: false,
require_code_owner_review: false,