用户脚本中规则的顺序有区别吗?

问题描述 投票:0回答:1

我最近正在创建一个用户脚本,我注意到人们在用户脚本中排序规则的方式存在显着差异?这真的很重要吗?

这样做:

// @name        Hello, name here!
// @author      Author is here!
// @description Description is here!
// @namespace   Namespace is here!

与此不同:

// @namespace   Namespace is here!
// @author      Author is here!
// @description Description is here!
// @name        Hello, name here!

所以我的问题是改变规则的顺序重要吗?有什么区别吗?还是这只是个人喜好问题?

javascript userscripts
1个回答
2
投票

元数据块条目由用户脚本管理器在内部处理。

条目的顺序大多并不重要,但也有一些例外:

  • @require
    条目在 FireMonkey 中按顺序处理(预计在其他管理器中也是如此)

就用户脚本本身而言,它们是 JavaScript 注释。

更多信息(按字母顺序排列)

© www.soinside.com 2019 - 2024. All rights reserved.