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

id-length exceptions pattern #13094

Closed
burawi opened this issue Mar 25, 2020 · 9 comments · Fixed by #13576
Closed

id-length exceptions pattern #13094

burawi opened this issue Mar 25, 2020 · 9 comments · Fixed by #13576
Assignees
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 enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules

Comments

@burawi
Copy link

burawi commented Mar 25, 2020

What rule do you want to change?
Property exceptions for rule id-length

Does this change cause the rule to produce more or fewer warnings?
Fewer

How will the change be implemented? (New option, new default behavior, etc.)?
Property value support

Please provide some example code that this change will affect:

{
  id-length: {
    min: 3,
    max: 16,
    exceptions: ["^BEFORE_"]
  }
}

What does the rule currently do for this code?
It makes the exception only for identifiers named exactly ^BEFORE_

What will the rule do after it's changed?
It will make the exception for all identifiers matching the pattern. In the example above, it will make the exception for every identifier starting with BEFORE

Are you willing to submit a pull request to implement this change?
Not for the moment

@burawi burawi added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules triage An ESLint team member will look at this issue soon labels Mar 25, 2020
@anikethsaha
Copy link
Member

this doesn't need much refactoring.
I think it can be done but I think it will be safe to implement as a separate option like exceptionPattern

@kaicataldo kaicataldo added evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Mar 26, 2020
@kaicataldo
Copy link
Member

This seems like a reasonable enhancement to me 👍

@yeonjuan
Copy link
Member

I agree with it 👍 and marked as accepted.

@yeonjuan yeonjuan added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Apr 24, 2020
@anikethsaha
Copy link
Member

anikethsaha commented Apr 24, 2020

I would like to work on this if its ok by others! #13099

@kaicataldo
Copy link
Member

@yeonjuan We still need a champion for this proposal. Would you like to champion it?

@kaicataldo kaicataldo added evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed accepted There is consensus among the team that this change meets the criteria for inclusion labels Apr 24, 2020
@yeonjuan
Copy link
Member

@kaicataldo sorry for mislabeling, I'm willing to champion this : )

@kaicataldo
Copy link
Member

@eslint/eslint-team Looks like we just need one more 👍 from a team member.

@g-plane g-plane added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels May 14, 2020
@mdjermanovic mdjermanovic linked a pull request May 16, 2020 that will close this issue
2 tasks
@sodaMelon
Copy link
Contributor

hi, It seems to have stopped last month.
Can i continue this?

@aladdin-add
Copy link
Member

@sodaMelon sure, please feel free to pick up!

@mdjermanovic mdjermanovic linked a pull request Aug 26, 2020 that will close this issue
1 task
kaicataldo pushed a commit that referenced this issue Aug 29, 2020
* Add #13099 to continue

* Delete unnecessary 'parserOptions'

* Add invalid test with an identifier that doesn't match configured pattern

* Add valid test with multiple exception patterns

* Add a function that extracted 'return' below

* Docs: Add "exceptionPatterns" to "id-length" rule

* Add a function that extracted 'return' below

Docs: Add "exceptionPatterns" to "id-length" rule

* Update : modify wrong example

* Update: all RegExp instance create in "create(context)"

* Update: more simpler by refactoring some codes

* Update docs/rules/id-length.md

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>

* Update: modify the function name

* Update: Add a valid test with multiple patterns where the first doesn't match.

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Mar 18, 2021
@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 Mar 18, 2021
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 enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
7 participants