pinterest / ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
https://pinterest.github.io/ktlint/
MIT License
6.19k stars 505 forks source link

Function name should start with a lowercase letter for @Composable components #2506

Closed slateblua closed 8 months ago

slateblua commented 8 months ago

JetPack enforces developers to use PascalCase to name Composable components. However, analyzer floods the terminal with warning messages.

error

sandeepjak2007 commented 8 months ago

Should we use camelCase or PascalCase for composable functions?

slateblua commented 8 months ago

Should we use camelCase or PascalCase for composable functions?

Yes, API enforces you to use PascalCase to create composables. See the guidelines

Goooler commented 8 months ago

Use Ktlint 1.0.1 or newer and add ktlint_function_naming_ignore_when_annotated_with = Composable to your .editorconfig, check https://pinterest.github.io/ktlint/latest/rules/standard/#function-naming

Goooler commented 8 months ago

If you need more compose rules, could add https://github.com/mrmans0n/compose-rules to your rule sets.

slateblua commented 8 months ago

Use Ktlint 1.0.1 or newer and add ktlint_function_naming_ignore_when_annotated_with = Composable to your .editorconfig, check https://pinterest.github.io/ktlint/latest/rules/standard/#function-naming

Thank you very much.