Search code examples
javascriptnode.jstypescripteslint

ESlint rule for function names with TypeScript (camelCase with lower case for first letter)


Following these guidelines (and almost any other), functions and var names should use lowerCamelCase while Class (and c'tors) names should use UpperCamelCase.

I've looked for an ESLint rule to enforce this convention but the closest I've found is id-match which doesn't seem to distinguish between function, var, or class.

Is there a better rule? Should I be using the id-match rule along with new-cap rule? (feels dirty)


Solution

  • Unfortunately it seems like there is no better option at the moment...

    Unfortunately, it looks like there wasn't enough interest from the team or community to implement this change. While we wish we'd be able to accommodate everyone's requests, we do need to prioritize. We've found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn't mean the idea isn't interesting or useful, just that it's not something the team can commit to. https://github.com/eslint/eslint/issues/10473