Skip to content
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

Require explanation on eslint-disable and ts-expect-error #571

Open
fregante opened this issue Jul 6, 2021 · 3 comments · Fixed by #704
Open

Require explanation on eslint-disable and ts-expect-error #571

fregante opened this issue Jul 6, 2021 · 3 comments · Fixed by #704

Comments

@fregante
Copy link
Member

fregante commented Jul 6, 2021

Not allowed

// eslint-disable-next-line no-var
var iLikeVar = true;

// @ts-expect-error
const iLikeErrors = undefined.undefined;

Allowed

// eslint-disable-next-line no-var -- TODO: I'll look into this later
var iLikeVar = true;

// @ts-expect-error -- TypeScript is actually wrong here, this totes works
const iLikeErrors = undefined.undefined;
@fregante
Copy link
Member Author

fregante commented Jul 7, 2021

@sindresorhus
Copy link
Member

Is there a rule to enforce it in ESLint (for the non-TS case)?

@fregante
Copy link
Member Author

Require explanation on eslint-disable

Still not enabled because of eslint-plugin-eslint-comments’ inactivity. Hopefully a new rule will come out. Unicorn?

@fregante fregante reopened this Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants