cats-oss / eslint-config-abema

This project is presets of eslint configurations which we used in our some internal projects.
MIT License
4 stars 1 forks source link

[typescript-eslint] Rethinking generic type parameter naming convention #179

Closed tetsuharuohzeki closed 5 years ago

tetsuharuohzeki commented 5 years ago

Motivation

Currently, we define the generic type name convention to both forms:

  1. T, E, or other short form.
  2. T or TBar or other T-prefixed form.

On the other hands, the default config of typescript-eslint only allows the later form.

I think the later form is more expressive and improves a readability. So I'd like to sort to it.

Related Issue

tetsuharuohzeki commented 5 years ago

C

I'm not sure about the detail of history of this kind of conventions for C#, I seem C# has these rules:

tetsuharuohzeki commented 5 years ago

TypeScript

tetsuharuohzeki commented 5 years ago

Java

Scala

Kotlin

I could not find any conventions, but I found the discussion: https://discuss.kotlinlang.org/t/naming-convention-for-type-parameters/1546

tetsuharuohzeki commented 5 years ago

Rust

https://github.com/rust-lang/rfcs/blob/master/text/0430-finalizing-naming-conventions.md

tetsuharuohzeki commented 5 years ago

Google C++ Style Guide

https://google.github.io/styleguide/cppguide.html#General_Naming_Rules

Template parameters should follow the naming style for their category: type template parameters should follow the rules for type names, and non-type template parameters should follow the rules for variable names.

tetsuharuohzeki commented 5 years ago

Some thought