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.

I have "-Xfatal-warnings", "-Ywarn-unused-import", in my scalacOptions

I cannot use twirl

import play.twirl.api._
import play.twirl.api.TemplateMagic._

class error extends BaseScalaTemplate[play.twirl.api.HtmlFormat.Appendable,Format[play.twirl.api.HtmlFormat.Appendable]](play.twirl.api$

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:36
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

12reactions
schmitchcommented, Nov 1, 2016

You can set TwirlKeys.templateImports := Seq() which will actually remove all the imports. However you should re add the necessary onces.

2reactions
yamin-oandacommented, Sep 10, 2022

I can confirm that @SethTisue 's suggestion works on Scala 2.12.13+:

scalacOptions ++= Seq(
  "-deprecation",
  "-feature",
  "-Xfatal-warnings",
  "-Xlint",
  // Suggested here https://github.com/playframework/twirl/issues/105#issuecomment-782985171
  "-Wconf:src=routes/.*:is,src=twirl/.*:is",
...

This prints:

[info] 86 unused info messages; change -Wconf for cat=unused to display individual messages
Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-plugin-unused-imports - npm
Find and remove unused es6 module imports. It works by splitting up the no-unused-vars rule depending on it being an import statement in...
Read more >
Why used import statement is specified as "unused import ...
I'm using Android Studio and build as "Generate Signed APK...". And I faced the error, "Unused import statement" like following. import android.
Read more >
Code Inspection: Unused import - PhpStorm - JetBrains
Reports the imports that are never used. Suppress an inspection in the editor. Position the caret at the highlighted line and press ...
Read more >
How to fix "Unused import statement..."? : r/learnpython - Reddit
unused import means you imported something that you never used... Remove that import line... and that is it....
Read more >
unused-import / W0611 - Pylint 2.16.0-dev documentation
Used when an imported module or variable is not used. Problematic code: from logging import getLogger from pathlib import Path # [unused-import] LOGGER ......
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