SimplesenseESLint Config
Javascript, Node, Vue, and YAML
In addition to eslint
it's required that you install sort-package-json
as a dev dependency and use it in the package scripts.
npm install eslint-config-simplesense sort-package-json -D
module.exports = [
...require('eslint-config-simplesense'),
{
// your custom configuration
}
]
{
"scripts": {
"lint": "npm run lint:package-json && npm run lint:eslint",
"lint:package-json": "sort-package-json",
"lint:eslint": "eslint --fix '**/*.{js,vue,yaml,yml}'"
}
}
Well run projects have clear consistent coding conventions, with automated enforcement. Not having coding conventions is also a barrier to attracting contributions, and depending on a project that does not welcome (quality!) contributions is itself a risk. Besides checking style, linters are also excellent tools for finding certain classes of bugs, such as those related to variable scope. Assignment to undeclared variables (these leak into the global scope, contaminating it and possibly causing very difficult to find bugs) and use of undefined variables are examples of errors that are detectable at lint time.
-- Sam Roberts