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.

Add an option to remove underscores from generated interfaces.

See original GitHub issue

Codegen generates interfaces with underscores.

For example: myQuery_foo_bar.

This default behaviour causes problems when using ESLint camelcase rule -https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/camelcase.md.

Importing these interfaces triggers a linting error.

I’d suggest adding --no-underscores flag that would cause interfaces to be generated without underscores. For example: myQueryFooBar.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:34
  • Comments:5

github_iconTop GitHub Comments

13reactions
haysclarkcommented, Oct 28, 2020

Having the ability to pick a “namingConvention” such as: Underscores (aka snake_case), camelCase, PascalCase, kebab-case and any other common variation I may have missed, would be ideal.

e.g:

// apollo.config.js
module.exports = {
  client: {
    service: {
      name: "My Client",
      namingConvention: "camel", // default: "snake" optional: "camel" "pascal" "kebab" etc.
    },
  },
};

or

 apollo client:codegen --target typescript --namingConvention camel
5reactions
paltmancommented, Oct 1, 2021

Any plans for this issue? Would be great to have.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove underscore from all the columns
I would use a technique like this to replace the underscores after the Crosstab. Just for context and educational purposes. The dynamic rename ......
Read more >
c++ - __cdecl forcing prefix with underscore - Stack Overflow
The Borland C/C++ compiler has an option to turn underscore generation on symbols on and off. -u (the default) generates underscores on symbol...
Read more >
Code Gen Options (The GNU Fortran Compiler)
You can figure out the other form by either removing no- or adding it. ... This does not affect the generation of code...
Read more >
[GA4] Modify and create events via the user interface
Event configuration options · Modify event overwrites an existing event. You can add, change, or delete conditions and parameters. · Create event creates...
Read more >
Underscore.js
Underscore 2.x will likely remove support for some outdated environments. Collection Functions (Arrays or Objects). each _.each(list, iteratee, [context]) Alias ...
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