Skip to content

Commit d7b43c3

Browse files
feat: remove eslint-plugin-no-only-tests (#1297)
<!-- 👋 Hi, thanks for sending a PR to create-typescript-app! 💖. Please fill out all fields below and make sure each item is true and [x] checked. Otherwise we may not be able to review your PR. --> ## PR Checklist - [x] Addresses an existing open issue: fixes #1294 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Remove eslint-plugin-no-only-tests according to <img width="690" alt="Screenshot of --allowOnly description in Vitest docs" src="https://github.com/JoshuaKGoldberg/create-typescript-app/assets/95881717/511ba5ce-57b2-4ffa-a938-e9d204071298"> https://vitest.dev/guide/cli#options --- @JoshuaKGoldberg Should we explain somewhere that it is checked by vitest? --------- Co-authored-by: Josh Goldberg ✨ <[email protected]>
1 parent 2b79e13 commit d7b43c3

8 files changed

+6
-25
lines changed

.eslintrc.cjs

-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ module.exports = {
149149
"@typescript-eslint",
150150
"deprecation",
151151
"jsdoc",
152-
"no-only-tests",
153152
"perfectionist",
154153
"regexp",
155154
"vitest",
@@ -159,7 +158,6 @@ module.exports = {
159158
rules: {
160159
// These off/less-strict-by-default rules work well for this repo and we like them on.
161160
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],
162-
"no-only-tests/no-only-tests": "error",
163161

164162
// These on-by-default rules don't work well for this repo and we like them off.
165163
"no-case-declarations": "off",

docs/Tooling.md

-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ pnpm run lint:knip
194194
Additionally:
195195

196196
- [`console-fail-test`](https://github.com/JoshuaKGoldberg/console-fail-test) will also be added to ensure tests don't accidentally log to the console.
197-
- [`eslint-plugin-no-only-tests`](https://github.com/levibuzolic/eslint-plugin-no-only-tests) will be added to the ESLint config to ensure calls to `it.only` or similar are not checked in
198197
- [`eslint-plugin-vitest`](https://github.com/veritem/eslint-plugin-vitest) will be added to the ESLint config to lint for Vitest-specific issues
199198

200199
Running tests in watch mode:

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
"eslint-plugin-jsonc": "^2.10.0",
7979
"eslint-plugin-markdown": "^3.0.1",
8080
"eslint-plugin-n": "^16.3.1",
81-
"eslint-plugin-no-only-tests": "^3.1.0",
8281
"eslint-plugin-package-json": "^0.10.0",
8382
"eslint-plugin-perfectionist": "^2.5.0",
8483
"eslint-plugin-regexp": "^2.1.2",

pnpm-lock.yaml

-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/steps/finalizeDependencies.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe("finalize", () => {
3838
expect(mockExecaCommand.mock.calls).toMatchInlineSnapshot(`
3939
[
4040
[
41-
"pnpm add @release-it/conventional-changelog@latest @types/eslint@latest @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest @vitest/coverage-v8@latest all-contributors-cli@latest console-fail-test@latest cspell@latest eslint@latest eslint-plugin-deprecation@latest eslint-plugin-eslint-comments@latest eslint-plugin-jsdoc@latest eslint-plugin-jsonc@latest eslint-plugin-markdown@latest eslint-plugin-n@latest eslint-plugin-no-only-tests@latest eslint-plugin-package-json@latest eslint-plugin-perfectionist@latest eslint-plugin-regexp@latest eslint-plugin-vitest@latest eslint-plugin-yml@latest husky@latest jsonc-eslint-parser@latest knip@latest lint-staged@latest markdownlint@latest markdownlint-cli@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest release-it@latest sentences-per-line@latest tsup@latest typescript@latest vitest@latest yaml-eslint-parser@latest -D",
41+
"pnpm add @release-it/conventional-changelog@latest @types/eslint@latest @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest @vitest/coverage-v8@latest all-contributors-cli@latest console-fail-test@latest cspell@latest eslint@latest eslint-plugin-deprecation@latest eslint-plugin-eslint-comments@latest eslint-plugin-jsdoc@latest eslint-plugin-jsonc@latest eslint-plugin-markdown@latest eslint-plugin-n@latest eslint-plugin-package-json@latest eslint-plugin-perfectionist@latest eslint-plugin-regexp@latest eslint-plugin-vitest@latest eslint-plugin-yml@latest husky@latest jsonc-eslint-parser@latest knip@latest lint-staged@latest markdownlint@latest markdownlint-cli@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest release-it@latest sentences-per-line@latest tsup@latest typescript@latest vitest@latest yaml-eslint-parser@latest -D",
4242
],
4343
[
4444
"npx all-contributors-cli generate",
@@ -59,7 +59,7 @@ describe("finalize", () => {
5959
expect(mockExecaCommand.mock.calls).toMatchInlineSnapshot(`
6060
[
6161
[
62-
"pnpm add @release-it/conventional-changelog@latest @types/eslint@latest @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest @vitest/coverage-v8@latest all-contributors-cli@latest console-fail-test@latest cspell@latest eslint@latest eslint-plugin-deprecation@latest eslint-plugin-eslint-comments@latest eslint-plugin-jsdoc@latest eslint-plugin-jsonc@latest eslint-plugin-markdown@latest eslint-plugin-n@latest eslint-plugin-no-only-tests@latest eslint-plugin-package-json@latest eslint-plugin-perfectionist@latest eslint-plugin-regexp@latest eslint-plugin-vitest@latest eslint-plugin-yml@latest husky@latest jsonc-eslint-parser@latest knip@latest lint-staged@latest markdownlint@latest markdownlint-cli@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest release-it@latest sentences-per-line@latest tsup@latest typescript@latest vitest@latest yaml-eslint-parser@latest -D --offline",
62+
"pnpm add @release-it/conventional-changelog@latest @types/eslint@latest @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest @vitest/coverage-v8@latest all-contributors-cli@latest console-fail-test@latest cspell@latest eslint@latest eslint-plugin-deprecation@latest eslint-plugin-eslint-comments@latest eslint-plugin-jsdoc@latest eslint-plugin-jsonc@latest eslint-plugin-markdown@latest eslint-plugin-n@latest eslint-plugin-package-json@latest eslint-plugin-perfectionist@latest eslint-plugin-regexp@latest eslint-plugin-vitest@latest eslint-plugin-yml@latest husky@latest jsonc-eslint-parser@latest knip@latest lint-staged@latest markdownlint@latest markdownlint-cli@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest release-it@latest sentences-per-line@latest tsup@latest typescript@latest vitest@latest yaml-eslint-parser@latest -D --offline",
6363
],
6464
[
6565
"npx all-contributors-cli generate",

src/steps/finalizeDependencies.ts

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export async function finalizeDependencies(options: Options) {
5151
: [
5252
"@vitest/coverage-v8",
5353
"console-fail-test",
54-
"eslint-plugin-no-only-tests",
5554
"eslint-plugin-vitest",
5655
"vitest",
5756
]),

src/steps/writing/creation/createESLintRC.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ describe("createESLintRC", () => {
237237
"@typescript-eslint",
238238
"deprecation",
239239
"jsdoc",
240-
"no-only-tests",
241240
"perfectionist",
242241
"regexp",
243242
"vitest",
@@ -247,7 +246,6 @@ describe("createESLintRC", () => {
247246
rules: {
248247
// These off/less-strict-by-default rules work well for this repo and we like them on.
249248
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],
250-
"no-only-tests/no-only-tests": "error",
251249
252250
// These on-by-default rules don't work well for this repo and we like them off.
253251
"no-case-declarations": "off",

src/steps/writing/creation/createESLintRC.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,15 @@ module.exports = {
200200
? ""
201201
: `"jsdoc",
202202
`
203-
}${options.excludeTests ? "" : `"no-only-tests",`}${
204-
options.excludeLintPerfectionist ? "" : `"perfectionist",`
205-
}${options.excludeLintRegex ? "" : `"regexp",`}${
206-
options.excludeTests ? "" : `\n"vitest",`
207-
}
203+
}${options.excludeLintPerfectionist ? "" : `"perfectionist",`}${
204+
options.excludeLintRegex ? "" : `"regexp",`
205+
}${options.excludeTests ? "" : `\n"vitest",`}
208206
],
209207
reportUnusedDisableDirectives: true,
210208
root: true,
211209
rules: {
212210
// These off/less-strict-by-default rules work well for this repo and we like them on.
213-
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],${
214-
options.excludeTests ? "" : `\n"no-only-tests/no-only-tests": "error",`
215-
}
211+
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],
216212
217213
// These on-by-default rules don't work well for this repo and we like them off.
218214
"no-case-declarations": "off",

0 commit comments

Comments
 (0)