eslint-config-healthsparq
v4.0.0
Published
HealthSparq OSL Style Standards
Downloads
23
Readme
HealthSparq standards and ESLint configs with dependencies for JavaScript projects.
Installing
Adding this package as a dev dependency will also add all of the dependencies needed to run the ESLint plugins. Prettier must be installed as a project dependency, this ensures that editors use the correct version.
npm i eslint-config-healthsparq prettier --D
If you are using the web configuration, install the webpack resolver as well:
npm i eslint-import-resolver-webpack --D
Usage
The package includes separate configurations for web and Node projects, extend the appropriate config:
Web project
// .eslintrc.js
module.exports = { extends: 'healthsparq/web' }
Node project
// .eslintrc.js
module.exports = { extends: 'healthsparq/node' }
Code quality standards
Code quality linting uses the Airbnb rule set. The only rule that is different is
no-use-before-define, which
has option functions
true. This lets us always declare Component propTypes before
the Component definition, even for functional stateless components, by using
function declarations:
import React from 'react'
HealthCare.propTypes = {
description: string
}
HealthCare.defaultProps = {
description: 'RAD'
}
export default function HealthCare({ description }) {
return <h1>HealthSparq makes health care {description}!</h1>
}
Code formatting standards
All code formatting is done by Prettier. HealthSparq uses the following Prettier configs:
- Print Width 84: Using a slightly wider print width gives us 80 useable characters for code, even inside of class methods.
- Single Quotes: Easier to type!
- No Semis: Less noise makes code more readable.