Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-plus-prettier

Package Overview
Dependencies
Maintainers
0
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-plus-prettier

Standard config for ESLint, Prettier and Package Lint. Also includes an optional TSConfig.

  • 4.1.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

eslint-config-plus-prettier

Standard config for ESLint, Prettier and Package Lint. Also includes an optional TSConfig.

Install

npm install --save-dev eslint-config-plus-prettier

Add the following scripts to your package.json:

    "scripts": {
      "format": "prettier --write .",
      "format:check": "prettier --check .",
      "lint": "eslint --fix",
      "lint:check": "eslint",
      "package:lint": "npx npm-package-json-lint ."
    }

Configure ESLint

Add a eslint.config.js file with the following:

import config from "eslint-config-plus-prettier";

export default [config];

Consider adding a .eslintignore file to avoid trying to lint compiled code in the dist folder:

dist

Configure Prettier

Add prettier config to package.json:

    "prettier": "eslint-config-plus-prettier/prettier"

Consider adding a .prettierignore file to avoid formatting generated files:

package-lock.json
CHANGELOG.md

Configure Package Lint

Add a .npmpackagejsonlintrc.json file with the following:

If you are working on a module:

{
  "extends": "eslint-config-plus-prettier/packagelint"
}

If you are working on a server, that needs fixed dependencies:

{
  "extends": "eslint-config-plus-prettier/packagelint/server"
}

Configure TSConfig (optional)

Add a tsconfig.json file with the following:

{
  "extends": "eslint-config-plus-prettier/tsconfig",
  "include": ["src"], // Files to be compiled
  "compilerOptions": {
    "outDir": "dist" // Compiled directory
  }
}

Use

npm run lint
npm run format
npm run package:lint
  • lint will check for errors and fix formatting in .ts and .js files.
  • format will apply format rules to all possible files.
  • package:lint will warn of any inconsistencies in the package.json file.

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc