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.
console.log('foo');
console.log("foo");
References
Use const
or let
instead of var
.
var foo = require("foo");
const foo = require("foo");
Functions
Use ES6 arrow functions when using function expressions.
doCallback("foo", true, function () {
doSomething();
});
doCallback("foo", true, () => {
doSomething();
});
Objects
Create objects with {}
instead of new Object()
.
let foo = new Object();
let foo = {};
Arrays
Create arrays with []
instead of new Array()
let foo = new Array();
let foo = [];
Primitives
Create primitives with their function wrappers or the actual value itself instead of using a new
wrapper.
let foo = new String("foo");
let foo = "foo";
Semicolons
Semicolons are required at the end of lines.
;let foo = "foo";
let foo = "foo";
Commas
Commas cannot have a space before it and must have a space after it.
const foo = ["bar" ,"foo"];
const foo = ["bar", "foo"];