SmartHR Prettier Config

raw JSON →
1.0.1 verified Sat Apr 25 auth: no javascript

A sharable Prettier configuration package for SmartHR, version 1.0.1, stable. It provides a consistent code formatting standard for SmartHR projects. The config is minimal and intended to be extended. It is part of the tamatebako monorepo alongside eslint-config-smarthr and eslint-plugin-smarthr. Differentiator: official SmartHR config, integrates with the SmartHR toolchain.

error Error: Cannot find module 'prettier-config-smarthr'
cause Package not installed or not in node_modules.
fix
Run npm install --save-dev prettier-config-smarthr
error Invalid configuration: Module 'prettier-config-smarthr' was not found.
cause Prettier cannot resolve the config package.
fix
Ensure prettier-config-smarthr is installed and your Prettier config file correctly references it.
gotcha Package is CommonJS only, ESM projects need to use a dynamic import or convert to CJS.
fix Use require() or create a wrapper that uses createRequire.
gotcha Do not forget to install Prettier as a dev dependency – this package does not include Prettier.
fix Run npm install --save-dev prettier
npm install prettier-config-smarthr
yarn add prettier-config-smarthr
pnpm add prettier-config-smarthr

Shows how to extend and override the SmartHR Prettier config in a .prettierrc.js file.

const prettierConfig = require('prettier-config-smarthr');
module.exports = {
  ...prettierConfig,
  semi: true,
  singleQuote: true
};