Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

36 lines
1.3 KiB
Plaintext

== Why is this an issue?
On the principle that clearer code is better code, you should explicitly ``++import++`` the things you want to use in a module. Using ``++import *++`` imports everything in the module, and runs the risk of confusing maintainers. Similarly, ``++export * from "module";++`` imports and then re-exports everything in the module, and runs the risk of confusing not just maintainers but also users of the module.
=== Noncompliant code example
[source,javascript]
----
import * as Imported from "aModule"; // Noncompliant
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Explicitly import the specific member needed.
'''
== Comments And Links
(visible only on this page)
=== on 5 Feb 2016, 15:31:27 Elena Vilchik wrote:
\[~ann.campbell.2] Actually there is no problems with scopes or name conflicts when using wildcard in JS: all you have imported are properties of ``++Imported++``. So I would just remove first sentence and keep the second one reworked a bit: "Listing the necessary imports makes clear what's wanted."
=== on 5 Feb 2016, 16:39:27 Ann Campbell wrote:
See what you think now [~elena.vilchik]
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]