Skip to content

derjanb/eslint-plugin-userscripts

 
 

Repository files navigation

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

Rule Description Recommended
filename-user Ensures userscripts end with .user.js
no-invalid-grant Ensures the argument passed to @grant is valid
no-invalid-metadata Ensures userscripts have valid metadata
require-name Ensures userscripts have a name
require-description Ensures userscripts have a description
require-version Ensures userscripts have a valid version
use-homepage-and-url Ensures that for each homepage attribute, homepageURL is also used
use-download-and-update-url Ensures that for each downloadURL there is a updateURL
align-attributes Ensures that attributes are spaced out and aligned
require-attribute-space-prefix Ensure that attributes are prefixed by one space
no-invalid-headers Ensures userscripts have valid headers

About

ESLint Plugin for UserScripts

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.8%
  • Shell 0.2%