$ cnpm install @octetstream/eslint-config
AirBnb-based ESlint config, tweaked for my needs.
pnpm add --dev @octetstream/eslint-config eslint
Create an .eslintrc.json at the root of your project and add the following content:
{
"extends": [
"@octetstream"
]
}
This section contains the list of rules that I changed comparad to AirBnb config.
semi// Good ????
const string = "On Soviet Moon landscape see binoculars through you!"
const doSomething = () => {}; // Good, because the next expression starts with an array declaration, but does not have an assignment
["SIGTERM", "SIGINT"].forEach(signal => process.on(signal, () => { process.exitCode = 0 }))
// Bad ????
const number = 42;
const person = {
firstName: "Luke",
lastName: "Skywalker"
};
quotes// Good ????
const firstString = "Just a string with double quotes."
const secondString = "This string contains \"escaped quotes\" in it."
const thirdString = 'This string also contains "quotes" in it.'
const fourthString = `Use template literal only if you need ${interpolation}.`
// Bad ????
const fifthString = 'Do not use signle quotes for strings.'
const sixthString = `Do not use template literal without interpolation.`
const over let if assigned value is not meant to be changed. Avoid var. Use const in destructuring only if none of values are meant to be changed. prefer-const// Good ????
const number = 42
let string = "Initial string value"
string = "Updated string value"
// Bad ????
var someVariable = 451
Copyright 2013 - present © cnpmjs.org | Home |