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

feat: allow to define eslint-disable-next-line in multiple lines #15436

Merged
merged 8 commits into from Dec 29, 2021

Conversation

snitin315
Copy link
Contributor

@snitin315 snitin315 commented Dec 18, 2021

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[X] Other, please explain: Allow eslint-disable-next-line directive to be of multiple lines

What changes did you make? (Give an overview)

Fixes #14284

/* eslint-disable-next-line global-require --
   description on why this exception is seen as appropriate but past a 
   comfortable reading line length */
const fizz = require(buzz); // ignored

/* eslint-disable-next-line 
    no-alert
*/
alert("buzz"); // ignored

Is there anything you'd like reviewers to focus on?

None

@eslint-github-bot eslint-github-bot bot added the triage An ESLint team member will look at this issue soon label Dec 18, 2021
@eslint-github-bot

This comment has been minimized.

@snitin315 snitin315 changed the title feat: allow to defineeslint-disable-next-line directive in multiple lines feat: allow to define eslint-disable-next-line in multiple lines Dec 18, 2021
@eslint-github-bot eslint-github-bot bot added the feature This change adds a new feature to ESLint label Dec 18, 2021
@snitin315 snitin315 marked this pull request as ready for review December 18, 2021 12:48
@mdjermanovic mdjermanovic added accepted There is consensus among the team that this change meets the criteria for inclusion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint and removed triage An ESLint team member will look at this issue soon labels Dec 22, 2021
@mdjermanovic
Copy link
Member

It would be good to update this section in the docs with multiline eslint-disable-next-line comments:

https://eslint.org/docs/user-guide/configuring/rules#using-configuration-comments-1

@snitin315 snitin315 force-pushed the feat/multiline-eslint-disable-next-line-directives branch from 4c831ed to e10efd6 Compare December 24, 2021 11:17
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Since this is a change in the core, I'll leave it open for a few days in case someone else wants to review it, and then merge.

@thernstig
Copy link

@snitin315 some of us prefer to reserver /* just for JSDoc comments and instead use multi-line // for the rest of the comments.

Is there any chance support could be added for this? I assume it was not as part of this as I cannot see it in the docs:

// eslint-disable-next-line global-require -- Some text here as well
// description on why this exception is seen as appropriate but past a 
// comfortable reading line length

@snitin315
Copy link
Contributor Author

@thernstig please open a new issue for this.

@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jun 28, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jun 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint feature This change adds a new feature to ESLint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allowing eslint-disable-next-line directives to have extra lines only for descriptions
3 participants