Skip to content

Enhancement: [triple-slash-reference] support a new option named never #11196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
zanminkian opened this issue May 9, 2025 · 2 comments
Closed
4 tasks done
Labels
awaiting response Issues waiting for a reply from the OP or another party enhancement: plugin rule option New rule option for an existing eslint-plugin rule locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@zanminkian
Copy link

Before You File a Proposal Please Confirm You Have Done The Following...

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Link to the rule's documentation

https://typescript-eslint.io/rules/triple-slash-reference/

Description

Current option is an object. I would like to see this rule accept a string option - never.

nevert option will totally disallow triple slash, including /// <amd-module /> and /// <reference no-default-lib="true"/>

Fail

/// <amd-module />
/// <reference no-default-lib="true"/>

Pass

import foo from 'foo';

Additional Info

No response

@zanminkian zanminkian added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look enhancement: plugin rule option New rule option for an existing eslint-plugin rule labels May 9, 2025
@JoshuaKGoldberg
Copy link
Member

string option

😬 I'm not a big fan of the string options. They don't scale well - many rules have started with string options and then needed to expand to options.

Why is the current options shape unacceptable? Is this just a request for a cleaner / more succinct option than specifying ''never' three times?

@JoshuaKGoldberg JoshuaKGoldberg added awaiting response Issues waiting for a reply from the OP or another party and removed triage Waiting for team members to take a look labels May 12, 2025
@zanminkian
Copy link
Author

Is this just a request for a cleaner / more succinct option than specifying ''never' three times?

Yes.

But the name of this rule is triple-slash-reference, which means it only focus on /// <reference /> and does not care about /// <amd-module />.

Originally, I want to ban all triple slash directives. It's not very suitable for this rule to do this.

@zanminkian zanminkian closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2025
@github-actions github-actions bot added the locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. label May 21, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting response Issues waiting for a reply from the OP or another party enhancement: plugin rule option New rule option for an existing eslint-plugin rule locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants