Skip to content

Commit 36580c5

Browse files
committed
Enable -Wunused:nowarn and fix
1 parent ad4aad5 commit 36580c5

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

core/src/main/scala/japgolly/scalajs/react/raw/Profiler.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ import scala.scalajs.js.annotation.JSGlobal
66
import scalajs.js
77

88
@js.native
9-
@nowarn("cat=unused")
109
trait Interaction extends js.Object {
11-
val __count : Int = js.native
12-
val id : Int = js.native
13-
val name : String = js.native
10+
val __count : Int = js.native
11+
val id : Int = js.native
12+
val name : String = js.native
1413
val timestamp: Double = js.native
1514
}
1615

core/src/main/scala/japgolly/scalajs/react/raw/events.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import scala.scalajs.js.annotation.JSName
77

88
/** https://facebook.github.io/react/docs/events.html */
99
@js.native
10-
@nowarn("cat=unused")
1110
trait SyntheticEvent[+DOMEventTarget <: dom.Node] extends js.Object {
1211
val bubbles : Boolean = js.native
1312
val cancelable : Boolean = js.native

monocle-scalaz/src/main/scala/japgolly/scalajs/react/internal/MonocleExtStateSnapshot.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ trait MonocleExtStateSnapshot {
2222

2323
object MonocleExtStateSnapshot {
2424

25-
final class ObjectWithoutReuse(@nowarn("cat=unused") private val ε: StateSnapshot.type) extends AnyVal {
25+
final class ObjectWithoutReuse(private val ε: StateSnapshot.type) extends AnyVal {
2626
def zoomL[S, T](lens: monocle.Lens[S, T]) =
2727
StateSnapshot.zoom(lens.get)(lens.set)
2828
}
2929

30-
final class ObjectWithReuse(@nowarn("cat=unused") private val ε: StateSnapshot.withReuse.type) extends AnyVal {
30+
final class ObjectWithReuse(private val ε: StateSnapshot.withReuse.type) extends AnyVal {
3131
def zoomL[S, T](lens: monocle.Lens[S, T]) =
3232
StateSnapshot.withReuse.zoom(lens.get)(lens.set)
3333
}
@@ -61,7 +61,6 @@ object MonocleExtStateSnapshot {
6161
self.zoomStateOption(o.getOption)(o.set)
6262
}
6363

64-
@nowarn("cat=unused")
6564
final class InstanceWithReuse[A](private val self: StateSnapshot.InstanceMethodsWithReuse[A]) extends AnyVal {
6665

6766
@deprecated("This ability doesn't work. See https://github.com/japgolly/scalajs-react/issues/721 for an explanation, and https://japgolly.github.io/scalajs-react/#examples/state-snapshot-2 for the alternative.", "1.7.1")

monocle/src/main/scala/japgolly/scalajs/react/internal/MonocleExtStateSnapshot.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ trait MonocleExtStateSnapshot {
2222

2323
object MonocleExtStateSnapshot {
2424

25-
final class ObjectWithoutReuse(@nowarn("cat=unused") private val ε: StateSnapshot.type) extends AnyVal {
25+
final class ObjectWithoutReuse(private val ε: StateSnapshot.type) extends AnyVal {
2626
def zoomL[S, T](lens: monocle.Lens[S, T]) =
2727
StateSnapshot.zoom(lens.get)(lens.set)
2828
}
2929

30-
final class ObjectWithReuse(@nowarn("cat=unused") private val ε: StateSnapshot.withReuse.type) extends AnyVal {
30+
final class ObjectWithReuse(private val ε: StateSnapshot.withReuse.type) extends AnyVal {
3131
def zoomL[S, T](lens: monocle.Lens[S, T]) =
3232
StateSnapshot.withReuse.zoom(lens.get)(lens.set)
3333
}
@@ -54,7 +54,6 @@ object MonocleExtStateSnapshot {
5454
self.zoomState(lens.get)(lens.set)
5555
}
5656

57-
@nowarn("cat=unused")
5857
final class InstanceWithReuse[A](private val self: StateSnapshot.InstanceMethodsWithReuse[A]) extends AnyVal {
5958

6059
@deprecated("This ability doesn't work. See https://github.com/japgolly/scalajs-react/issues/721 for an explanation, and https://japgolly.github.io/scalajs-react/#examples/state-snapshot-2 for the alternative.", "1.7.1")

project/Build.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ object ScalajsReact {
6565
"-Wunused:implicits", // Warn if an implicit parameter is unused.
6666
"-Wunused:imports", // Warn if an import selector is not referenced.
6767
"-Wunused:locals", // Warn if a local definition is unused.
68+
"-Wunused:nowarn", // Warn if a @nowarn annotation does not suppress any warnings.
6869
"-Wunused:patvars", // Warn if a variable bound in a pattern is unused.
6970
"-Wunused:privates", // Warn if a private member is unused.
7071
"-Xlint:adapted-args", // An argument list was modified to match the receiver.

test/src/test/scala/japgolly/scalajs/react/core/RefTest.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ object RefTest extends TestSuite {
241241
def withRef() = {
242242
class Backend {
243243
val ref = Ref.toScalaComponent(InnerScala)
244-
@nowarn def render = Forwarder.withRef(ref)("noice")
244+
def render = Forwarder.withRef(ref)("noice")
245245
}
246246
val C = ScalaComponent.builder[Unit]("X").renderBackend[Backend].build
247247
ReactTestUtils.withNewBodyElement { mountNode =>
@@ -254,7 +254,7 @@ object RefTest extends TestSuite {
254254
def withRef2() = {
255255
class Backend {
256256
val ref = Ref.toScalaComponent[Int, Unit, InnerScalaBackend]
257-
@nowarn def render = Forwarder.withRef(ref)("noice")
257+
def render = Forwarder.withRef(ref)("noice")
258258
}
259259
val C = ScalaComponent.builder[Unit]("X").renderBackend[Backend].build
260260
ReactTestUtils.withNewBodyElement { mountNode =>
@@ -267,7 +267,7 @@ object RefTest extends TestSuite {
267267
def mappedRef() = {
268268
class Backend {
269269
val ref = Ref.toScalaComponent(InnerScala).map(_.backend.gimmeHtmlNow())
270-
@nowarn def render = Forwarder.withRef(ref)("noice")
270+
def render = Forwarder.withRef(ref)("noice")
271271
}
272272
val C = ScalaComponent.builder[Unit]("X").renderBackend[Backend].build
273273
ReactTestUtils.withNewBodyElement { mountNode =>

0 commit comments

Comments
 (0)