7.6.0 • Published 1 month ago

@4s1/eslint-config v7.6.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

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
7.6.0

1 month ago

7.5.0

2 months ago

7.4.0

4 months ago

7.3.0

5 months ago

7.2.0

6 months ago

7.0.0

10 months ago

7.1.1

10 months ago

7.1.0

10 months ago

6.7.0

10 months ago

6.5.0

1 year ago

6.6.0

12 months ago

6.4.0

1 year ago

6.1.0

1 year ago

6.3.0

1 year ago

6.2.0

1 year ago

5.0.0

1 year ago

6.0.0

1 year ago

4.3.0

1 year ago

4.2.0

1 year ago

3.17.0

2 years ago

4.1.0

1 year ago

4.0.1

2 years ago

4.0.0

2 years ago

3.15.0

2 years ago

3.16.0

2 years ago

3.14.1

2 years ago

3.14.0

2 years ago

3.13.0

2 years ago

3.13.2

2 years ago

3.13.1

2 years ago

3.11.0

2 years ago

3.10.0

2 years ago

3.12.0

2 years ago

3.9.0

2 years ago

3.7.0

2 years ago

3.6.0

2 years ago

3.5.0

2 years ago

3.4.0

2 years ago

3.3.0

2 years ago

3.2.2

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago