eslint-config-plus-prettier 1.7.0-rc.0 → 1.7.1
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.
- package/README.md +47 -18
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,59 +1,88 @@
|
|
|
1
1
|
# eslint-config-plus-prettier
|
|
2
2
|
|
|
3
|
-
Standard config for ESLint and
|
|
3
|
+
Standard config for ESLint, Prettier and Package Lint. Also includes an optional TSConfig.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
39
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
56
|
-
|
|
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.
|
|
4
|
-
"description": "Standard config for ESLint and
|
|
3
|
+
"version": "1.7.1",
|
|
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": [
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"package:lint": "npx npm-package-json-lint ."
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@typescript-eslint/parser": "^8.
|
|
23
|
-
"eslint": "^8.57.
|
|
22
|
+
"@typescript-eslint/parser": "^8.13.0",
|
|
23
|
+
"eslint": "^8.57.1",
|
|
24
24
|
"eslint-config-prettier": "^9.1.0",
|
|
25
25
|
"eslint-plugin-import": "^2.31.0",
|
|
26
26
|
"eslint-plugin-prettier": "^5.2.1",
|