question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[TypeScript] Allow to provide custom naming

See original GitHub issue

Currently, there is only one namingConvention config, and the goal is to keep the current behavior, but also allow developers to separate it.

So this will still work:

namingConvention: module#method

But also allow to provide a default naming, with overrides:

namingConvention:
   default: module#method1
   enumValues: module#method2 
   typeNames: module#method3 

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
gaberudycommented, Jan 23, 2019

I discovered looking at the code there is a way to do a no-change-case, you specify keep as the option for the namingConvention. Here is my config for example:

generates:
  ./src/types/types.ts:
    plugins:
      - typescript-common
      - typescript-server
    config:
      avoidOptionals: true
      namingConvention:
        enumValues: keep
2reactions
OneCyruscommented, Jan 15, 2019

any update on this? the auto renaming broke us. We would prefer a pass-through option as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript - Using predefined names for custom class names
You cannot use any predefined name from TypeScript as a custom class/interface/type. The reason being is that a class declaration creates a ...
Read more >
How To Create Custom Types in TypeScript - DigitalOcean
In TypeScript, the syntax for creating custom types is to use the type keyword followed by the type name and then an assignment...
Read more >
3 Ways to Name Types in Typescript - geekAbyte
A post showing 3 ways of naming types in TypeScript. Namely: classes, type aliases and interfaces.
Read more >
Google TypeScript Style Guide
TypeScript expresses information in types, so names should not be decorated with information that is included in the type. (See also Testing Blog...
Read more >
Documentation - Declaration Merging - TypeScript
Type-creating declarations do just that: they create a type that is visible with the declared shape and bound to the given name. Lastly,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found