-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core: convert audit types to modules #12870
Conversation
|
||
/** | ||
* @param {LH.Audit.SimpleCriticalRequestNode} tree | ||
* @param {LH.Audit.Details.SimpleCriticalRequestNode} tree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
going through all of our d.ts
files, this was the only type change that needed to happen in a JS file. SimpleCriticalRequestNode
really is an audit details type, it just predates the file audit-details.d.ts
. Moving it to audit-details avoids a circular dependency of audit-details.d.ts
back to SimpleCriticalRequestNode
in audit.d.ts
.
@@ -5,7 +5,7 @@ | |||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | |||
*/ | |||
|
|||
import Audit = require('../lighthouse-core/audits/audit.js'); | |||
import AuditClass = require('../lighthouse-core/audits/audit.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is what I was talking about in #12860, where some changes lead to Audit
in this file to refer to the global LH.Audit
namespace, not this very explicit local import to a (type) variable named Audit
.
This can be reverted when config.d.ts
moves off global declarations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems there's nothing contentious about this. net positive all around. LGTM
To give an idea of what #12860 would look like, this moves
audit.d.ts
andaudit-details.d.ts
to exports instead of directly writing toglobal.LH.*
types, then starts a centralized place to do the global declaration to maintain current type behavior.Much easier to review with
?w=1
since there's an indentation change. Also divided into two commits if you want to see the changes to the two files (and associated references) separately.