stylelint-config-prettier

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

Turns off all Stylelint rules that are unnecessary or might conflict with Prettier, allowing you to use your favorite shareable Stylelint config without its stylistic choices interfering. Current stable version is 9.0.5, released January 2023. The package is maintained sporadically; it disables stylistic rules so Prettier can take over formatting. As of Stylelint v15 (released February 2023), the stylistic rules have been deprecated, making this package unnecessary for users on v15+ who do not use deprecated rules. It includes a CLI helper to check for conflicting rules. Peer dependency ranges: stylelint >= 11.x < 15.

error Configuration for rule "color-no-invalid-hex" is invalid: Expected a boolean value
cause stylelint-config-prettier disables rules by setting them to null, which newer stylelint versions reject.
fix
Update to stylelint 14.x (or use stylelint-config-prettier v9+). In stylelint 15+, this package may not be needed.
error Cannot find module 'stylelint-config-prettier'
cause Package may not be installed or node_modules path missing.
fix
Run npm install --save-dev stylelint-config-prettier. Check that it's listed in devDependencies.
error cli: stylelint-config-prettier-check: command not found
cause The bin script is not in PATH, usually when using npx without a package.json script or without installing locally.
fix
Add a script in package.json: "stylelint-check": "stylelint-config-prettier-check" and run npm run stylelint-check.
error Stylelint v15: Extending 'stylelint-config-prettier' has no effect since stylistic rules are deprecated.
cause After upgrading to stylelint v15, the package disables rules that are already deprecated.
fix
Remove stylelint-config-prettier from extends and update your stylelint config accordingly.
deprecated As of Stylelint v15, all style-related rules have been deprecated. This package is unnecessary for users on v15+ who are not using deprecated rules.
fix Remove stylelint-config-prettier from your extends array. Ensure your stylelint config does not rely on deprecated stylistic rules.
breaking v9.0.0 drops some SCSS rules and sorts rules; may cause conflicts if SCSS plugin not installed.
fix Install stylelint-scss plugin if using SCSS and updating from v8.
gotcha Must be the last entry in the extends array to override other configs.
fix Ensure 'stylelint-config-prettier' is appended after all other configs in extends.
breaking v8.0.0 disables rules linebreaks, no-empty-first-line, and unicode-bom; min stylelint version bumped to 11.
fix Update stylelint to v11+ and verify rules are disabled as expected.
deprecated v6.0.0 security release updated dependencies; older versions may have vulnerability.
fix Update to v6.0.0 or later to get security fixes.
npm install stylelint-config-prettier
yarn add stylelint-config-prettier
pnpm add stylelint-config-prettier

Shows how to install, extend the config (last place), and run the CLI check tool.

npm install --save-dev stylelint-config-prettier stylelint@14
# .stylelintrc.js
module.exports = {
  extends: [
    'stylelint-config-standard',
    'stylelint-config-prettier'
  ]
};
// Check for conflicts:
// Add to package.json scripts: "stylelint-check": "stylelint-config-prettier-check"
// Run: npm run stylelint-check