Socket
Socket
Sign inDemoInstall

eslint-config-swordcss

Package Overview
Dependencies
104
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-config-swordcss

Shareable ESLint Config


Version published
Weekly downloads
1
decreased by-88.89%
Maintainers
1
Install size
4.09 kB
Created
Weekly downloads
 

Readme

Source

SwordCSS ESLint Config

⚔️A shareable ESLint Config⚔️

Overview

This is an eslint shareable config that is used for swordcss projects. This extends the recommended eslint config.


Quotes

Quotes must use double quotes.

// Bad
console.log('foo');
// Good
console.log("foo");

References

Use const or let instead of var.

// Bad
var foo = require("foo");
// Good
const foo = require("foo");

Functions

Use ES6 arrow functions when using function expressions.

// Bad
doCallback("foo", true, function () {
  doSomething();
});
// Good
doCallback("foo", true, () => {
  doSomething();
});

Objects

Create objects with {} instead of new Object().

// Bad
let foo = new Object();
// Good
let foo = {};

Arrays

Create arrays with [] instead of new Array()

// Bad
let foo = new Array();
// Good
let foo = [];

Primitives

Create primitives with their function wrappers or the actual value itself instead of using a new wrapper.

// Bad
let foo = new String("foo");
// Good
let foo = "foo";

Semicolons

Semicolons are required at the end of lines.

// Bad
;let foo = "foo";
// Good
let foo = "foo";

Commas

Commas cannot have a space before it and must have a space after it.

// Bad
const foo = ["bar" ,"foo"];
// Good
const foo = ["bar", "foo"];

Keywords

FAQs

Last updated on 16 Oct 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc