generated from JoshuaKGoldberg/create-typescript-app
-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
chore: update knip config #40
Merged
RebeccaStevens
merged 10 commits into
JoshuaKGoldberg:main
from
RebeccaStevens:knip-config
Feb 17, 2023
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0df82fb
chore: use a more complete list of entry and project files
RebeccaStevens 2364f6c
Merge branch 'main' into knip-config
RebeccaStevens 0f824f4
chore: include all index files as entry points
RebeccaStevens 375b321
chore: ignore test dir as well as test files when not in production mode
RebeccaStevens 6d13f48
ci: run knip in both production and development mode
RebeccaStevens 8c1965e
Merge branch 'main' into knip-config
RebeccaStevens 33373f7
chore: fix knip config globs by using different config files per mode
RebeccaStevens 555e4f0
ci: split knip into 2 workflows
RebeccaStevens 653a0a4
Merge branch 'main' into knip-config
RebeccaStevens 418eae9
chore: use --config over -c
RebeccaStevens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Lint Knip (Production) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
knip: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/prepare | ||
- run: pnpm lint:knip:production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Lint Knip | ||
name: Lint Knip (Development) | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
{ | ||
"$schema": "https://unpkg.com/knip@next/schema.json", | ||
"entry": "src/index.ts!", | ||
"project": "src/**/*.ts!", | ||
// TODO: /~https://github.com/JoshuaKGoldberg/ts-api-utils/issues/45 | ||
"ignore": ["src/nodes/typeGuards/!(*.test).ts"] | ||
"entry": ["src/**/index.ts", "src/**/*.test.ts"], | ||
"project": ["src/**/*.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"$schema": "https://unpkg.com/knip@next/schema.json", | ||
"entry": ["src/**/index.ts!"], | ||
"project": ["src/**/*.ts!", "!src/test/**/*.ts!", "!src/**/*.test.ts!"] | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@webpro It doesn't seem to currently be possible to use a single config file for our use case.
Essentially, we want this config, but with the comment addressed.
When using config that runs logic (e.g.
knip.ts
), it would be great if we could access aisProduction
variable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply, but somehow today this popped up in the back of my mind. Any chance you could give it a shot with the latest Knip v1? I think you don't need any configuration anymore for either dev or production mode :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah scratch that, it's almost true, you would still need to add
**/index.ts
as entry files (as that is fixed only in v2).