Skip to content

Commit 8c74729

Browse files
build: migrate to create-typescript-app@1 (#272)
## PR Checklist - [x] Addresses an existing open issue: fixes #95; fixes #270 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/ts-api-utils/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/ts-api-utils/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Looks like this also improves reported unit test coverage? Hooray!
1 parent ed6e6c1 commit 8c74729

84 files changed

Lines changed: 2450 additions & 2427 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.all-contributorsrc

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"badgeTemplate": "<img alt=\"All Contributors: <%= contributors.length %>\" src=\"https://img.shields.io/badge/all_contributors-<%= contributors.length %>-21bb42.svg\" />",
2+
"badgeTemplate": "<img alt=\"All Contributors: <%= contributors.length %> 👪\" src=\"https://img.shields.io/badge/all_contributors-<%= contributors.length %>_👪-21bb42.svg\" />",
33
"commit": false,
44
"commitConvention": "angular",
55
"contributors": [
@@ -11,7 +11,8 @@
1111
"doc",
1212
"projectManagement",
1313
"test",
14-
"tool"
14+
"tool",
15+
"maintenance"
1516
],
1617
"login": "JoshuaKGoldberg",
1718
"name": "Josh Goldberg",
@@ -28,7 +29,9 @@
2829
"doc",
2930
"projectManagement",
3031
"test",
31-
"tool"
32+
"tool",
33+
"infra",
34+
"maintenance"
3235
]
3336
},
3437
{
@@ -47,11 +50,22 @@
4750
"avatar_url": "https://avatars.githubusercontent.com/u/110151013?v=4",
4851
"profile": "https://blog.jmchor.dev",
4952
"contributions": [
50-
"doc"
53+
"doc",
54+
"code"
55+
]
56+
},
57+
{
58+
"login": "kirjs",
59+
"name": "Kirill Cherkashin",
60+
"avatar_url": "https://avatars.githubusercontent.com/u/2545357?v=4",
61+
"profile": "https://twitter.com/kirjs",
62+
"contributions": [
63+
"code"
5164
]
5265
}
5366
],
5467
"contributorsPerLine": 7,
68+
"contributorsSortAlphabetically": true,
5569
"files": [
5670
"README.md"
5771
],

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
!.*
12
coverage
23
docs
34
lib
5+
node_modules
6+
pnpm-lock.yaml

.eslintrc.cjs

