@davidsneighbour/prettier-config
is a shared Prettier configuration for my projects. It's uses the ESM format and exports an object with the configuration.
Install the plugin:
npm install --save-dev @davidsneighbour/prettier-config
There are several ways to add a configuration, but the following are the config options I advise to use @davidsneighbour/prettier-config
without or with overrides.
Add a key to your package.json
file:
{
"prettier": "@davidsneighbour/prettier-config"
}
or create a .prettierrc.js
file and export an object that overrides settings:
import prettierConfig from "@davidsneighbour/prettier-config";
export default {
...prettierConfig,
// Add your overrides here.
};
If your project does not uses the ESM format, you need to use the .mjs
extension for this file.
This configuration implements Tailwind's Prettier Plugin. To activate it either have a tailwind.config.js
in your project root or override the prettier configuration at tailwindConfig
with the proper path.
const defaultConfiguration = require("@davidsneighbour/prettier-config");
const localConfiguration = {
tailwindConfig: "new path to your config",
};
const configuration = {
...defaultConfiguration,
...localConfiguration,
};
module.exports = configuration;
Configurations | ||
---|---|---|
Build Tools | ||
Babel | Webpack | |
Testing | ||
Cypress | HTML Validate | |
Linters and Formatters | ||
Browserslist | ESLint | PostCSS |
Prettier | Stylelint | |
Project Management | ||
Commitlint | Release | |
Markdown and Writing | ||
Markdownlint | Remark Lint | |
Other Tools | ||
Bootstrap | Tools |