Skip to content

Commit

Permalink
build: onboard to create-typescript-app (#209)
Browse files Browse the repository at this point in the history
## PR Checklist

- [x] Addresses an existing open issue: fixes #43; fixes #200
- [x] That issue was marked as [accepting
prs](https://github.com/JoshuaKGoldberg/console-fail-test/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22)
- [x] Steps in
[CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/console-fail-test/blob/main/.github/CONTRIBUTING.md)
were taken

## Overview

Runs
[`create-typescript-app`](http://github.com/JoshuaKGoldberg/create-typescript-app)'s
hydration logic on this repo to bring in all the tooling goodness from
that repo.
  • Loading branch information
JoshuaKGoldberg committed Nov 12, 2023
1 parent ca28afb commit acfe3df
Show file tree
Hide file tree
Showing 95 changed files with 9,096 additions and 4,054 deletions.
43 changes: 43 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"badgeTemplate": "<img alt=\"All Contributors: <%= contributors.length %> 👪\" src=\"https://img.shields.io/badge/all_contributors-<%= contributors.length %>_👪-21bb42.svg\" />",
"commit": false,
"commitConvention": "angular",
"contributors": [
{
"avatar_url": "https://avatars.githubusercontent.com/u/3335181?v=4",
"contributions": ["tool", "code", "maintenance"],
"login": "JoshuaKGoldberg",
"name": "Josh Goldberg",
"profile": "http://www.joshuakgoldberg.com"
},
{
"login": "kopax-polyconseil",
"name": "Dimitri Kopriwa",
"avatar_url": "https://avatars.githubusercontent.com/u/77674046?v=4",
"profile": "https://www.kop.ax/",
"contributions": ["code"]
},
{
"login": "mackenco",
"name": "Colin MacKenzie",
"avatar_url": "https://avatars.githubusercontent.com/u/4284340?v=4",
"profile": "https://github.com/mackenco",
"contributions": ["code"]
},
{
"login": "sosukesuzuki",
"name": "SUZUKI Sosuke",
"avatar_url": "https://avatars.githubusercontent.com/u/14838850?v=4",
"profile": "https://github.com/sosukesuzuki",
"contributions": ["code"]
}
],
"contributorsPerLine": 7,
"contributorsSortAlphabetically": true,
"files": ["README.md"],
"imageSize": 100,
"projectName": "console-fail-test",
"projectOwner": "JoshuaKGoldberg",
"repoHost": "https://github.com",
"repoType": "github"
}
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
!.*
coverage
lib
node_modules
pnpm-lock.yaml
183 changes: 183 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
/** @type {import("@types/eslint").Linter.Config} */
module.exports = {
env: {
es2022: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:n/recommended",
"plugin:perfectionist/recommended-natural",
"plugin:regexp/recommended",
"plugin:vitest/recommended",
],
overrides: [
{
extends: ["plugin:markdown/recommended"],
files: ["**/*.md"],
processor: "markdown/markdown",
},
{
extends: [
"plugin:jsdoc/recommended-typescript-error",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/stylistic",
],
files: ["**/*.ts"],
parser: "@typescript-eslint/parser",
rules: {
// These off-by-default rules work well for this repo and we like them on.
"jsdoc/informative-docs": "error",
"logical-assignment-operators": [
"error",
"always",
{ enforceForIfStatements: true },
],
"operator-assignment": "error",

// These on-by-default rules don't work well for this repo and we like them off.
"jsdoc/require-jsdoc": "off",
"jsdoc/require-param": "off",
"jsdoc/require-property": "off",
"jsdoc/require-returns": "off",
},
},
{
files: "**/*.md/*.*s",
rules: {
"n/no-missing-import": [
"error",
{ allowModules: ["console-fail-test", "vitest"] },
],
"n/no-missing-require": [
"error",
{
allowModules: [
"@hapi/lab",
"ava",
"console-fail-test",
"sinon",
"tap",
],
},
],
},
},
{
excludedFiles: ["**/*.md/*.ts"],
extends: [
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
],
files: ["**/*.ts"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.eslint.json",
},
rules: {
// These off-by-default rules work well for this repo and we like them on.
"deprecation/deprecation": "error",

// TODO
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-confusing-void-expression": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-redundant-type-constituents": "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/restrict-template-expressions": "off",
"@typescript-eslint/unbound-method": "off",
},
},
{
excludedFiles: ["package.json"],
extends: ["plugin:jsonc/recommended-with-json"],
files: ["*.json", "*.jsonc"],
parser: "jsonc-eslint-parser",
rules: {
"jsonc/sort-keys": "error",
},
},
{
files: ["*.jsonc"],
rules: {
"jsonc/no-comments": "off",
},
},
{
files: "**/*.test.ts",
rules: {
// These on-by-default rules aren't useful in test files.
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
},
},
{
extends: ["plugin:yml/standard", "plugin:yml/prettier"],
files: ["**/*.{yml,yaml}"],
parser: "yaml-eslint-parser",
rules: {
"yml/file-extension": ["error", { extension: "yml" }],
"yml/sort-keys": [
"error",
{
order: { type: "asc" },
pathPattern: "^.*$",
},
],
"yml/sort-sequence-values": [
"error",
{
order: { type: "asc" },
pathPattern: "^.*$",
},
],
},
},
],
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
"deprecation",
"jsdoc",
"no-only-tests",
"perfectionist",
"regexp",
"vitest",
],
reportUnusedDisableDirectives: true,
root: true,
rules: {
// These off/less-strict-by-default rules work well for this repo and we like them on.
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],
"no-only-tests/no-only-tests": "error",

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

// Stylistic concerns that don't interfere with Prettier
"@typescript-eslint/padding-line-between-statements": [
"error",
{ blankLine: "always", next: "*", prev: "block-like" },
],
"no-useless-rename": "error",
"object-shorthand": "error",
"perfectionist/sort-objects": [
"error",
{
order: "asc",
"partition-by-comment": true,
type: "natural",
},
],
},
};
26 changes: 0 additions & 26 deletions .eslintrc.js

