Skip to content

eslint/rules/naming ​

Naming: Names of identifiers, the naming convention of TypeScript and forbidden abbreviations. Rules of ESLint, typescript-eslint and SonarJS (the Sonar way profile of SonarQube) on this subject, every rule listed; the TypeScript rules apply to TypeScript files only.

13 rules, 5 on. Source: lint/eslint/rules/naming.mjs.

RuleSettingFilesWhat it checksWhy
func-name-matchinginfoJS + TSRequire function names to match the name of the variable or property to which they are assigned—
func-namesoffJS + TSRequire or disallow named function expressionsOff: callbacks are arrow functions by convention.
id-denylistoffJS + TSDisallow specified identifiers—
id-matchoffJS + TSRequire identifiers to match a specified regular expression—
new-capwarnJS + TSRequire constructor names to begin with a capital letter—
no-shadow-restricted-nameserrorJS + TSDisallow identifiers from shadowing restricted names—
no-underscore-dangleoffJS + TSDisallow dangling underscores in identifiersOff: _ prefix is allowed (private members, unused params).
sonarjs/class-nameoffJS + TSClass names should comply with a naming conventionOff: duplicate of @typescript-eslint/naming-convention.
sonarjs/file-name-differ-from-classoffJS + TSDefault export names and file names should matchOff: not in the Sonar way profile of SonarQube.
sonarjs/function-nameoffJS + TSFunction and method names should comply with a naming conventionOff: not in the Sonar way profile of SonarQube.
sonarjs/future-reserved-wordswarnJS + TSFuture reserved words should not be used as identifiers—
sonarjs/variable-nameoffJS + TSVariable, property and parameter names should comply with a naming conventionOff: not in the Sonar way profile of SonarQube.
@typescript-eslint/naming-conventionwarn, [{"selector":"default","format":["camelCase"],"leadingUnd…TSEnforce naming conventions for everything across a codebaseCustom: the most specific selector wins (see namingConventionSelectors). Warn: external names (JSON keys, HTTP headers) keep their spelling.

Generated from the JSDoc of the sources.