eslint-config-plus-prettier 1.7.0-rc.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +47 -18
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,59 +1,88 @@
1
1
  # eslint-config-plus-prettier
2
2
 
3
- Standard config for ESLint and Prettier. Also includes an optional TSConfig.
3
+ Standard config for ESLint, Prettier and Package Lint. Also includes an optional TSConfig.
4
4
 
5
5
  ## Install
6
6
 
7
- npm install --save-dev eslint-config-plus-prettier
7
+ ```bash
8
+ npm install --save-dev eslint-config-plus-prettier
9
+ ```
8
10
 
9
11
  Add the following scripts to your `package.json`:
10
12
 
13
+ ```json
11
14
  "scripts": {
12
15
  "format": "prettier --write .",
13
16
  "format:check": "prettier --check .",
14
17
  "lint": "eslint . --ext .ts,.js --fix",
15
- "lint:check": "eslint . --ext .ts,.js"
18
+ "lint:check": "eslint . --ext .ts,.js",
19
+ "package:lint": "npx npm-package-json-lint ."
16
20
  }
21
+ ```
17
22
 
18
23
  ### Configure ESLint
19
24
 
20
25
  Add a `.eslintrc.json` file with the following:
21
26
 
22
- {
23
- "extends": "eslint-config-plus-prettier"
24
- }
27
+ ```json
28
+ {
29
+ "extends": "eslint-config-plus-prettier"
30
+ }
31
+ ```
25
32
 
26
33
  Consider adding a `.eslintignore` file to avoid trying to lint compiled code in the `dist` folder:
27
34
 
28
- dist
35
+ ```text
36
+ dist
37
+ ```
29
38
 
30
39
  ### Configure Prettier
31
40
 
32
41
  Add prettier config to `package.json`:
33
42
 
43
+ ```json
34
44
  "prettier": "eslint-config-plus-prettier/.prettierrc.json"
45
+ ```
35
46
 
36
47
  Consider adding a `.prettierignore` file to avoid formatting generated files:
37
48
 
38
- package-lock.json
39
- CHANGELOG.md
49
+ ```text
50
+ package-lock.json
51
+ CHANGELOG.md
52
+ ```
53
+
54
+ ### Configure Package Lint
55
+
56
+ Add a `.npmpackagejsonlintrc.json` file with the following:
57
+
58
+ ```json
59
+ {
60
+ "extends": "eslint-config-plus-prettier/.npmpackagejsonlintrc.json"
61
+ }
62
+ ```
40
63
 
41
64
  ### Configure TSConfig (optional)
42
65
 
43
66
  Add a `tsconfig.json` file with the following:
44
67
 
45
- {
46
- "extends": "eslint-config-plus-prettier/tsconfig.json",
47
- "include": ["src"], // Files to be compiled
48
- "compilerOptions": {
49
- "outDir": "dist" // Compiled directory
50
- }
51
- }
68
+ ```json
69
+ {
70
+ "extends": "eslint-config-plus-prettier/tsconfig.json",
71
+ "include": ["src"], // Files to be compiled
72
+ "compilerOptions": {
73
+ "outDir": "dist" // Compiled directory
74
+ }
75
+ }
76
+ ```
52
77
 
53
78
  ## Use
54
79
 
55
- npm run lint
56
- npm run format
80
+ ```bash
81
+ npm run lint
82
+ npm run format
83
+ npm run package:lint
84
+ ```
57
85
 
58
86
  - `lint` will check for errors and fix formatting in `.ts` and `.js` files.
59
87
  - `format` will apply format rules to all possible files.
88
+ - `package:lint` will warn of any inconsistencies in the `package.json` file.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-config-plus-prettier",
3
- "version": "1.7.0-rc.0",
4
- "description": "Standard config for ESLint and Prettier",
3
+ "version": "1.7.0",
4
+ "description": "Standard config for ESLint, Prettier and Package Lint. Also includes an optional TSConfig.",
5
5
  "license": "ISC",
6
6
  "author": "aimee rivers",
7
7
  "files": [