Skip to content

Simplesense

ESLint Config

Javascript, Node, Vue, and YAML

Simplesense

NPM Version

ESLint


Usage

In addition to eslint it's required that you install sort-package-json as a dev dependency and use it in the package scripts.

Install

bash
npm install eslint-config-simplesense sort-package-json -D

Configure eslint.config.js

javascript
module.exports = [
  ...require('eslint-config-simplesense'),
  {
    // your custom configuration
  }
]

Configure package.json

json
{
  "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}'"
  }
}

What's Included

Why Use a Linter?

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

Released under the Apache License 2.0.