Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including @swissquote/eslint-plugin-swissquote with all npm packages installed. Try it out:

var eslintPluginSwissquote = require("@swissquote/eslint-plugin-swissquote")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@swissquote/eslint-plugin-swissquote v1.12.0

Swissquote ESLint preset

Features

  • Provide a style guide for your JavaScript
  • Warns on common mistakes in JavaScript
  • Works with EcmaScript 2015+ using the babel-eslint parser

Presets

This plugin comes with four presets

  • format Base formatting rules, should work on any code (included in legacy and recommended)
  • node Adds environment information for Node.js
  • legacy For all your EcmaScript 5 code
  • recommended For all your EcmaScript 2015+ code, also contains rules for React

Included plugins

the recommended preset includes three plugins:

  • eslint-plugin-import provides some rules to clean imports.
  • eslint-plugin-react ensures you follow some best practices with React.
  • eslint-plugin-sonarjs provides some advanced rules made by the guys at SonarQube.

To make it easy to install this plugin, those rules are added to ESLint automatically, but prefixed with swissquote/. This is due to a limitation with ESLint that doesn't allow us to add plugins to ESLint through an API.

Usage

Include them with in your projects like this:

{
  "plugins": ["@swissquote/swissquote"],
  "extends": ["plugin:@swissquote/swissquote/recommended"]
}
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free