A function or method name does not follow the configured case style

tx0/ts:function-namingstrictwarningstyle

What it finds

Functions and methods named in one case style read alike across a code base, and a different style for constructors and components makes those stand out.

The names of function declarations and of methods in classes and object literals are checked against the case styles of the parameter style, camelCase|PascalCase by default so that constructors and components fit; several styles are separated by |. Quoted, numeric and computed method names are left alone, as are leading and trailing underscores and dollar signs.

From the rule's source, function_naming.rs.

Example from the rule's tests
export function load_user() {tx0 reports: the function name load_user is not written in camelCase or PascalCase  return 1;}export function Component() {  return 2;}export class Service {  fetch_all() {tx0 reports: the function name fetch_all is not written    return 3;  }  "quoted-name"() {    return 4;  }}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/ts:function-naming" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/ts:function-naming] reason="..."

tx0 explain tx0/ts:function-naming shows the same in the terminal. Found a false positive? Report it.