@payloadcms/plugin-cloud-storage 1.0.13 → 1.0.15-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/.editorconfig +10 -0
- package/.gitignore +248 -0
- package/.prettierignore +1 -0
- package/.prettierrc.js +8 -0
- package/.vscode/launch.json +40 -0
- package/.vscode/settings.json +9 -0
- package/LICENSE.md +1 -1
- package/README.md +25 -3
- package/dev/.env +21 -0
- package/dev/.env.example +21 -0
- package/dev/nodemon.json +8 -0
- package/dev/package.json +34 -0
- package/dev/src/collections/Media.ts +56 -0
- package/dev/src/collections/Users.ts +23 -0
- package/dev/src/mocks/fsMock.js +1 -0
- package/dev/src/mocks/promisifyMock.js +1 -0
- package/dev/src/payload.config.ts +111 -0
- package/dev/src/server.ts +26 -0
- package/dev/tsconfig.json +20 -0
- package/dist/adapters/azure/fileStub.d.ts +2 -0
- package/dist/adapters/azure/fileStub.js +4 -0
- package/dist/adapters/azure/fileStub.js.map +1 -0
- package/dist/adapters/azure/handleUpload.js +16 -1
- package/dist/adapters/azure/handleUpload.js.map +1 -1
- package/dist/adapters/azure/index.js.map +1 -1
- package/dist/adapters/azure/mock.d.ts +6 -0
- package/dist/adapters/azure/mock.js +4 -0
- package/dist/adapters/azure/mock.js.map +1 -1
- package/dist/adapters/azure/staticHandler.js +19 -15
- package/dist/adapters/azure/staticHandler.js.map +1 -1
- package/dist/adapters/azure/webpack.js +2 -2
- package/dist/adapters/azure/webpack.js.map +1 -1
- package/dist/adapters/gcs/webpack.js +2 -2
- package/dist/adapters/gcs/webpack.js.map +1 -1
- package/dist/adapters/s3/fileStub.d.ts +2 -0
- package/dist/adapters/s3/fileStub.js +4 -0
- package/dist/adapters/s3/fileStub.js.map +1 -0
- package/dist/adapters/s3/staticHandler.js +1 -0
- package/dist/adapters/s3/staticHandler.js.map +1 -1
- package/dist/adapters/s3/webpack.js +2 -2
- package/dist/adapters/s3/webpack.js.map +1 -1
- package/dist/hooks/afterDelete.js +5 -2
- package/dist/hooks/afterDelete.js.map +1 -1
- package/dist/hooks/beforeChange.js +36 -8
- package/dist/hooks/beforeChange.js.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +10 -4
- package/dist/plugin.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/utilities/getRangeFromHeader.d.ts +6 -0
- package/dist/utilities/getRangeFromHeader.js +67 -0
- package/dist/utilities/getRangeFromHeader.js.map +1 -0
- package/docs/local-dev.md +47 -0
- package/eslint-config/index.js +15 -0
- package/eslint-config/rules/import.js +38 -0
- package/eslint-config/rules/prettier.js +7 -0
- package/eslint-config/rules/style.js +21 -0
- package/eslint-config/rules/typescript.js +628 -0
- package/package.json +7 -4
- package/src/adapters/azure/emulator/docker-compose.yml +16 -0
- package/src/adapters/azure/fileStub.js +1 -0
- package/src/adapters/azure/generateURL.ts +13 -0
- package/src/adapters/azure/handleDelete.ts +16 -0
- package/src/adapters/azure/handleUpload.ts +41 -0
- package/src/adapters/azure/index.ts +48 -0
- package/src/adapters/azure/mock.js +13 -0
- package/src/adapters/azure/staticHandler.ts +38 -0
- package/src/adapters/azure/webpack.ts +24 -0
- package/src/adapters/gcs/emulator/docker-compose.yml +15 -0
- package/src/adapters/gcs/generateURL.ts +16 -0
- package/src/adapters/gcs/handleDelete.ts +16 -0
- package/src/adapters/gcs/handleUpload.ts +34 -0
- package/src/adapters/gcs/index.ts +37 -0
- package/src/adapters/gcs/mock.js +3 -0
- package/src/adapters/gcs/staticHandler.ts +34 -0
- package/src/adapters/gcs/webpack.ts +21 -0
- package/src/adapters/s3/emulator/.localstack/cache/machine.json +1 -0
- package/src/adapters/s3/emulator/.localstack/cache/server.test.pem +127 -0
- package/src/adapters/s3/emulator/.localstack/cache/server.test.pem.crt +99 -0
- package/src/adapters/s3/emulator/.localstack/cache/server.test.pem.key +28 -0
- package/src/adapters/s3/emulator/.localstack/cache/service-catalog-2_1_1_dev-1_29_149.pickle +0 -0
- package/src/adapters/s3/emulator/docker-compose.yml +15 -0
- package/src/adapters/s3/fileStub.js +1 -0
- package/src/adapters/s3/generateURL.ts +14 -0
- package/src/adapters/s3/handleDelete.ts +17 -0
- package/src/adapters/s3/handleUpload.ts +62 -0
- package/src/adapters/s3/index.ts +38 -0
- package/src/adapters/s3/mock.js +9 -0
- package/src/adapters/s3/staticHandler.ts +41 -0
- package/src/adapters/s3/webpack.ts +23 -0
- package/src/fields/getFields.ts +155 -0
- package/src/hooks/afterDelete.ts +35 -0
- package/src/hooks/afterRead.ts +38 -0
- package/src/hooks/beforeChange.ts +59 -0
- package/src/index.ts +1 -0
- package/src/plugin.ts +101 -0
- package/src/types.ts +79 -0
- package/src/utilities/getFilePrefix.ts +26 -0
- package/src/utilities/getIncomingFiles.ts +44 -0
- package/src/utilities/getRangeFromHeader.ts +27 -0
- package/src/webpack.ts +46 -0
- package/tsconfig.json +23 -0
- package/yarn-error.log +8163 -0
- package/yarn.lock +8062 -0
|
@@ -0,0 +1,628 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
plugins: ['@typescript-eslint'],
|
|
3
|
+
overrides: [
|
|
4
|
+
{
|
|
5
|
+
files: ['**/**.ts', '**/**.d.ts'],
|
|
6
|
+
rules: {
|
|
7
|
+
'no-undef': 'off',
|
|
8
|
+
camelcase: 'off',
|
|
9
|
+
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
10
|
+
/**
|
|
11
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/array-type.md
|
|
12
|
+
*/
|
|
13
|
+
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
|
|
14
|
+
/**
|
|
15
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/await-thenable.md
|
|
16
|
+
*/
|
|
17
|
+
'@typescript-eslint/await-thenable': 'off',
|
|
18
|
+
/**
|
|
19
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-assertions.md
|
|
20
|
+
*/
|
|
21
|
+
'@typescript-eslint/consistent-type-assertions': [
|
|
22
|
+
'error',
|
|
23
|
+
{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' },
|
|
24
|
+
],
|
|
25
|
+
/**
|
|
26
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-definitions.md
|
|
27
|
+
*/
|
|
28
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
29
|
+
/**
|
|
30
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-imports.md
|
|
31
|
+
*/
|
|
32
|
+
'@typescript-eslint/consistent-type-imports': 'warn',
|
|
33
|
+
/**
|
|
34
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-function-return-type.md
|
|
35
|
+
*/
|
|
36
|
+
'@typescript-eslint/explicit-function-return-type': [
|
|
37
|
+
'error',
|
|
38
|
+
{
|
|
39
|
+
// TODO: come back and check if we need those
|
|
40
|
+
allowExpressions: true,
|
|
41
|
+
allowTypedFunctionExpressions: true,
|
|
42
|
+
allowHigherOrderFunctions: true,
|
|
43
|
+
allowConciseArrowFunctionExpressionsStartingWithVoid: false,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
/**
|
|
47
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md
|
|
48
|
+
*/
|
|
49
|
+
'@typescript-eslint/explicit-member-accessibility': [
|
|
50
|
+
'error',
|
|
51
|
+
{ accessibility: 'no-public' },
|
|
52
|
+
],
|
|
53
|
+
/**
|
|
54
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md
|
|
55
|
+
*/
|
|
56
|
+
'@typescript-eslint/member-delimiter-style': [
|
|
57
|
+
'error',
|
|
58
|
+
{
|
|
59
|
+
multiline: {
|
|
60
|
+
delimiter: 'none',
|
|
61
|
+
requireLast: true,
|
|
62
|
+
},
|
|
63
|
+
singleline: {
|
|
64
|
+
delimiter: 'semi',
|
|
65
|
+
requireLast: false,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
/**
|
|
70
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/method-signature-style.md
|
|
71
|
+
*/
|
|
72
|
+
'@typescript-eslint/method-signature-style': 'off',
|
|
73
|
+
/**
|
|
74
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
|
|
75
|
+
*/
|
|
76
|
+
'@typescript-eslint/naming-convention': [
|
|
77
|
+
'off',
|
|
78
|
+
{
|
|
79
|
+
selector: 'default',
|
|
80
|
+
format: ['camelCase'],
|
|
81
|
+
leadingUnderscore: 'forbid',
|
|
82
|
+
trailingUnderscore: 'forbid',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
selector: 'variable',
|
|
86
|
+
format: ['camelCase', 'UPPER_CASE'],
|
|
87
|
+
leadingUnderscore: 'forbid',
|
|
88
|
+
trailingUnderscore: 'forbid',
|
|
89
|
+
},
|
|
90
|
+
// Enforce that type parameters (generics) are prefixed with T or U
|
|
91
|
+
{
|
|
92
|
+
selector: 'typeParameter',
|
|
93
|
+
format: ['PascalCase'],
|
|
94
|
+
prefix: ['T', 'U'],
|
|
95
|
+
},
|
|
96
|
+
// enforce boolean variables to start with proper prefix.
|
|
97
|
+
{
|
|
98
|
+
selector: 'variable',
|
|
99
|
+
types: ['boolean'],
|
|
100
|
+
format: ['PascalCase'],
|
|
101
|
+
prefix: ['is', 'should', 'has', 'can', 'did', 'will'],
|
|
102
|
+
},
|
|
103
|
+
// Enforce that interface names do not begin with an I
|
|
104
|
+
{
|
|
105
|
+
selector: 'interface',
|
|
106
|
+
format: ['PascalCase'],
|
|
107
|
+
custom: {
|
|
108
|
+
regex: '^I[A-Z]',
|
|
109
|
+
match: false,
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
selector: [
|
|
114
|
+
'function',
|
|
115
|
+
'parameter',
|
|
116
|
+
'property',
|
|
117
|
+
'parameterProperty',
|
|
118
|
+
'method',
|
|
119
|
+
'accessor',
|
|
120
|
+
],
|
|
121
|
+
format: ['camelCase'],
|
|
122
|
+
leadingUnderscore: 'forbid',
|
|
123
|
+
trailingUnderscore: 'forbid',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
selector: ['class', 'interface', 'typeAlias', 'enum', 'typeParameter'],
|
|
127
|
+
format: ['PascalCase'],
|
|
128
|
+
leadingUnderscore: 'forbid',
|
|
129
|
+
trailingUnderscore: 'forbid',
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
/**
|
|
133
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-base-to-string.md
|
|
134
|
+
*/
|
|
135
|
+
'@typescript-eslint/no-base-to-string': 'off',
|
|
136
|
+
/**
|
|
137
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md
|
|
138
|
+
*/
|
|
139
|
+
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
|
140
|
+
/**
|
|
141
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dynamic-delete.md
|
|
142
|
+
*/
|
|
143
|
+
'@typescript-eslint/no-dynamic-delete': 'error',
|
|
144
|
+
/**
|
|
145
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-interface.md
|
|
146
|
+
*/
|
|
147
|
+
'@typescript-eslint/no-empty-interface': 'off',
|
|
148
|
+
/**
|
|
149
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-explicit-any.md
|
|
150
|
+
*/
|
|
151
|
+
'@typescript-eslint/no-explicit-any': [
|
|
152
|
+
'warn',
|
|
153
|
+
{
|
|
154
|
+
ignoreRestArgs: true,
|
|
155
|
+
// enable later
|
|
156
|
+
fixToUnknown: false,
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
/**
|
|
160
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md
|
|
161
|
+
*/
|
|
162
|
+
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
|
163
|
+
/**
|
|
164
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extraneous-class.md
|
|
165
|
+
*/
|
|
166
|
+
'@typescript-eslint/no-extraneous-class': [
|
|
167
|
+
'error',
|
|
168
|
+
{
|
|
169
|
+
allowConstructorOnly: false,
|
|
170
|
+
allowEmpty: false,
|
|
171
|
+
allowStaticOnly: false,
|
|
172
|
+
allowWithDecorator: false,
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
/**
|
|
176
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md
|
|
177
|
+
*/
|
|
178
|
+
'@typescript-eslint/no-floating-promises': 'off',
|
|
179
|
+
/**
|
|
180
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-for-in-array.md
|
|
181
|
+
*/
|
|
182
|
+
'@typescript-eslint/no-for-in-array': 'off',
|
|
183
|
+
/**
|
|
184
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md
|
|
185
|
+
*/
|
|
186
|
+
'@typescript-eslint/no-implicit-any-catch': [
|
|
187
|
+
'error',
|
|
188
|
+
{
|
|
189
|
+
allowExplicitAny: false,
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
/**
|
|
193
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
|
|
194
|
+
*/
|
|
195
|
+
'@typescript-eslint/no-implied-eval': 'off',
|
|
196
|
+
/**
|
|
197
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-inferrable-types.md
|
|
198
|
+
*/
|
|
199
|
+
'@typescript-eslint/no-inferrable-types': [
|
|
200
|
+
'error',
|
|
201
|
+
{
|
|
202
|
+
ignoreParameters: false,
|
|
203
|
+
ignoreProperties: false,
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
/**
|
|
207
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-invalid-void-type.md
|
|
208
|
+
*/
|
|
209
|
+
'@typescript-eslint/no-invalid-void-type': [
|
|
210
|
+
'off',
|
|
211
|
+
{
|
|
212
|
+
allowInGenericTypeArguments: true,
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
/**
|
|
216
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-new.md
|
|
217
|
+
*/
|
|
218
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
219
|
+
/**
|
|
220
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-promises.md
|
|
221
|
+
*/
|
|
222
|
+
'@typescript-eslint/no-misused-promises': 'off',
|
|
223
|
+
/**
|
|
224
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-namespace.md
|
|
225
|
+
*/
|
|
226
|
+
'@typescript-eslint/no-namespace': 'off',
|
|
227
|
+
/**
|
|
228
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md
|
|
229
|
+
*/
|
|
230
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
231
|
+
/**
|
|
232
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-non-null-assertion.md
|
|
233
|
+
*/
|
|
234
|
+
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
235
|
+
/**
|
|
236
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-parameter-properties.md
|
|
237
|
+
*/
|
|
238
|
+
'@typescript-eslint/no-parameter-properties': 'error',
|
|
239
|
+
/**
|
|
240
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-require-imports.md
|
|
241
|
+
*/
|
|
242
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
243
|
+
/**
|
|
244
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-this-alias.md
|
|
245
|
+
*/
|
|
246
|
+
'@typescript-eslint/no-this-alias': 'error',
|
|
247
|
+
/**
|
|
248
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
|
|
249
|
+
*/
|
|
250
|
+
'@typescript-eslint/no-throw-literal': 'off',
|
|
251
|
+
/**
|
|
252
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-type-alias.md
|
|
253
|
+
*/
|
|
254
|
+
'@typescript-eslint/no-type-alias': [
|
|
255
|
+
'off',
|
|
256
|
+
{
|
|
257
|
+
allowAliases: 'always',
|
|
258
|
+
allowCallbacks: 'always',
|
|
259
|
+
allowConditionalTypes: 'always',
|
|
260
|
+
allowConstructors: 'never',
|
|
261
|
+
allowLiterals: 'in-unions-and-intersections',
|
|
262
|
+
allowMappedTypes: 'always',
|
|
263
|
+
allowTupleTypes: 'always',
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
/**
|
|
267
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md
|
|
268
|
+
*/
|
|
269
|
+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
|
|
270
|
+
/**
|
|
271
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md
|
|
272
|
+
*/
|
|
273
|
+
'@typescript-eslint/no-unnecessary-condition': 'off',
|
|
274
|
+
/**
|
|
275
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md
|
|
276
|
+
*/
|
|
277
|
+
'@typescript-eslint/no-unnecessary-qualifier': 'off',
|
|
278
|
+
/**
|
|
279
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md
|
|
280
|
+
*/
|
|
281
|
+
'@typescript-eslint/no-unnecessary-type-arguments': 'off',
|
|
282
|
+
/**
|
|
283
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md
|
|
284
|
+
*/
|
|
285
|
+
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
|
|
286
|
+
/**
|
|
287
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md
|
|
288
|
+
*/
|
|
289
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
290
|
+
/**
|
|
291
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-call.md
|
|
292
|
+
*/
|
|
293
|
+
'@typescript-eslint/no-unsafe-call': 'off',
|
|
294
|
+
/**
|
|
295
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md
|
|
296
|
+
*/
|
|
297
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
298
|
+
/**
|
|
299
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-return.md
|
|
300
|
+
*/
|
|
301
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
302
|
+
/**
|
|
303
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-var-requires.md
|
|
304
|
+
*/
|
|
305
|
+
'@typescript-eslint/no-var-requires': 'error',
|
|
306
|
+
/**
|
|
307
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-as-const.md
|
|
308
|
+
*/
|
|
309
|
+
'@typescript-eslint/prefer-as-const': 'error',
|
|
310
|
+
/**
|
|
311
|
+
* We don't care about enums having implicit values.
|
|
312
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md
|
|
313
|
+
*/
|
|
314
|
+
'@typescript-eslint/prefer-enum-initializers': 'off',
|
|
315
|
+
/**
|
|
316
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-for-of.md
|
|
317
|
+
*/
|
|
318
|
+
'@typescript-eslint/prefer-for-of': 'error',
|
|
319
|
+
/**
|
|
320
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-includes.md
|
|
321
|
+
*/
|
|
322
|
+
'@typescript-eslint/prefer-includes': 'off',
|
|
323
|
+
/**
|
|
324
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md
|
|
325
|
+
*/
|
|
326
|
+
'@typescript-eslint/prefer-literal-enum-member': 'error',
|
|
327
|
+
/**
|
|
328
|
+
* using ES2015 syntax so this rule can be safetly turned off
|
|
329
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md
|
|
330
|
+
*/
|
|
331
|
+
'@typescript-eslint/prefer-namespace-keyword': 'off',
|
|
332
|
+
/**
|
|
333
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
|
|
334
|
+
*/
|
|
335
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
336
|
+
/**
|
|
337
|
+
* only set to warn because there are some cases this behavior doesnt work because
|
|
338
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-optional-chain.md
|
|
339
|
+
*/
|
|
340
|
+
'@typescript-eslint/prefer-optional-chain': 'warn',
|
|
341
|
+
/**
|
|
342
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly.md
|
|
343
|
+
*/
|
|
344
|
+
'@typescript-eslint/prefer-readonly': 'off',
|
|
345
|
+
/**
|
|
346
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md
|
|
347
|
+
*/
|
|
348
|
+
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
|
|
349
|
+
/**
|
|
350
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md
|
|
351
|
+
*/
|
|
352
|
+
'@typescript-eslint/prefer-reduce-type-parameter': 'off',
|
|
353
|
+
/**
|
|
354
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md
|
|
355
|
+
*/
|
|
356
|
+
'@typescript-eslint/prefer-regexp-exec': 'off',
|
|
357
|
+
/**
|
|
358
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md
|
|
359
|
+
*/
|
|
360
|
+
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
|
|
361
|
+
/**
|
|
362
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md
|
|
363
|
+
*/
|
|
364
|
+
'@typescript-eslint/prefer-ts-expect-error': 'warn',
|
|
365
|
+
/**
|
|
366
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/promise-function-async.md
|
|
367
|
+
*/
|
|
368
|
+
'@typescript-eslint/promise-function-async': 'off',
|
|
369
|
+
/**
|
|
370
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-array-sort-compare.md
|
|
371
|
+
*/
|
|
372
|
+
'@typescript-eslint/require-array-sort-compare': 'off',
|
|
373
|
+
/**
|
|
374
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-plus-operands.md
|
|
375
|
+
*/
|
|
376
|
+
'@typescript-eslint/restrict-plus-operands': 'off',
|
|
377
|
+
/**
|
|
378
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-template-expressions.md
|
|
379
|
+
*/
|
|
380
|
+
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
381
|
+
/**
|
|
382
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md
|
|
383
|
+
*/
|
|
384
|
+
'@typescript-eslint/strict-boolean-expressions': 'off',
|
|
385
|
+
/**
|
|
386
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md
|
|
387
|
+
*/
|
|
388
|
+
'@typescript-eslint/switch-exhaustiveness-check': 'off',
|
|
389
|
+
/**
|
|
390
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/triple-slash-reference.md
|
|
391
|
+
*/
|
|
392
|
+
'@typescript-eslint/triple-slash-reference': 'error',
|
|
393
|
+
/**
|
|
394
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/type-annotation-spacing.md
|
|
395
|
+
*/
|
|
396
|
+
'@typescript-eslint/type-annotation-spacing': [
|
|
397
|
+
'error',
|
|
398
|
+
{
|
|
399
|
+
before: false,
|
|
400
|
+
after: true,
|
|
401
|
+
overrides: {
|
|
402
|
+
arrow: {
|
|
403
|
+
before: true,
|
|
404
|
+
after: true,
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
],
|
|
409
|
+
/**
|
|
410
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/typedef.md
|
|
411
|
+
*/
|
|
412
|
+
'@typescript-eslint/typedef': [
|
|
413
|
+
'error',
|
|
414
|
+
{
|
|
415
|
+
arrayDestructuring: false,
|
|
416
|
+
arrowParameter: false,
|
|
417
|
+
memberVariableDeclaration: false,
|
|
418
|
+
objectDestructuring: false,
|
|
419
|
+
parameter: false,
|
|
420
|
+
propertyDeclaration: true,
|
|
421
|
+
variableDeclaration: false,
|
|
422
|
+
variableDeclarationIgnoreFunction: false,
|
|
423
|
+
},
|
|
424
|
+
],
|
|
425
|
+
/**
|
|
426
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/unbound-method.md
|
|
427
|
+
*/
|
|
428
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
429
|
+
/**
|
|
430
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/unified-signatures.md
|
|
431
|
+
*/
|
|
432
|
+
'@typescript-eslint/unified-signatures': 'off',
|
|
433
|
+
|
|
434
|
+
// @typescript-eslint Extension Rules
|
|
435
|
+
// ==================================================================================
|
|
436
|
+
/**
|
|
437
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/brace-style.md
|
|
438
|
+
*/
|
|
439
|
+
'brace-style': 'off',
|
|
440
|
+
'@typescript-eslint/brace-style': 'error',
|
|
441
|
+
/**
|
|
442
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-spacing.md
|
|
443
|
+
*/
|
|
444
|
+
'comma-spacing': 'off',
|
|
445
|
+
'@typescript-eslint/comma-spacing': 'error',
|
|
446
|
+
/**
|
|
447
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/default-param-last.md
|
|
448
|
+
*/
|
|
449
|
+
'default-param-last': 'off',
|
|
450
|
+
'@typescript-eslint/default-param-last': 'error',
|
|
451
|
+
/**
|
|
452
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md
|
|
453
|
+
*/
|
|
454
|
+
'dot-notation': 'error',
|
|
455
|
+
'@typescript-eslint/dot-notation': 'off',
|
|
456
|
+
/**
|
|
457
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md
|
|
458
|
+
*/
|
|
459
|
+
'func-call-spacing': 'off',
|
|
460
|
+
'@typescript-eslint/func-call-spacing': 'error',
|
|
461
|
+
/**
|
|
462
|
+
* use prettier instead
|
|
463
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/indent.md
|
|
464
|
+
*/
|
|
465
|
+
indent: 'off',
|
|
466
|
+
'@typescript-eslint/indent': 'off',
|
|
467
|
+
/**
|
|
468
|
+
* Allow a mix between the two
|
|
469
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/init-declarations.md
|
|
470
|
+
*/
|
|
471
|
+
'@typescript-eslint/init-declarations': 'off',
|
|
472
|
+
/**
|
|
473
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md
|
|
474
|
+
*/
|
|
475
|
+
'keyword-spacing': 'off',
|
|
476
|
+
'@typescript-eslint/keyword-spacing': 'error',
|
|
477
|
+
/**
|
|
478
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.md
|
|
479
|
+
*/
|
|
480
|
+
'lines-between-class-members': 'off',
|
|
481
|
+
'@typescript-eslint/lines-between-class-members': [
|
|
482
|
+
'error',
|
|
483
|
+
'always',
|
|
484
|
+
{
|
|
485
|
+
// base eslint config
|
|
486
|
+
exceptAfterSingleLine: true,
|
|
487
|
+
// typescript specific
|
|
488
|
+
exceptAfterOverload: true,
|
|
489
|
+
},
|
|
490
|
+
],
|
|
491
|
+
/**
|
|
492
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md
|
|
493
|
+
*/
|
|
494
|
+
'no-array-constructor': 'off',
|
|
495
|
+
'@typescript-eslint/no-array-constructor': 'error',
|
|
496
|
+
/**
|
|
497
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dupe-class-members.md
|
|
498
|
+
*/
|
|
499
|
+
'no-dupe-class-members': 'off',
|
|
500
|
+
'@typescript-eslint/no-dupe-class-members': 'error',
|
|
501
|
+
/**
|
|
502
|
+
* Use prettier
|
|
503
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md
|
|
504
|
+
*/
|
|
505
|
+
'no-extra-parens': 'off',
|
|
506
|
+
'@typescript-eslint/no-extra-parens': 'off',
|
|
507
|
+
/**
|
|
508
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-semi.md
|
|
509
|
+
*/
|
|
510
|
+
'no-extra-semi': 'off',
|
|
511
|
+
'@typescript-eslint/no-extra-semi': 'error',
|
|
512
|
+
/**
|
|
513
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-invalid-this.md
|
|
514
|
+
*/
|
|
515
|
+
'no-invalid-this': 'off',
|
|
516
|
+
'@typescript-eslint/no-invalid-this': 'error',
|
|
517
|
+
/**
|
|
518
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loss-of-precision.md
|
|
519
|
+
*/
|
|
520
|
+
'no-loss-of-precision': 'off',
|
|
521
|
+
'@typescript-eslint/no-loss-of-precision': 'error',
|
|
522
|
+
/**
|
|
523
|
+
* https://eslint.org/docs/rules/no-magic-numbers
|
|
524
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md
|
|
525
|
+
*/
|
|
526
|
+
'no-magic-numbers': 'off',
|
|
527
|
+
'@typescript-eslint/no-magic-numbers': [
|
|
528
|
+
'off',
|
|
529
|
+
{
|
|
530
|
+
// base eslint configs
|
|
531
|
+
ignoreArrayIndexes: true,
|
|
532
|
+
ignoreDefaultValues: true,
|
|
533
|
+
enforceConst: true,
|
|
534
|
+
// typescript specific configs
|
|
535
|
+
ignoreEnums: true,
|
|
536
|
+
ignoreNumericLiteralTypes: true,
|
|
537
|
+
ignoreReadonlyClassProperties: true,
|
|
538
|
+
},
|
|
539
|
+
],
|
|
540
|
+
/**
|
|
541
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md
|
|
542
|
+
*/
|
|
543
|
+
'no-redeclare': 'off',
|
|
544
|
+
'@typescript-eslint/no-redeclare': [
|
|
545
|
+
'error',
|
|
546
|
+
{
|
|
547
|
+
// prevents variables from being created with global variable naming
|
|
548
|
+
builtinGlobals: true,
|
|
549
|
+
},
|
|
550
|
+
],
|
|
551
|
+
/**
|
|
552
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md
|
|
553
|
+
*/
|
|
554
|
+
'no-shadow': 'off',
|
|
555
|
+
'@typescript-eslint/no-shadow': [
|
|
556
|
+
'error',
|
|
557
|
+
{
|
|
558
|
+
// No variables + types with same naming
|
|
559
|
+
ignoreTypeValueShadow: false,
|
|
560
|
+
},
|
|
561
|
+
],
|
|
562
|
+
/**
|
|
563
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
|
|
564
|
+
*/
|
|
565
|
+
'no-unused-expressions': 'off',
|
|
566
|
+
'@typescript-eslint/no-unused-expressions': 'error',
|
|
567
|
+
/**
|
|
568
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
|
|
569
|
+
*/
|
|
570
|
+
'no-unused-vars': 'off',
|
|
571
|
+
'@typescript-eslint/no-unused-vars': [
|
|
572
|
+
'error',
|
|
573
|
+
{
|
|
574
|
+
ignoreRestSiblings: true,
|
|
575
|
+
},
|
|
576
|
+
],
|
|
577
|
+
/**
|
|
578
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md
|
|
579
|
+
*/
|
|
580
|
+
'no-use-before-define': 'off',
|
|
581
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
582
|
+
/**
|
|
583
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md
|
|
584
|
+
*/
|
|
585
|
+
'no-useless-constructor': 'off',
|
|
586
|
+
'@typescript-eslint/no-useless-constructor': 'error',
|
|
587
|
+
/**
|
|
588
|
+
* https://eslint.org/docs/rules/quotes
|
|
589
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/quotes.md
|
|
590
|
+
*/
|
|
591
|
+
quotes: 'off',
|
|
592
|
+
'@typescript-eslint/quotes': [
|
|
593
|
+
'error',
|
|
594
|
+
'single',
|
|
595
|
+
{
|
|
596
|
+
avoidEscape: true,
|
|
597
|
+
allowTemplateLiterals: true,
|
|
598
|
+
},
|
|
599
|
+
],
|
|
600
|
+
/**
|
|
601
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md
|
|
602
|
+
*/
|
|
603
|
+
'@typescript-eslint/require-await': 'off',
|
|
604
|
+
/**
|
|
605
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md
|
|
606
|
+
*/
|
|
607
|
+
'@typescript-eslint/return-await': 'off',
|
|
608
|
+
/**
|
|
609
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md
|
|
610
|
+
*/
|
|
611
|
+
semi: 'off',
|
|
612
|
+
'@typescript-eslint/semi': ['error', 'never'],
|
|
613
|
+
/**
|
|
614
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-function-paren.md
|
|
615
|
+
*/
|
|
616
|
+
'space-before-function-paren': 'off',
|
|
617
|
+
'@typescript-eslint/space-before-function-paren': [
|
|
618
|
+
'error',
|
|
619
|
+
{
|
|
620
|
+
anonymous: 'never',
|
|
621
|
+
named: 'never',
|
|
622
|
+
asyncArrow: 'always',
|
|
623
|
+
},
|
|
624
|
+
],
|
|
625
|
+
},
|
|
626
|
+
},
|
|
627
|
+
],
|
|
628
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-cloud-storage",
|
|
3
3
|
"description": "The official cloud storage plugin for Payload CMS",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.15-0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"license": "
|
|
7
|
+
"license": "MIT",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "tsc",
|
|
10
10
|
"lint": "eslint src",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@aws-sdk/lib-storage": "^3.267.0",
|
|
18
18
|
"@azure/storage-blob": "^12.11.0",
|
|
19
19
|
"@google-cloud/storage": "^6.4.1",
|
|
20
|
-
"payload": "^1.
|
|
20
|
+
"payload": "^1.7.2"
|
|
21
21
|
},
|
|
22
22
|
"peerDependenciesMeta": {
|
|
23
23
|
"@aws-sdk/client-s3": {
|
|
@@ -55,10 +55,13 @@
|
|
|
55
55
|
"eslint-plugin-import": "2.25.4",
|
|
56
56
|
"eslint-plugin-prettier": "^4.0.0",
|
|
57
57
|
"nodemon": "^2.0.6",
|
|
58
|
-
"payload": "^1.
|
|
58
|
+
"payload": "^1.7.2",
|
|
59
59
|
"prettier": "^2.7.1",
|
|
60
60
|
"rimraf": "^4.1.2",
|
|
61
61
|
"ts-node": "^9.1.1",
|
|
62
62
|
"typescript": "^4.1.3"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"range-parser": "^1.2.1"
|
|
63
66
|
}
|
|
64
67
|
}
|