@commission-on-post/eslint-config-recommended 0.4.3 → 0.6.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.
- package/.eslintrc.js +36 -22
- package/README.md +4 -4
- package/index.js +1 -1
- package/package.json +12 -7
package/.eslintrc.js
CHANGED
|
@@ -9,7 +9,8 @@ module.exports = {
|
|
|
9
9
|
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
|
10
10
|
],
|
|
11
11
|
plugins: [
|
|
12
|
-
"@typescript-eslint"
|
|
12
|
+
"@typescript-eslint",
|
|
13
|
+
"import/no-duplicates" // This was imported to replace the rule `no-duplicate-imports`
|
|
13
14
|
],
|
|
14
15
|
rules: {
|
|
15
16
|
/*
|
|
@@ -104,10 +105,11 @@ module.exports = {
|
|
|
104
105
|
"@typescript-eslint/no-dupe-class-members": [
|
|
105
106
|
"error"
|
|
106
107
|
],
|
|
107
|
-
|
|
108
|
+
// Rule updated from `no-duplicate-imports`
|
|
109
|
+
"import/no-duplicates": [
|
|
108
110
|
"error",
|
|
109
111
|
{
|
|
110
|
-
"
|
|
112
|
+
"prefer-inline": true
|
|
111
113
|
}
|
|
112
114
|
],
|
|
113
115
|
"@typescript-eslint/no-empty-function": [
|
|
@@ -249,7 +251,7 @@ module.exports = {
|
|
|
249
251
|
{
|
|
250
252
|
"arraysInArrays": false,
|
|
251
253
|
"objectsInArrays": true,
|
|
252
|
-
"singleValue":
|
|
254
|
+
"singleValue": false
|
|
253
255
|
}
|
|
254
256
|
],
|
|
255
257
|
"arrow-body-style": [
|
|
@@ -555,7 +557,7 @@ module.exports = {
|
|
|
555
557
|
"ExportDeclaration": "never",
|
|
556
558
|
"ImportDeclaration": "never",
|
|
557
559
|
"ObjectExpression": {
|
|
558
|
-
"minProperties": 3
|
|
560
|
+
"minProperties": 2 // Updated from 3
|
|
559
561
|
},
|
|
560
562
|
"ObjectPattern": {
|
|
561
563
|
"multiline": true
|
|
@@ -742,8 +744,8 @@ module.exports = {
|
|
|
742
744
|
"fields"
|
|
743
745
|
],
|
|
744
746
|
"@typescript-eslint/consistent-indexed-object-style": [
|
|
745
|
-
"
|
|
746
|
-
"
|
|
747
|
+
"warn",
|
|
748
|
+
"record"
|
|
747
749
|
],
|
|
748
750
|
"@typescript-eslint/consistent-type-assertions": [
|
|
749
751
|
"error",
|
|
@@ -814,7 +816,7 @@ module.exports = {
|
|
|
814
816
|
], // If you are disabling this rule consider changing your data structure
|
|
815
817
|
"@typescript-eslint/no-extraneous-class": [
|
|
816
818
|
"off"
|
|
817
|
-
], // I
|
|
819
|
+
], // I don't think we have developers using namespaces as classes, but if they wanted to I don't think the linter should stop them
|
|
818
820
|
"@typescript-eslint/no-invalid-void-type": [
|
|
819
821
|
"warn",
|
|
820
822
|
{
|
|
@@ -828,8 +830,12 @@ module.exports = {
|
|
|
828
830
|
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": [
|
|
829
831
|
"warn"
|
|
830
832
|
], // Wrap your expression in parenthesis
|
|
831
|
-
"@typescript-eslint/
|
|
832
|
-
"
|
|
833
|
+
"@typescript-eslint/parameter-properties": [
|
|
834
|
+
"warn",
|
|
835
|
+
{
|
|
836
|
+
"allow":[ "private readonly" ],
|
|
837
|
+
"prefer": "parameter-property"
|
|
838
|
+
}
|
|
833
839
|
], // I like parameter properties
|
|
834
840
|
"@typescript-eslint/no-require-imports": [
|
|
835
841
|
"error"
|
|
@@ -880,11 +886,7 @@ module.exports = {
|
|
|
880
886
|
"off"
|
|
881
887
|
], // values are locally scoped
|
|
882
888
|
"@typescript-eslint/prefer-nullish-coalescing": [
|
|
883
|
-
"
|
|
884
|
-
{
|
|
885
|
-
"ignoreConditionalTests": false,
|
|
886
|
-
"ignoreMixedLogicalExpressions": false
|
|
887
|
-
}
|
|
889
|
+
"off" // This rule was getting very annoying so it has been turned off going forward
|
|
888
890
|
],
|
|
889
891
|
"@typescript-eslint/prefer-optional-chain": [
|
|
890
892
|
"warn"
|
|
@@ -932,12 +934,11 @@ module.exports = {
|
|
|
932
934
|
"ignoreStringArrays": true
|
|
933
935
|
}
|
|
934
936
|
],
|
|
935
|
-
"@typescript-eslint/sort-type-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
}
|
|
937
|
+
"@typescript-eslint/sort-type-constituents": [
|
|
938
|
+
// This rule has been turned off because the settings are not granular enough to allow for `let x: string | string[] = undefined`
|
|
939
|
+
// It does not allow you to allow for arrays after literals without changing every group order.
|
|
940
|
+
// Developers will have to sort their own keys if they care about order.
|
|
941
|
+
"off"
|
|
941
942
|
],
|
|
942
943
|
"@typescript-eslint/strict-boolean-expressions": [
|
|
943
944
|
"off"
|
|
@@ -968,6 +969,18 @@ module.exports = {
|
|
|
968
969
|
"@typescript-eslint/unified-signatures": [
|
|
969
970
|
"warn"
|
|
970
971
|
],
|
|
972
|
+
// This rule was added later and
|
|
973
|
+
"@typescript-eslint/restrict-template-expressions": [
|
|
974
|
+
"warn",
|
|
975
|
+
{
|
|
976
|
+
"allowNumber": true,
|
|
977
|
+
"allowBoolean": true,
|
|
978
|
+
"allowAny": true,
|
|
979
|
+
"allowNullish": true,
|
|
980
|
+
"allowRegExp": true,
|
|
981
|
+
"allowNever": true
|
|
982
|
+
}
|
|
983
|
+
],
|
|
971
984
|
// ~~~~~ Rules set to "off" because the tslinter overrides their base behavior ~~~~~
|
|
972
985
|
"comma-dangle": [
|
|
973
986
|
"off"
|
|
@@ -1068,7 +1081,8 @@ module.exports = {
|
|
|
1068
1081
|
"require-await": [
|
|
1069
1082
|
"off"
|
|
1070
1083
|
],
|
|
1071
|
-
|
|
1084
|
+
// This rule was renamed to have a `no-` in front of it
|
|
1085
|
+
"no-return-await": [
|
|
1072
1086
|
"off"
|
|
1073
1087
|
],
|
|
1074
1088
|
"semi": [
|
package/README.md
CHANGED
|
@@ -3,12 +3,12 @@ The official [**Commission on Peace Officer Standards and Training**](https://gi
|
|
|
3
3
|
|
|
4
4
|
## Install
|
|
5
5
|
```bash
|
|
6
|
-
$ npm install @typescript-eslint/parser
|
|
7
|
-
$ npm install @commission-on-post/
|
|
6
|
+
$ npm install @typescript-eslint/parser -D
|
|
7
|
+
$ npm install @commission-on-post/eslint-config-recommended -D
|
|
8
8
|
```
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
## Recommended `.
|
|
11
|
+
## Recommended `.eslintrc.json`
|
|
12
12
|
```json
|
|
13
13
|
{
|
|
14
14
|
"root": true,
|
|
@@ -45,7 +45,7 @@ Name | Description | [:large_blue_circle:](##Scripts "LOGO / LINK")
|
|
|
45
45
|
**LintLens - ESLint rules made easier** | Augment your ESLint rules in Visual Studio Code by Adding metadata and usage information beside each ESLint rule. |[<img alt="LinLens Logo" width="120px" src="https://cdn.vsassets.io/v/M194_20211025.9/_content/Header/default_icon_128.png"/>](https://marketplace.visualstudio.com/items?itemName=ghmcadams.lintlens)
|
|
46
46
|
|
|
47
47
|
#### VS Code setting.json (fix on save)
|
|
48
|
-
- If you have format on save in
|
|
48
|
+
- If you have format on save in VS Code you may need to disable it, because mine started fighting.
|
|
49
49
|
```json
|
|
50
50
|
// (file->preferences->settings [switch to json view])
|
|
51
51
|
"eslint.validate": [
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commission-on-post/eslint-config-recommended",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "ESLint config using recommended state practices for the Commission on POST",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Ryan W. Bell",
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"url": "git+https://github.com/Commission-on-POST/eslint_recommended_style.git"
|
|
11
11
|
},
|
|
12
12
|
"homepage": "https://github.com/Commission-on-POST/eslint_recommended_style#readme",
|
|
13
|
+
"scripts":{
|
|
14
|
+
"start": "node ."
|
|
15
|
+
},
|
|
13
16
|
"keywords": [
|
|
14
17
|
"ESlint",
|
|
15
18
|
"style",
|
|
@@ -21,12 +24,14 @@
|
|
|
21
24
|
"@typescript-eslint/eslint-plugin": ">=5.3.0",
|
|
22
25
|
"@typescript-eslint/parser": ">=5.3.0",
|
|
23
26
|
"eslint": ">=8.1.0",
|
|
24
|
-
"typescript": ">=4.4.4"
|
|
27
|
+
"typescript": ">=4.4.4",
|
|
28
|
+
"eslint-plugin-import": "^2.27.5"
|
|
25
29
|
},
|
|
26
30
|
"devDependencies": {
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
28
|
-
"@typescript-eslint/parser": "^5.
|
|
29
|
-
"eslint": "^8.
|
|
30
|
-
"
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
|
32
|
+
"@typescript-eslint/parser": "^5.59.8",
|
|
33
|
+
"eslint": "^8.41.0",
|
|
34
|
+
"eslint-plugin-import": "^2.27.5",
|
|
35
|
+
"typescript": "^5.1.0"
|
|
31
36
|
}
|
|
32
|
-
}
|
|
37
|
+
}
|