Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 1.08 KB

metadata-spacing.md

File metadata and controls

48 lines (32 loc) · 1.08 KB

metadata-spacing

✅ The "extends": "plugin:userscripts/recommended" property in a configuration file enables this rule.

🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

The metadata-spacing rule ensures that there is a newline between the code and the metadata.

Why?

To follow best practices for userscript code styling.

Examples

👍 Examples of correct code for this rule

/* eslint userscripts/metadata-spacing: "error" */

// ==UserScript==
// @name         My UserScript
// @description  Empties the document
// ==/UserScript==

document.documentElement.remove();

👎︎ Examples of incorrect code for this rule

/* eslint userscripts/metadata-spacing: "error" */

// ==UserScript==
// @name         My UserScript
// @description  Empties the document
// ==/UserScript==
document.documentElement.remove();

When Not to Use It

Turn off this rule when your code style demands no newline between the code and the metadata.