@clipboard-health/eslint-config 3.0.15 → 3.1.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/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/src/index.d.ts +28 -5
- package/src/index.d.ts.map +1 -1
- package/src/index.js +37 -2
- package/src/index.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [3.1.0](https://github.com/ClipboardHealth/cbh-core/compare/eslint-config-3.0.16...eslint-config-3.1.0) (2024-06-11)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* Add eslint rule to prevent importing ObjectId from mongodb ([#657](https://github.com/ClipboardHealth/cbh-core/issues/657)) ([8f0be0d](https://github.com/ClipboardHealth/cbh-core/commit/8f0be0d2f8b60cdfc0df77ac8d2009e979da9246))
|
|
11
|
+
|
|
12
|
+
## [3.0.16](https://github.com/ClipboardHealth/cbh-core/compare/eslint-config-3.0.15...eslint-config-3.0.16) (2024-04-09)
|
|
13
|
+
|
|
5
14
|
## [3.0.15](https://github.com/ClipboardHealth/cbh-core/compare/eslint-config-3.0.14...eslint-config-3.0.15) (2024-03-07)
|
|
6
15
|
|
|
7
16
|
## [3.0.14](https://github.com/ClipboardHealth/cbh-core/compare/eslint-config-3.0.13...eslint-config-3.0.14) (2023-11-09)
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -7,6 +7,12 @@ export declare namespace parserOptions {
|
|
|
7
7
|
}
|
|
8
8
|
export declare let plugins: string[];
|
|
9
9
|
export declare let rules: {
|
|
10
|
+
/**
|
|
11
|
+
* Disable the capitalization of comments
|
|
12
|
+
* It makes code "not build" when just commented temporarily, which we've
|
|
13
|
+
* found to add more friction than the value from having consistent capitalization.
|
|
14
|
+
*/
|
|
15
|
+
"capitalized-comments": string;
|
|
10
16
|
"@typescript-eslint/consistent-type-definitions": string[];
|
|
11
17
|
"@typescript-eslint/naming-convention": string;
|
|
12
18
|
"security/detect-object-injection": string;
|
|
@@ -15,9 +21,6 @@ export declare let rules: {
|
|
|
15
21
|
})[];
|
|
16
22
|
"no-return-await": string;
|
|
17
23
|
"@typescript-eslint/return-await": string[];
|
|
18
|
-
"capitalized-comments": (string | {
|
|
19
|
-
ignorePattern: string;
|
|
20
|
-
})[];
|
|
21
24
|
curly: string[];
|
|
22
25
|
"class-methods-use-this": string;
|
|
23
26
|
"import/extensions": string;
|
|
@@ -50,14 +53,34 @@ export declare let rules: {
|
|
|
50
53
|
ignore: RegExp[];
|
|
51
54
|
})[];
|
|
52
55
|
"no-underscore-dangle": string;
|
|
56
|
+
"no-restricted-imports": (string | {
|
|
57
|
+
paths: {
|
|
58
|
+
name: string;
|
|
59
|
+
importNames: string[];
|
|
60
|
+
message: string;
|
|
61
|
+
}[];
|
|
62
|
+
})[];
|
|
53
63
|
};
|
|
54
|
-
export declare let overrides: {
|
|
64
|
+
export declare let overrides: ({
|
|
55
65
|
files: string[];
|
|
56
66
|
rules: {
|
|
57
67
|
"@typescript-eslint/no-unsafe-assignment": string;
|
|
58
68
|
"sonarjs/no-duplicate-string": string;
|
|
69
|
+
"@typescript-eslint/ban-types"?: never;
|
|
70
|
+
};
|
|
71
|
+
} | {
|
|
72
|
+
files: string[];
|
|
73
|
+
rules: {
|
|
74
|
+
"@typescript-eslint/ban-types": (string | {
|
|
75
|
+
extendDefaults: boolean;
|
|
76
|
+
types: {
|
|
77
|
+
null: boolean;
|
|
78
|
+
};
|
|
79
|
+
})[];
|
|
80
|
+
"@typescript-eslint/no-unsafe-assignment"?: never;
|
|
81
|
+
"sonarjs/no-duplicate-string"?: never;
|
|
59
82
|
};
|
|
60
|
-
}[];
|
|
83
|
+
})[];
|
|
61
84
|
export declare namespace settings {
|
|
62
85
|
namespace node {
|
|
63
86
|
let version: string;
|
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/eslint-config/src/index.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/eslint-config/src/index.js"],"names":[],"mappings":";;;;;;;;;IAuBI;;;;OAIG"}
|
package/src/index.js
CHANGED
|
@@ -22,6 +22,12 @@ module.exports = {
|
|
|
22
22
|
},
|
|
23
23
|
plugins: ["jest", "no-only-tests", "simple-import-sort", "sonarjs"],
|
|
24
24
|
rules: {
|
|
25
|
+
/**
|
|
26
|
+
* Disable the capitalization of comments
|
|
27
|
+
* It makes code "not build" when just commented temporarily, which we've
|
|
28
|
+
* found to add more friction than the value from having consistent capitalization.
|
|
29
|
+
*/
|
|
30
|
+
"capitalized-comments": "off",
|
|
25
31
|
// See https://github.com/microsoft/TypeScript/wiki/Performance#preferring-interfaces-over-intersections
|
|
26
32
|
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
27
33
|
// Too many false positives
|
|
@@ -33,8 +39,6 @@ module.exports = {
|
|
|
33
39
|
// `no-return-await` states "This can make debugging more difficult."
|
|
34
40
|
"no-return-await": "off",
|
|
35
41
|
"@typescript-eslint/return-await": ["error", "always"],
|
|
36
|
-
// Ignore `sonar-disable`/`sonar-enable` comments
|
|
37
|
-
"capitalized-comments": ["error", "always", { ignorePattern: "sonar" }],
|
|
38
42
|
// Prevent bugs
|
|
39
43
|
curly: ["error", "all"],
|
|
40
44
|
// Recommends using static fields instead of moving to a function
|
|
@@ -95,6 +99,19 @@ module.exports = {
|
|
|
95
99
|
],
|
|
96
100
|
// Polarizing naming convention that isn't followed by us
|
|
97
101
|
"no-underscore-dangle": "off",
|
|
102
|
+
"no-restricted-imports": [
|
|
103
|
+
"error",
|
|
104
|
+
{
|
|
105
|
+
paths: [
|
|
106
|
+
// We want `ObjectId` to be imported from `mongoose` only
|
|
107
|
+
{
|
|
108
|
+
name: "mongodb",
|
|
109
|
+
importNames: ["ObjectId", "ObjectID"],
|
|
110
|
+
message: "Importing `ObjectId` from `mongodb` is not allowed. Use `mongoose.Types.ObjectId` instead.",
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
],
|
|
98
115
|
},
|
|
99
116
|
overrides: [
|
|
100
117
|
{
|
|
@@ -115,6 +132,24 @@ module.exports = {
|
|
|
115
132
|
"sonarjs/no-duplicate-string": "off",
|
|
116
133
|
},
|
|
117
134
|
},
|
|
135
|
+
/**
|
|
136
|
+
* Exclude *.dto.ts, null is needed for PATCH endpoints to differentiate empty from optional fields
|
|
137
|
+
* Exclude *.repository.ts, null is needed for our ORMs (prisma and mongoose)
|
|
138
|
+
*/
|
|
139
|
+
{
|
|
140
|
+
files: ["**/*.dto.ts", "**/*.repository.ts"],
|
|
141
|
+
rules: {
|
|
142
|
+
"@typescript-eslint/ban-types": [
|
|
143
|
+
"error",
|
|
144
|
+
{
|
|
145
|
+
extendDefaults: true,
|
|
146
|
+
types: {
|
|
147
|
+
null: false,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
},
|
|
118
153
|
],
|
|
119
154
|
settings: { node: { version: ">=18.15.0" } },
|
|
120
155
|
};
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/eslint-config/src/index.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG;IACf,OAAO,EAAE;QACP,aAAa;QACb,oCAAoC;QACpC,yBAAyB;QACzB,mBAAmB;QACnB,2BAA2B;QAC3B,sBAAsB;QACtB,yCAAyC;QACzC,6BAA6B;QAC7B,4BAA4B;QAC5B,4BAA4B;QAC5B,UAAU;QACV,IAAI;QACJ,qBAAqB;KACtB;IACD,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,OAAO,EAAE,CAAC,eAAe,CAAC;QAC1B,eAAe,EAAE,SAAS;KAC3B;IACD,OAAO,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,oBAAoB,EAAE,SAAS,CAAC;IACnE,KAAK,EAAE;QACL,wGAAwG;QACxG,gDAAgD,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;QAExE,2BAA2B;QAC3B,sCAAsC,EAAE,KAAK;QAC7C,kCAAkC,EAAE,KAAK;QAEzC,oDAAoD;QACpD,mCAAmC,EAAE,CAAC,MAAM,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;QAE1E,6EAA6E;QAC7E,qEAAqE;QACrE,iBAAiB,EAAE,KAAK;QACxB,iCAAiC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;QAEtD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/eslint-config/src/index.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG;IACf,OAAO,EAAE;QACP,aAAa;QACb,oCAAoC;QACpC,yBAAyB;QACzB,mBAAmB;QACnB,2BAA2B;QAC3B,sBAAsB;QACtB,yCAAyC;QACzC,6BAA6B;QAC7B,4BAA4B;QAC5B,4BAA4B;QAC5B,UAAU;QACV,IAAI;QACJ,qBAAqB;KACtB;IACD,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,OAAO,EAAE,CAAC,eAAe,CAAC;QAC1B,eAAe,EAAE,SAAS;KAC3B;IACD,OAAO,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,oBAAoB,EAAE,SAAS,CAAC;IACnE,KAAK,EAAE;QACL;;;;WAIG;QACH,sBAAsB,EAAE,KAAK;QAE7B,wGAAwG;QACxG,gDAAgD,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;QAExE,2BAA2B;QAC3B,sCAAsC,EAAE,KAAK;QAC7C,kCAAkC,EAAE,KAAK;QAEzC,oDAAoD;QACpD,mCAAmC,EAAE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