@4s1/eslint-config v7.6.0
ESLint and Prettier Config
These are settings for ESLint and Prettier.
Setup
Add ESLint, Prettier and configuration packages to your project:
# pnpm
pnpm add eslint prettier @4s1/eslint-config -D
# npm
npm install eslint prettier @4s1/eslint-config -D
Add scripts for linting into package.json
:
npm pkg set scripts.lint="eslint --ext .ts src/ && prettier --check ."
npm pkg set scripts.lint:fix="eslint --ext .ts --fix src/ && prettier --write ."
ESLint config
Create a .eslintrc.yaml
file in your project root folder and add reference to the configuration:
echo "root: true" > .eslintrc.yaml
echo "extends:" >> .eslintrc.yaml
echo " - '@4s1/eslint-config/.eslintrc.yaml'" >> .eslintrc.yaml
Prettier config
Add prettier configuration into package.json
:
npm pkg set prettier="@4s1/eslint-config"
Add script command into package.json
to run prettier:
npm pkg set scripts.format="prettier --write ."
Create a .prettierignore
file in your project root folder and add some exceptions:
echo "/coverage/" > .prettierignore
echo "/dist/" >> .prettierignore
echo "/pnpm-lock.yaml" >> .prettierignore
echo "/package-lock.json" >> .prettierignore
1 month ago
2 months ago
4 months ago
5 months ago
6 months ago
10 months ago
10 months ago
10 months ago
10 months ago
1 year 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
2 years 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
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago