4.1.7 • Published 3 months ago

eslint-config-plus-prettier v4.1.7

Weekly downloads
-
License
ISC
Repository
-
Last release
3 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

3 months ago

4.1.6

4 months ago

4.1.5

5 months ago

4.1.4

6 months ago

4.1.3

7 months ago

4.1.0

7 months ago

4.1.2

7 months ago

4.1.1

7 months ago

1.6.0

7 months ago

2.0.0

7 months ago

1.7.0-rc.0

7 months ago

3.0.0

7 months ago

4.0.0-rc.1

7 months ago

4.0.0-rc.0

7 months ago

4.0.0-rc.2

7 months ago

4.0.0

7 months ago

2.0.0-rc.2

7 months ago

2.0.0-rc.0

7 months ago

2.0.0-rc.1

7 months ago

1.7.1

7 months ago

1.7.0

7 months ago

3.0.0-rc.1

7 months ago

3.0.0-rc.0

7 months ago

1.5.18

7 months ago

1.5.17

8 months ago

1.5.10

10 months ago

1.5.12

9 months ago

1.5.11

9 months ago

1.5.14

8 months ago

1.5.13

9 months ago

1.5.15

8 months ago

1.5.9

10 months ago

1.5.8

11 months ago

1.5.7

11 months ago

1.5.5

11 months ago

1.5.4

11 months ago

1.5.3

11 months ago

1.5.6

11 months 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

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.3

1 year ago

1.2.1

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.2

1 year ago

1.0.2-alpha-10

1 year ago

1.0.2-alpha-8

1 year ago

1.0.2-alpha-7

1 year ago

1.0.2-alpha-6

1 year ago