gpt4 book ai didi

javascript - 'Google JavaScript Style Guide' 中描述的 JavaScript 源文件是什么

转载 作者:行者123 更新时间:2023-11-28 10:46:17 25 4
gpt4 key购买 nike

我还是个新手。我正在阅读“Google JS 样式指南”。我想知道 - section 3 'Source File Structure' 是什么?引用?开始:

A source file consists of, in order:

  1. License or copyright information, if present
  2. @fileoverview JSDoc, if present
  3. goog.module statement
  4. goog.require statements
  5. The file's implementation

最佳答案

    /**     * @fileoverview Description of file, its uses and information     * about its dependencies.     * @package     */    goog.module('my.test.helpers');    goog.module.declareLegacyNamespace();    goog.setTestOnly();    const MyClass = goog.require('some.package.MyClass');    const NsMyClass = goog.require('other.ns.MyClass');

基本上就是上面的格式。我认为这个例子使用了谷歌闭包库。

https://github.com/google/closure-library

关于javascript - 'Google JavaScript Style Guide' 中描述的 JavaScript 源文件是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42279827/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com