🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

eslint-config-plus-prettier

Package Overview
Dependencies
Maintainers
1
Versions
58
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 and Prettier

1.5.2
npm
Version published
Weekly downloads
12
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-plus-prettier

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

Install

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

Add the following scripts to your package.json:

"scripts": {
  "lint": "eslint . --ext .ts,.js --fix",
  "format": "prettier --write ."
}

Configure ESLint

Add a .eslintrc.json file with the following:

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

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/.prettierrc.json"

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

package-lock.json
CHANGELOG.md

Configure TSConfig (optional)

Add a tsconfig.json file with the following:

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

Use

npm run lint
npm run format
  • Linting will check for errors and fix formatting in .ts and .js files.
  • Formatting will apply format rules to all possible files.

FAQs

Package last updated on 01 Jun 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