This file was deleted.

75 changes: 62 additions & 13 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,15 @@

Thanks for your interest in contributing to `console-fail-test`! 💖

> After this page, see [DEVELOPMENT.md](./DEVELOPMENT.md) for local development instructions.
## Code of Conduct

This project contains a [Contributor Covenant code of conduct](./CODE_OF_CONDUCT.md) all contributors are expected to follow.

## Getting Started

```shell
git clone https://github.com/your-username/console-fail-test
cd console-fail-test
yarn
```

## Reporting Issues

Please do [report an issue on the issue tracker](https://github.com/JoshuaKGoldberg/console-fail-test/issues/new/choose) if there's any bugfix, documentation improvement, or general enhancement you'd like to see in the repository!
Please fully fill out all required fields in the most appropriate issue form.
Please do [report an issue on the issue tracker](https://github.com/JoshuaKGoldberg/console-fail-test/issues/new/choose) if there's any bugfix, documentation improvement, or general enhancement you'd like to see in the repository! Please fully fill out all required fields in the most appropriate issue form.

## Sending Contributions

Expand All @@ -29,20 +22,76 @@ There are two steps involved:

### Finding an Issue

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/console-fail-test/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22).
If this is your first time contributing, consider searching for [issues that also have the `good first issue` label](https://github.com/JoshuaKGoldberg/console-fail-test/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22+label%3A%22good+first+issue%22).
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/console-fail-test/issues?q=is%3Aissue+is%3Aopen+label%3A%22status%3A+accepting+prs%22+no%3Aassignee+).
If this is your first time contributing, consider searching for [unassigned issues that also have the `good first issue` label](https://github.com/JoshuaKGoldberg/console-fail-test/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3A%22status%3A+accepting+prs%22+no%3Aassignee+).
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!).

#### Issue Claiming

We don't use any kind of issue claiming system.
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.

If an unassigned issue has been marked as `status: accepting prs` and an open PR does not exist, feel free to send a PR.
Please don't post comments asking for permission or stating you will work on an issue.

### Sending a Pull Request

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.
Be sure to fill out the pull request template's requested information -- otherwise your PR will likely be closed.

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

#### Draft PRs

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).
Draft PRs won't be reviewed.

#### Granular PRs

Please keep pull requests single-purpose: in other words, don't attempt to solve multiple unrelated problems in one pull request.
Send one PR per area of concern.
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.

#### Pull Request Reviews

When a PR is not in draft, it's considered ready for review.
Please don't manually `@` tag anybody to request review.
A maintainer will look at it when they're next able to.

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).

#### Asking Questions

If you need help and/or have a question, posting a comment in the PR is a great way to do so.
There's no need to tag anybody individually.
One of us will drop by and help when we can.

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.
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.

#### Requested Changes

After a maintainer reviews your PR, they may request changes on it.
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).

Please try not to force-push commits to PRs that have already been reviewed.
Doing so makes it harder to review the changes.
We squash merge all commits so there's no need to try to preserve Git history within a PR branch.

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.

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.

#### Post-Merge Recognition

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.
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!

## Emojis & Appreciation

If you made it all the way to the end, bravo dear user, we love you.
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.
💖 is a good starter if you're not sure which to use.
Loading

0 comments on commit acfe3df

Please sign in to comment.