文件应该命名为 something-with-hyphens.js、camelCased.js 还是其他名称?
我没有找到这个问题的答案 here .
最佳答案
一种可能的命名约定是使用类似于 jQuery 使用的命名方案。它没有被普遍采用,但很常见。
product-name.plugin-ver.sion.filetype.js
product-name
+ plugin
对也可以代表 namespace and a module . version
和 filetype
通常是可选的。
filetype
可以是与文件内容有关的东西。常见的有:
min
用于缩小文件custom
用于自定义构建或修改的文件
例子:
jquery-1.4.2.min.js
jquery.plugin-0.1.js
myapp.invoice.js
关于javascript - 什么是 javascript 文件名命名约定?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7273316/