Mana 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 consistently.
Installation
Install the package with:
yarn add eslint-config-mana --dev
eslint-config-mana
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 eslint-config-mana
ESLint Configuration
Now add eslint-config-mana
to your .eslintrc.js
:
module.exports = {
extends: ['eslint-config-mana'],
}
Prettier Configuration
This is how you can use or extend the eslint-config-mana
Prettier config in your app:
module.exports = require('eslint-config-mana/.prettierrc.js')
module.exports = {
...require('eslint-config-mana/.prettierrc.js'),
semi: true,
bracketSameLine: false,
}
Publishing
To publish, simply run npm publish
. Ensure that your NPM_TOKEN
is set in your environment variables. If you don't have access, make sure your npm user has permission to publish to the manafinance
npm organization.
Notes