deno_lint icon indicating copy to clipboard operation
deno_lint copied to clipboard

Feature: add rust-style-naming rule

Open c-antin opened this issue 1 year ago • 3 comments

In my deno projects, I often use Rust via ffi and I was wondering if we could unify the naming conventions.

It may have been proposed already (Discord?), yet I didn't find an issue for the following proposal: Similar to https://rust-lang.github.io/api-guidelines/naming.html a lint rule that enforces UpperCamelCase for types, interfaces and classes and snake_case for functions, methods and variables plus SCREAMING_SNAKE_CASE for constants (if enforcible) would be great.

pros: uniform naming across Rust and TypeScript cons: JS legacy naming convention is camelCase

c-antin avatar Sep 12 '24 09:09 c-antin

I'm working on a PR

c-antin avatar Sep 14 '24 14:09 c-antin

See #1323

c-antin avatar Sep 15 '24 07:09 c-antin

FYI: I've ported the rule to a TS plugin: https://jsr.io/@c-antin/lint-plugin-rust-style

c-antin avatar Mar 19 '25 16:03 c-antin