Skip to content

Commit

Permalink
feat: onboard to create-typescript-app with pnpm support (#1435)
Browse files Browse the repository at this point in the history
## PR Checklist

-   [x] Addresses an existing issue: fixes #1318
- [x] That issue was marked as [`status: accepting
prs`](https://github.com/JoshuaKGoldberg/TypeStat/labels/status%3A%20accepting%20prs)

## Overview

In preparation for a full monorepo migration and rename (#1314), this
migrates as-is to `create-typescript-app`. That way I can get all these
rote changes (more linting, tabs, etc.) out of the way before making the
big jump to a monorepo & separate packages.

As part of this, adds a fix for pnpm's `node_modules/` symlink
resolution: 1e989a7

Replaces the `mz` runtime dependency with `node:fs` and
`node:fs/promises` uses.

💖
  • Loading branch information
JoshuaKGoldberg authored Mar 25, 2024
1 parent 5031b2e commit 16f76cf
Show file tree
Hide file tree
Showing 467 changed files with 20,765 additions and 17,423 deletions.
93 changes: 93 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"badgeTemplate": "\t<a href=\"#contributors\" target=\"_blank\"><img alt=\"👪 All Contributors: <%= contributors.length %>\" src=\"https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-<%= contributors.length %>-21bb42.svg\" /></a>",
"commit": false,
"commitConvention": "angular",
"commitType": "docs",
"contributors": [
{
"login": "beyang",
"name": "Beyang Liu",
"avatar_url": "https://avatars.githubusercontent.com/u/1646931?v=4",
"profile": "https://sourcegraph.com/",
"contributions": ["code"]
},
{
"login": "bitsnaps",
"name": "Ibrahim H.",
"avatar_url": "https://avatars.githubusercontent.com/u/1217741?v=4",
"profile": "https://stackoverflow.com/users/5494094/ibrahim-h",
"contributions": ["code"]
},
{
"login": "danstiner",
"name": "Daniel Stiner",
"avatar_url": "https://avatars.githubusercontent.com/u/52513?v=4",
"profile": "https://danstiner.me/",
"contributions": ["bug"]
},
{
"login": "emday4prez",
"name": "Emerson",
"avatar_url": "https://avatars.githubusercontent.com/u/35363144?v=4",
"profile": "https://github.com/emday4prez",
"contributions": ["code"]
},
{
"login": "ghost",
"name": "Deleted user",
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"profile": "https://github.com/ghost",
"contributions": ["maintenance"]
},
{
"login": "girishsontakke",
"name": "Girish Sontakke",
"avatar_url": "https://avatars.githubusercontent.com/u/61848210?v=4",
"profile": "https://girish.netlify.app/",
"contributions": ["code"]
},
{
"login": "gutenye",
"name": "Guten",
"avatar_url": "https://avatars.githubusercontent.com/u/377544?v=4",
"profile": "https://maps.guten.me/",
"contributions": ["bug"]
},
{
"login": "JoshuaKGoldberg",
"name": "Josh Goldberg ✨",
"avatar_url": "https://avatars.githubusercontent.com/u/3335181?v=4",
"profile": "http://www.joshuakgoldberg.com/",
"contributions": ["maintenance", "bug", "tool", "code", "infra", "doc"]
},
{
"login": "markjm",
"name": "Mark Molinaro",
"avatar_url": "https://avatars.githubusercontent.com/u/16494982?v=4",
"profile": "https://www.linkedin.com/in/markjm-1/",
"contributions": ["bug", "code"]
},
{
"login": "micrology",
"name": "Nigel Gilbert",
"avatar_url": "https://avatars.githubusercontent.com/u/1449986?v=4",
"profile": "https://cress.soc.surrey.ac.uk/web/people/ngilbert",
"contributions": ["bug"]
},
{
"login": "orionna319",
"name": "orionna319",
"avatar_url": "https://avatars.githubusercontent.com/u/85230052?v=4",
"profile": "https://orionna.me/",
"contributions": ["bug"]
}
],
"contributorsPerLine": 7,
"contributorsSortAlphabetically": true,
"files": ["README.md"],
"imageSize": 100,
"projectName": "TypeStat",
"projectOwner": "JoshuaKGoldberg",
"repoHost": "https://github.com",
"repoType": "github"
}
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

176 changes: 176 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
/** @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",
],
ignorePatterns: [
"!.*",
"coverage",
"lib",
"node_modules",
"test/cases",
"pnpm-lock.yaml",
],
overrides: [
{
extends: ["plugin:markdown/recommended-legacy"],
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",
"no-undef": "error",
},
},
{
files: "**/*.md/*.ts",
rules: {
"n/no-missing-import": ["error", { allowModules: ["TypeStat"] }],
},
},
{
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",

// These too-strict-by-default rules work well for this repo, once configured.
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowNumber: true,
},
],
},
},
{
excludedFiles: ["package.json"],
extends: ["plugin:jsonc/recommended-with-json"],
files: ["*.json", "*.jsonc"],
parser: "jsonc-eslint-parser",
rules: {
"jsonc/comma-dangle": "off",
"jsonc/sort-keys": "error",
},
},
{
files: ["*.jsonc"],
rules: {
"jsonc/no-comments": "off",
},
},
{
extends: ["plugin:package-json/recommended"],
files: ["package.json"],
parser: "jsonc-eslint-parser",
plugins: ["package-json"],
},
{
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",
"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-undef": "off",

// These on-by-default rules don't work well for this repo and we like them off.
"no-case-declarations": "off",
"no-constant-condition": "off",
"no-inner-declarations": "off",
"no-mixed-spaces-and-tabs": "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",
},
],
},
};
13 changes: 0 additions & 13 deletions .eslintrc.js

This file was deleted.

Loading

0 comments on commit 16f76cf

Please sign in to comment.