For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/static_analysis/static_analysis_rules/typescript-code-style/parameter-name.md. A documentation index is available at /llms.txt.

Parameter name should use camelCase

This product is not supported for your selected Datadog site. ().

Metadata

ID: typescript-code-style/parameter-name

Language: TypeScript

Severity: Notice

Category: Code Style

Description

Ensure that parameter names use camelCase and not snake_case or PascalCase.

Non-Compliant Code Examples

const a = { setValue(NewValue, event_info?) {} }
class A { setValue(NewValue, event_info__) {} }
function setValue(NewValue, $_event_info_) {}
const a = function(NewValue, event_info) {}
function render(Widget: string) {}
function renderSomething(WrappedComponent) {}

Compliant Code Examples

const a = { getValue() {} }
class A { setValue(newValue_) {} }
class B { setValue(md5, valid5String) {} }
class B { setValue(_, valid5String) {} }
class C { setValue(UID, valid5String) {} }
async.doSomething(nothing, (n, _cb) => {}
function withFeature(WrappedComponent) { return WrappedComponent; }

const MyComponent = () => {
  const renderItem = useCallback((Item: unknown) => <Item />, []);
  const renderHeader = useMemo(() => (Header: unknown) => <Header />, []);
  return <List renderItem={renderItem} />;
};
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Security