getify / eslint-plugin-proper-arrows

ESLint rules to ensure proper arrow function definitions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add `id` to the default allowed list of short params

davidwkeith opened this issue · comments

Reasoning:

  • Usually clear from context which ID is being referenced.
    • Rule could be be interpreted to say that a name like userId is preferred, but inside a function handling user logic that might be redundant.
  • people use the term ID rather than Identifier when talking
  • Even if the type of ID is unclear, it is still clear what an ID is. That sort of code review seems beyond the scope of a linter.

We're talking about the the "allowed" mode of the "params" rule, right? The default is an empty list, so I don't think we'd do anything to make that non-empty.

But maybe you're instead referring to the included "getify" config preset? https://github.com/getify/eslint-plugin-proper-arrows/blob/master/lib/index.js#L8

It's a reasonable suggestion that id is a good default param name, but it doesn't happen to be something I use.

But I always expected that with community input, we'd define more config presets. Seems like we could use one here? What would it be called, and what would the presets be?

Correct. I only mentioned it because it is an example in the readme that fails…

which example?

Closing for now.