Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controllers are generated with unused variable #102

Open
morozovamv opened this issue Feb 13, 2020 · 7 comments
Open

Controllers are generated with unused variable #102

morozovamv opened this issue Feb 13, 2020 · 7 comments

Comments

@morozovamv
Copy link

morozovamv commented Feb 13, 2020

After starting generate I receive an error in generated controllers.
The error is
image

generate function is same as test1 in tests

Libs:

"fp-ts": "^2.4.4",
"io-ts": "^2.0.1",
"io-ts-reporters": "^1.0.0",
"io-ts-types": "^0.5.2",
"@devexperts/swagger-codegen-ts": "^2.0.0-alpha.17",
"@devexperts/utils": "^1.0.0-alpha.11",

System: win10

Also, I checked tests here and got the same result.

STR:

  • clone project
  • yarn install
  • yarn test:run

image

@raveclassic
Copy link
Contributor

Could you provide the spec?

@morozovamv
Copy link
Author

the spec that I used for tests

our project spec:
swagger.zip

@sutarmin
Copy link
Contributor

sutarmin commented Mar 6, 2020

This is very annoying. @raveclassic do you happen to know how difficult to fix this?

@raveclassic
Copy link
Contributor

Quickfix - just disable linting on the generated code.

@timofeevda
Copy link

We have the same issue. Vote for the fix! :)

@raveclassic
Copy link
Contributor

raveclassic commented Jul 10, 2020

Generally, generated code is not expected to be linted, neither adhere any codestyle. The only option available at the moment is a prettier config for formatting the code.
Personally I do agree unused imports should be removed, but at the same time I don't get why this is a problem for the end project which should (and it really should) just disable linting of the generated code.
We'd gladly review any PRs facing this issue, but at the moment we consider this as a low priority improvement.

@timofeevda
Copy link

Sounds reasonable :)

@morozovamv morozovamv changed the title Controllers generates with unused variable Controllers are generated with unused variable Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants