-1

I am using javascript (not typescript) with eslint and airbnb rules.

I wonder if I can specify a rule to validate the naming of class attributes.

In particular, I would like to enforce that class attributes starts with "m_" and use snake case. example:

class A {
 constructor() {
   this.boo = "boo"; //BAD
   this.m_boo = "boo"; //OK
 }
}
cesarpachon
  • 1,179
  • 2
  • 10
  • 23

1 Answers1

0

I only know of this (rather old) eslint plugin that has a rule similar to what you need, but you might be able to create your own custom rule based on this: https://www.npmjs.com/package/eslint-plugin-classes

doberkofler
  • 9,511
  • 18
  • 74
  • 126