0.3.0 • Published 6 months ago

@meludi/eslint-config-prettier v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@meludi/eslint-config-prettier

NPM Package GitHub issues GitHub license

This package provides Prettier settings as an shareable configuration.

Installation

Install the package with:

$ npm i -D @meludi/eslint-config-prettier

Find out and install peerDependencies.

$ npm info "@meludi/eslint-config-prettier@latest" peerDependencies

Entry points

  • @meludi/eslint-config-prettier
  • @meludi/eslint-config-prettier/vue

Usage

If you did not already have .eslintrc.js and prettier.config.js configuration files in the root of your project create them.

Add the following to your .eslintrc.js:

// .eslintrc.js
module.exports = {
  extends: [
    // ... other configs

    // Make sure to put prettier last, so it gets the chance to override other configs.
    '@meludi/eslint-config-prettier',

    // Vue
    // '@meludi/eslint-config-prettier/vue',
  ],
};

Add the following to your prettier.config.js:

// prettier.config.js
module.exports = require('@meludi/eslint-config-prettier/prettier.config');

NPM script

Add the following script to your package.json for easy usage:

"scripts": {
  "format": "prettier --write './**/*.{js,jsx,ts,tsx,vue,md,mdx,json}'"
}

Recommendation

Add the following config files to the root of your project:

VS Code

Copy .vscode.example to the root of your project and rename it to .vscode.

LICENSE

MIT