Lines changed: 90 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import("@types/eslint").Linter.Config} */
12
module.exports = {
23
env: {
34
es2022: true,
@@ -6,142 +7,161 @@ module.exports = {
67
extends: [
78
"eslint:recommended",
89
"plugin:eslint-comments/recommended",
9-
"plugin:jsdoc/recommended-error",
10+
"plugin:n/recommended",
11+
"plugin:perfectionist/recommended-natural",
1012
"plugin:regexp/recommended",
11-
"prettier",
13+
"plugin:vitest/recommended",
1214
],
1315
overrides: [
1416
{
1517
extends: ["plugin:markdown/recommended"],
16-
files: ["**/*.{md}"],
18+
files: ["**/*.md"],
1719
processor: "markdown/markdown",
1820
},
1921
{
2022
extends: [
21-
"plugin:typescript-sort-keys/recommended",
22-
"plugin:@typescript-eslint/recommended-type-checked",
23+
"plugin:jsdoc/recommended-typescript-error",
24+
"plugin:@typescript-eslint/strict",
25+
"plugin:@typescript-eslint/stylistic",
26+
],
27+
files: ["**/*.ts"],
28+
parser: "@typescript-eslint/parser",
29+
rules: {
30+
// These rules have configurations specific to this repo and we like them on.
31+
"jsdoc/check-tag-names": [
32+
"error",
33+
{
34+
definedTags: ["category"],
35+
},
36+
],
37+
38+
// These off-by-default rules work well for this repo and we like them on.
39+
"jsdoc/informative-docs": "error",
40+
"logical-assignment-operators": [
41+
"error",
42+
"always",
43+
{ enforceForIfStatements: true },
44+
],
45+
"operator-assignment": "error",
46+
47+
// These on-by-default rules don't work well for this repo and we like them off.
48+
"jsdoc/require-jsdoc": "off",
49+
"jsdoc/require-param": "off",
50+
"jsdoc/require-property": "off",
51+
"jsdoc/require-returns": "off",
52+
},
53+
},
54+
{
55+
excludedFiles: ["**/*.md/*.ts"],
56+
extends: [
2357
"plugin:@typescript-eslint/strict-type-checked",
58+
"plugin:@typescript-eslint/stylistic-type-checked",
2459
],
25-
files: ["**/*.{ts,tsx}"],
60+
files: ["**/*.ts"],
61+
parser: "@typescript-eslint/parser",
2662
parserOptions: {
2763
project: "./tsconfig.eslint.json",
2864
},
2965
rules: {
3066
// These off-by-default rules work well for this repo and we like them on.
31-
"deprecation/deprecation": "error",
3267
"@typescript-eslint/explicit-module-boundary-types": "error",
68+
"deprecation/deprecation": "error",
3369

3470
// TODO?
35-
"@typescript-eslint/prefer-literal-enum-member": "off",
3671
"@typescript-eslint/no-confusing-void-expression": "off",
3772
"@typescript-eslint/no-non-null-assertion": "off",
3873
"@typescript-eslint/no-unnecessary-condition": "off",
3974
"@typescript-eslint/no-unsafe-enum-comparison": "off",
75+
"@typescript-eslint/prefer-literal-enum-member": "off",
76+
"@typescript-eslint/prefer-nullish-coalescing": "off",
4077
"no-constant-condition": "off",
4178
},
4279
},
4380
{
44-
files: "*.json",
4581
excludedFiles: ["package.json"],
82+
extends: ["plugin:jsonc/recommended-with-json"],
83+
files: ["*.json", "*.jsonc"],
4684
parser: "jsonc-eslint-parser",
4785
rules: {
4886
"jsonc/sort-keys": "error",
4987
},
50-
extends: ["plugin:jsonc/recommended-with-json"],
88+
},
89+
{
90+
files: ["*.jsonc"],
91+
rules: {
92+
"jsonc/no-comments": "off",
93+
},
5194
},
5295
{
5396
files: "**/*.test.ts",
5497
rules: {
98+
// These on-by-default rules aren't useful in test files.
5599
"@typescript-eslint/no-unsafe-assignment": "off",
56100
"@typescript-eslint/no-unsafe-call": "off",
57101
},
58102
},
103+
{
104+
extends: ["plugin:yml/standard", "plugin:yml/prettier"],
105+
files: ["**/*.{yml,yaml}"],
106+
parser: "yaml-eslint-parser",
107+
rules: {
108+
"yml/file-extension": ["error", { extension: "yml" }],
109+
"yml/sort-keys": [
110+
"error",
111+
{
112+
order: { type: "asc" },
113+
pathPattern: "^.*$",
114+
},
115+
],
116+
"yml/sort-sequence-values": [
117+
"error",
118+
{
119+
order: { type: "asc" },
120+
pathPattern: "^.*$",
121+
},
122+
],
123+
},
124+
},
59125
],
60126
parser: "@typescript-eslint/parser",
61127
plugins: [
62128
"@typescript-eslint",
63129
"deprecation",
64-
"import",
65130
"jsdoc",
66131
"no-only-tests",
132+
"perfectionist",
67133
"regexp",
68-
"simple-import-sort",
69-
"typescript-sort-keys",
70-
"unicorn",
71134
"vitest",
72135
],
136+
reportUnusedDisableDirectives: true,
73137
root: true,
74138
rules: {
75-
// These off-by-default rules work well for this repo and we like them on.
139+
// These off/less-strict-by-default rules work well for this repo and we like them on.
76140
"@typescript-eslint/no-unused-vars": [
77141
"error",
78142
{ argsIgnorePattern: "^_", caughtErrors: "all" },
79143
],
80-
"import/extensions": ["error"],
81-
"import/no-useless-path-segments": [
82-
"error",
83-
{
84-
noUselessIndex: true,
85-
},
86-
],
87144
"no-only-tests/no-only-tests": "error",
88-
"simple-import-sort/exports": "error",
89-
"simple-import-sort/imports": "error",
90-
"unicorn/import-style": [
91-
"error",
92-
{
93-
extendDefaultStyles: false,
94-
styles: {
95-
typescript: {
96-
default: true,
97-
},
98-
},
99-
},
100-
],
101145

102146
// These on-by-default rules don't work well for this repo and we like them off.
147+
"n/no-missing-import": "off",
148+
"no-case-declarations": "off",
149+
"no-constant-condition": "off",
103150
"no-inner-declarations": "off",
151+
"no-mixed-spaces-and-tabs": "off",
104152

105-
// JSDoc rules
106-
"jsdoc/check-indentation": "error",
107-
"jsdoc/check-line-alignment": "error",
108-
"jsdoc/check-tag-names": [
153+
// Stylistic concerns that don't interfere with Prettier
154+
"@typescript-eslint/padding-line-between-statements": [
109155
"error",
110-
{
111-
definedTags: ["category"],
112-
},
156+
{ blankLine: "always", next: "*", prev: "block-like" },
113157
],
114-
"jsdoc/no-bad-blocks": "error",
115-
"jsdoc/no-defaults": "error",
116-
"jsdoc/require-asterisk-prefix": "error",
117-
"jsdoc/require-description": "error",
118-
"jsdoc/require-hyphen-before-param-description": "error",
119-
"jsdoc/require-throws": "error",
120-
"jsdoc/tag-lines": [
158+
"perfectionist/sort-objects": [
121159
"error",
122-
"never",
123160
{
124-
endLines: 0,
125-
startLines: 1,
126-
tags: {
127-
example: { lines: "never" },
128-
},
161+
order: "asc",
162+
"partition-by-comment": true,
163+
type: "natural",
129164
},
130165
],
131-
"jsdoc/require-jsdoc": "off",
132-
"jsdoc/require-param": "off",
133-
"jsdoc/require-property": "off",
134-
"jsdoc/require-returns": "off",
135-
// Todo: pending a "recommended-typescript" config in eslint-plugin-jsdoc
136-
// https://github.com/gajus/eslint-plugin-jsdoc/issues/615#issuecomment-1338669655
137-
"jsdoc/no-types": "error",
138-
"jsdoc/require-param-type": "off",
139-
"jsdoc/require-property-type": "off",
140-
"jsdoc/require-returns-type": "off",
141-
},
142-
settings: {
143-
jsdoc: {
144-
ignoreInternal: true,
145-
},
146166
},
147167
};

.github/CONTRIBUTING.md

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Thanks for your interest in contributing to `ts-api-utils`! 💖
44

5-
> See [DEVELOPMENT.md](./DEVELOPMENT.md) for local development instructions.
5+
> After this page, see [DEVELOPMENT.md](./DEVELOPMENT.md) for local development instructions.
66
77
## Code of Conduct
88

@@ -22,20 +22,76 @@ There are two steps involved:
2222

2323
### Finding an Issue
2424

25-
With the exception of very small typos, all changes to this repository generally need to correspond to an [open issue marked as `accepting prs` on the issue tracker](https://github.com/JoshuaKGoldberg/ts-api-utils/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22).
26-
If this is your first time contributing, consider searching for [unassigned issues that also have the `good first issue` label](https://github.com/JoshuaKGoldberg/ts-api-utils/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22+label%3A%22good+first+issue%22+no%3Aassignee).
25+
With the exception of very small typos, all changes to this repository generally need to correspond to an [unassigned open issue marked as `status: accepting prs` on the issue tracker](https://github.com/JoshuaKGoldberg/ts-api-utils/issues?q=is%3Aissue+is%3Aopen+label%3A%22status%3A+accepting+prs%22+no%3Aassignee+).
26+
If this is your first time contributing, consider searching for [unassigned issues that also have the `good first issue` label](https://github.com/JoshuaKGoldberg/ts-api-utils/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3A%22status%3A+accepting+prs%22+no%3Aassignee+).
2727
If the issue you'd like to fix isn't found on the issue, see [Reporting Issues](#reporting-issues) for filing your own (please do!).
2828

29+
#### Issue Claiming
30+
31+
We don't use any kind of issue claiming system.
32+
We've found in the past that they result in accidental ["licked cookie"](https://devblogs.microsoft.com/oldnewthing/20091201-00/?p=15843) situations where contributors claim an issue but run out of time or energy trying before sending a PR.
33+
34+
If an unassigned issue has been marked as `status: accepting prs` and an open PR does not exist, feel free to send a PR.
35+
Please don't post comments asking for permission or stating you will work on an issue.
36+
2937
### Sending a Pull Request
3038

3139
Once you've identified an open issue accepting PRs that doesn't yet have a PR sent, you're free to send a pull request.
3240
Be sure to fill out the pull request template's requested information -- otherwise your PR will likely be closed.
3341

34-
PRs are also expected to have a title that adheres to [commitlint](https://github.com/conventional-changelog/commitlint).
42+
PRs are also expected to have a title that adheres to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0).
3543
Only PR titles need to be in that format, not individual commits.
3644
Don't worry if you get this wrong: you can always change the PR title after sending it.
3745
Check [previously merged PRs](https://github.com/JoshuaKGoldberg/ts-api-utils/pulls?q=is%3Apr+is%3Amerged+-label%3Adependencies+) for reference.
3846

47+
#### Draft PRs
48+
49+
If you don't think your PR is ready for review, [set it as a draft](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#converting-a-pull-request-to-a-draft).
50+
Draft PRs won't be reviewed.
51+
52+
#### Granular PRs
53+
54+
Please keep pull requests single-purpose: in other words, don't attempt to solve multiple unrelated problems in one pull request.
55+
Send one PR per area of concern.
56+
Multi-purpose pull requests are harder and slower to review, block all changes from being merged until the whole pull request is reviewed, and are difficult to name well with semantic PR titles.
57+
58+
#### Pull Request Reviews
59+
60+
When a PR is not in draft, it's considered ready for review.
61+
Please don't manually `@` tag anybody to request review.
62+
A maintainer will look at it when they're next able to.
63+
64+
PRs should have passing [GitHub status checks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks) before review is requested (unless there are explicit questions asked in the PR about any failures).
65+
66+
#### Asking Questions
67+
68+
If you need help and/or have a question, posting a comment in the PR is a great way to do so.
69+
There's no need to tag anybody individually.
70+
One of us will drop by and help when we can.
71+
72+
Please post comments as [line comments](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request) when possible, so that they can be threaded.
73+
You can [resolve conversations](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request#resolving-conversations) on your own when you feel they're resolved - no need to comment explicitly and/or wait for a maintainer.
74+
75+
#### Requested Changes
76+
77+
After a maintainer reviews your PR, they may request changes on it.
78+
Once you've made those changes, [re-request review on GitHub](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews#re-requesting-a-review).
79+
3980
Please try not to force-push commits to PRs that have already been reviewed.
4081
Doing so makes it harder to review the changes.
4182
We squash merge all commits so there's no need to try to preserve Git history within a PR branch.
83+
84+
Once you've addressed all our feedback by making code changes and/or started a followup discussion, [re-request review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews#re-requesting-a-review) from each maintainer whose feedback you addressed.
85+
86+
Once all feedback is addressed and the PR is approved, we'll ensure the branch is up to date with `main` and merge it for you.
87+
88+
#### Post-Merge Recognition
89+
90+
Once your PR is merged, if you haven't yet been added to the [_Contributors_ table in the README.md](../README.md#contributors) for its [type of contribution](https://allcontributors.org/docs/en/emoji-key "Allcontributors emoji key"), you should be soon.
91+
Please do ping the maintainer who merged your PR if that doesn't happen within 24 hours - it was likely an oversight on our end!
92+
93+
## Emojis & Appreciation
94+
95+
If you made it all the way to the end, bravo dear user, we love you.
96+
Please include your favorite emoji in the bottom of your issues and PRs to signal to us that you did in fact read this file and are trying to conform to it as best as possible.
97+
💖 is a good starter if you're not sure which to use.

0 commit comments

Comments
 (0)