eslint-config-plus-prettier v4.1.7
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-prettierAdd 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:
distConfigure 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.mdConfigure 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:lintlintwill check for errors and fix formatting in.tsand.jsfiles.formatwill apply format rules to all possible files.package:lintwill warn of any inconsistencies in thepackage.jsonfile.
10 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago