New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

eslint-plugin-userscripts

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-userscripts

Implements rules for userscripts metadata in eslint

0.2.8
Version published
Weekly downloads
2.6K
-6.94%
Maintainers
1
Weekly downloads
 
Created

eslint-plugin-userscripts

codecov

Implements rules for userscripts in eslint.

Installation

You'll first need to install ESLint:

npm install eslint --save-dev

Next, install eslint-plugin-userscripts:

npm install eslint-plugin-userscripts --save-dev

Usage

Add userscripts to the plugins section of your .eslintrc configuration file:

{
  "extends": ["plugin:userscripts/recommended"]
}

Supported Rules

RuleDescriptionRecommended
filename-userEnsures userscripts end with .user.js
no-invalid-grantEnsures the argument passed to @grant is valid
no-invalid-metadataEnsures userscripts have valid metadata
require-nameEnsures userscripts have a name
require-descriptionEnsures userscripts have a description
require-versionEnsures userscripts have a valid version
use-homepage-and-urlEnsures that for each homepage attribute, homepageURL is also used
use-download-and-update-urlEnsures that for each downloadURL there is a updateURL
align-attributesEnsures that attributes are spaced out and aligned
require-attribute-space-prefixEnsure that attributes are prefixed by one space
metadata-spacingEnsures there is a newline between the metadata and the code
no-invalid-headersEnsures userscripts have valid headers
compat-grantEnsures your @grant permissions are supported
compat-headersEnsures your headers are supported
better-use-matchPrefers @match over @include

FAQs

Package last updated on 09 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts