1Password Front-End Style
This package contains config for 1Password front-end code style using Prettier, ESLint, and Stylelint.
Usage
After installing, you'll need to configure your project to use these styles:
Prettier
Add to your package.json
file:
"prettier": "@1password/front-end-style/prettierrc.json"
ESLint
Create an eslintrc.yml
file:
---
extends:
- "@1password/front-end-style/eslintrc.yml"
Stylelint
Add to your package.json
file:
"stylelint": {
"extends": "@1password/front-end-style/stylelintrc.yml"
}
SVG Lint
A basic SVG linting tool is included as well, which checks for unnecessary line breaks and tags.
Run with svglint [directory]
IDE Extensions
You should also install the related IDE extensions so you can see issues (and sometimes get them auto-fixed) as you code.
-
Prettier
-
ESLint
-
Stylelint
Versioning Expectations
We'll be using semantic versioning when updating the package version number. The following is used to differentiate between the version identifiers.
Format: major
.minor
.patch
-
major
: Any breaking change
- Example:
- Adding a package with new rules
- Upgrading errors (warn to error)
major
version bump of any NPM dependencies in package.json
-
minor
: Any non-breaking change affecting the functionality of the package
- Example:
- Downgrading errors (error to warn)
minor
version bump of any NPM dependencies in package.json
, but no major
version bump
-
patch
: Any change not affecting the functionality of the package
- Example:
- Changing code comments
- Changing the error message of a custom rule
- Only
patch
version bumps of NPM dependencies in package.json
- Updating
yarn.lock