4.1.7 • Published 4 months ago

eslint-config-plus-prettier v4.1.7

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

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-prettier

Add 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:

dist

Configure 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.md

Configure 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:lint
  • lint will check for errors and fix formatting in .ts and .js files.
  • format will apply format rules to all possible files.
  • package:lint will warn of any inconsistencies in the package.json file.
4.1.7

4 months ago

4.1.6

5 months ago

4.1.5

6 months ago

4.1.4

8 months ago

4.1.3

8 months ago

4.1.0

8 months ago

4.1.2

8 months ago

4.1.1

8 months ago

1.6.0

9 months ago

2.0.0

9 months ago

1.7.0-rc.0

9 months ago

3.0.0

9 months ago

4.0.0-rc.1

8 months ago

4.0.0-rc.0

8 months ago

4.0.0-rc.2

8 months ago

4.0.0

8 months ago

2.0.0-rc.2

9 months ago

2.0.0-rc.0

9 months ago

2.0.0-rc.1

9 months ago

1.7.1

9 months ago

1.7.0

9 months ago

3.0.0-rc.1

9 months ago

3.0.0-rc.0

9 months ago

1.5.18

9 months ago

1.5.17

9 months ago

1.5.10

11 months ago

1.5.12

10 months ago

1.5.11

11 months ago

1.5.14

10 months ago

1.5.13

10 months ago

1.5.15

9 months ago

1.5.9

12 months ago

1.5.8

12 months ago

1.5.7

1 year ago

1.5.5

1 year ago

1.5.4

1 year ago

1.5.3

1 year ago

1.5.6

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.2.1

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.2-alpha-10

2 years ago

1.0.2-alpha-8

2 years ago

1.0.2-alpha-7

2 years ago

1.0.2-alpha-6

2 years ago