JoshuaKGoldberg / JoshuaKGoldberg/create-typescript-app

🚀 Feature: Extend eslint-plugin-unicorn's 'unopinionated' preset

Open
#1,116 4 comments 0 reactions 1 assignee Claimed by @JoshuaKGoldberg View on GitHub
status: accepting prs type: feature
Dominant language
TypeScript
Stars
1.4k
Forks
89
Avg merge
1m
Merged PRs (30d)
3

Description

### Bug Report Checklist

- [X] I have tried restarting my IDE and the issue persists.
- [X] I have pulled the latest `main` branch of the repository.
- [X] I have [searched for related issues](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aissue) and found none that matched my issue.

### Overview

https://github.com/sindresorhus/eslint-plugin-unicorn has a lot of great rules in it. The `plugin:unicorn/recommended` plugin in particular has a non-zero density of rules that catch dangerous bugs.

Example of a good objective logical rule: [`unicorn/no-instanceof-array`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/ae844593e62bd98a50a4e54a80a0566495f64c3b/docs/rules/no-instanceof-array.md) flags dangerous uses of `... instanceof Array` that should be replaced with `Array.isArray(...)`.

However! Not every rule in `plugin:unicorn/recommended` is purely logical. Some are opinionated stylistic ones - which I wouldn't want to enable in this plugin.

Example of an opinionated logical rule: [`unicorn/expiring-todo-comments`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/ae844593e62bd98a50a4e54a80a0566495f64c3b/docs/rules/expiring-todo-comments.md). It's a good idea and I like that folks are enabling it. But I think it'd be too opinionated for a general-purpose template like this one. Even the `--base everything` / stylistic-enabled options.

Let's:

- [x] File an issue (if one doesn't already exist) on `eslint-plugin-stylistic` to make a preset config that only has the objective logical rules: https://github.com/sindresorhus/eslint-plugin-unicorn/issues/896
- [x] Send a PR (if one doesn't already exist) to `eslint-plugin-stylistic` to add that preset config: https://github.com/sindresorhus/eslint-plugin-unicorn/pull/2182
- [ ] Wait for the PR to be implemented - helping if possible
- [ ] Use that preset config here

### Additional Info

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.