This package provides shared ESLint and Prettier configurations specifically for TypeScript projects. It is designed to ensure adherence to coding standards and consistent formatting across different projects.
Add the package to your project to enable uniform code formatting:
npm i -D o4b-formatter-typescript
After installation, you can reference the shared configurations in your project configuration files.
Create a .eslintrc.json
at the root of your project (or update the existing one) extending the configuration from o4b-formatter-typescript
:
{
"extends": [
"./node_modules/o4b-formatter-typescript/eslint"
]
}
Create a .prettierrc.json
at the root of your project (or update the existing one) and import the configuration from o4b-formatter-typescript
by adding only this one line:
"./node_modules/o4b-formatter-typescript/prettier.config"
Please note that this method does not offer a way to extend the configuration to overwrite some properties from the shared configuration. If you need to do that, please check the Prettier Documentation page.
As of NPM version 7, peer dependencies are installed automatically. If you are using an older version of NPM and want to install all peer dependencies automatically, you can use install-peerdeps
:
npx install-peerdeps o4b-formatter-typescript --dev
Make sure you have all the necessary peer dependencies installed to avoid compatibility issues.
If you have any questions or encounter issues with using o4b-formatter-typescript
, please create an issue on the GitHub Issues page.
Visit the project homepage for more information and updates.