4 us & 4 others ESLint + Prettier Configuration
Abstract
These are our shared settings for ESLint and Prettier. This ESLint configuration lints and formats our code so it follows our shared style guide. It uses ESLint to lint and fix Javascript, and Prettier to fix issues and format our code nicely.
Installation
Install the package with:
yarn add @4-us-4-others/eslint-config --dev
@4-us-4-others/eslint-config
requires you to take care of it's peerDependencies
. Install the correct version of each peerDependencies
package, which are listed with the following command:
npx install-peerdeps --dev @4-us-4-others/eslint-config
ESLint Configuration
Now add @4-us-4-others/eslint-config
to your .eslintrc.js
:
// .eslintrc.js
module.exports = {
extends: '@4-us-4-others/eslint-config',
}
Prettier Configuration
This is how you can use or extend the @4-us-4-others/eslint-config
Prettier config in your app:
// .prettierrc.js
module.exports = require('@4-us-4-others/eslint-config/.prettierrc.js')
// or to override specific options
module.exports = {
...require('@4-us-4-others/eslint-config/.prettierrc.js'),
semi: true,
bracketSameLine: false,
}
Development
# first, make sure your working tree is clean by committing all your work
git add . && git commit -m "your release notes"
# publish to npm
yarn publish
# `yarn publish` will ask you for a new version number, follow semver
Notes
- The structure of this package is based on
natterstefan/eslint-config-ns