1.4.3 • Published 1 month ago
eslint-config-plus-prettier v1.4.3
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.
1.4.3
1 month ago
1.4.2
2 months ago
1.4.1
2 months ago
1.4.0
5 months ago
1.3.0
5 months ago
1.2.0
5 months ago
1.1.3
5 months ago
1.2.1
5 months ago
1.1.2
5 months ago
1.1.1
5 months ago
1.1.0
5 months ago
1.0.2
5 months ago
1.0.2-alpha-10
5 months ago
1.0.2-alpha-8
5 months ago
1.0.2-alpha-7
5 months ago
1.0.2-alpha-6
5 months ago