Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed type-checking option errors #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kg0r0
Copy link

@kg0r0 kg0r0 commented Jul 15, 2020

Fixed #2

I fixed the following error.

type-checking errors
npm run build

> @decentralized-identity/[email protected] build /private/tmp/sidetree-ipfs-datastores
> tsc -p .

lib/azure/AzureDataStore.ts:75:17 - error TS7034: Variable 'keys' implicitly has type 'any[]' in some locations where its type cannot be determined.

75           const keys = [];
                   ~~~~

lib/azure/AzureDataStore.ts:81:19 - error TS7005: Variable 'keys' implicitly has an 'any[]' type.

81             keys: keys,
                     ~~~~

lib/azure/AzureDataStore.ts:112:13 - error TS7022: 'listKeysResult' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.

112       const listKeysResult = await this.listKeys('', continuationToken);
                ~~~~~~~~~~~~~~

test/azure/AzureDataStore.spec.ts:33:79 - error TS7006: Parameter 'stand' implicitly has an 'any' type.

33       standin.replace(blobStore.getBlobService(), 'createBlockBlobFromText', (stand, _name, key, _value, callback) => {
                                                                                 ~~~~~

test/azure/AzureDataStore.spec.ts:33:86 - error TS7006: Parameter '_name' implicitly has an 'any' type.

33       standin.replace(blobStore.getBlobService(), 'createBlockBlobFromText', (stand, _name, key, _value, callback) => {
                                                                                        ~~~~~

test/azure/AzureDataStore.spec.ts:33:93 - error TS7006: Parameter 'key' implicitly has an 'any' type.

33       standin.replace(blobStore.getBlobService(), 'createBlockBlobFromText', (stand, _name, key, _value, callback) => {
                                                                                               ~~~

test/azure/AzureDataStore.spec.ts:33:98 - error TS7006: Parameter '_value' implicitly has an 'any' type.

33       standin.replace(blobStore.getBlobService(), 'createBlockBlobFromText', (stand, _name, key, _value, callback) => {
                                                                                                    ~~~~~~

test/azure/AzureDataStore.spec.ts:33:106 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

33       standin.replace(blobStore.getBlobService(), 'createBlockBlobFromText', (stand, _name, key, _value, callback) => {
                                                                                                            ~~~~~~~~

test/azure/AzureDataStore.spec.ts:44:79 - error TS7006: Parameter 'stand' implicitly has an 'any' type.

44       standin.replace(blobStore.getBlobService(), 'createBlockBlobFromText', (stand, _name, key, _value, callback) => {
                                                                                 ~~~~~

test/azure/AzureDataStore.spec.ts:44:86 - error TS7006: Parameter '_name' implicitly has an 'any' type.

44       standin.replace(blobStore.getBlobService(), 'createBlockBlobFromText', (stand, _name, key, _value, callback) => {
                                                                                        ~~~~~

test/azure/AzureDataStore.spec.ts:44:93 - error TS7006: Parameter 'key' implicitly has an 'any' type.

44       standin.replace(blobStore.getBlobService(), 'createBlockBlobFromText', (stand, _name, key, _value, callback) => {
                                                                                               ~~~

test/azure/AzureDataStore.spec.ts:44:98 - error TS7006: Parameter '_value' implicitly has an 'any' type.

44       standin.replace(blobStore.getBlobService(), 'createBlockBlobFromText', (stand, _name, key, _value, callback) => {
                                                                                                    ~~~~~~

test/azure/AzureDataStore.spec.ts:44:106 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

44       standin.replace(blobStore.getBlobService(), 'createBlockBlobFromText', (stand, _name, key, _value, callback) => {
                                                                                                            ~~~~~~~~

test/azure/AzureDataStore.spec.ts:64:71 - error TS7006: Parameter 'stand' implicitly has an 'any' type.

64       standin.replace(blobStore.getBlobService(), 'getBlobToStream', (stand, _name, key, writeStream, callback) => {
                                                                         ~~~~~

test/azure/AzureDataStore.spec.ts:64:78 - error TS7006: Parameter '_name' implicitly has an 'any' type.

64       standin.replace(blobStore.getBlobService(), 'getBlobToStream', (stand, _name, key, writeStream, callback) => {
                                                                                ~~~~~

test/azure/AzureDataStore.spec.ts:64:85 - error TS7006: Parameter 'key' implicitly has an 'any' type.

64       standin.replace(blobStore.getBlobService(), 'getBlobToStream', (stand, _name, key, writeStream, callback) => {
                                                                                       ~~~

test/azure/AzureDataStore.spec.ts:64:90 - error TS7006: Parameter 'writeStream' implicitly has an 'any' type.

64       standin.replace(blobStore.getBlobService(), 'getBlobToStream', (stand, _name, key, writeStream, callback) => {
                                                                                            ~~~~~~~~~~~

test/azure/AzureDataStore.spec.ts:64:103 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

64       standin.replace(blobStore.getBlobService(), 'getBlobToStream', (stand, _name, key, writeStream, callback) => {
                                                                                                         ~~~~~~~~

test/azure/AzureDataStore.spec.ts:75:71 - error TS7006: Parameter 'stand' implicitly has an 'any' type.

75       standin.replace(blobStore.getBlobService(), 'getBlobToStream', (stand, _name, key, _writeStream, callback) => {
                                                                         ~~~~~

test/azure/AzureDataStore.spec.ts:75:78 - error TS7006: Parameter '_name' implicitly has an 'any' type.

75       standin.replace(blobStore.getBlobService(), 'getBlobToStream', (stand, _name, key, _writeStream, callback) => {
                                                                                ~~~~~

test/azure/AzureDataStore.spec.ts:75:85 - error TS7006: Parameter 'key' implicitly has an 'any' type.

75       standin.replace(blobStore.getBlobService(), 'getBlobToStream', (stand, _name, key, _writeStream, callback) => {
                                                                                       ~~~

test/azure/AzureDataStore.spec.ts:75:90 - error TS7006: Parameter '_writeStream' implicitly has an 'any' type.

75       standin.replace(blobStore.getBlobService(), 'getBlobToStream', (stand, _name, key, _writeStream, callback) => {
                                                                                            ~~~~~~~~~~~~

test/azure/AzureDataStore.spec.ts:75:104 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

75       standin.replace(blobStore.getBlobService(), 'getBlobToStream', (stand, _name, key, _writeStream, callback) => {
                                                                                                          ~~~~~~~~

test/azure/AzureDataStore.spec.ts:94:74 - error TS7006: Parameter 'stand' implicitly has an 'any' type.

94       standin.replace(blobStore.getBlobService(), 'deleteBlobIfExists', (stand, _name, key, callback) => {
                                                                            ~~~~~

test/azure/AzureDataStore.spec.ts:94:81 - error TS7006: Parameter '_name' implicitly has an 'any' type.

94       standin.replace(blobStore.getBlobService(), 'deleteBlobIfExists', (stand, _name, key, callback) => {
                                                                                   ~~~~~

test/azure/AzureDataStore.spec.ts:94:88 - error TS7006: Parameter 'key' implicitly has an 'any' type.

94       standin.replace(blobStore.getBlobService(), 'deleteBlobIfExists', (stand, _name, key, callback) => {
                                                                                          ~~~

test/azure/AzureDataStore.spec.ts:94:93 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

94       standin.replace(blobStore.getBlobService(), 'deleteBlobIfExists', (stand, _name, key, callback) => {
                                                                                               ~~~~~~~~

test/azure/AzureDataStore.spec.ts:112:69 - error TS7006: Parameter 'stand' implicitly has an 'any' type.

112       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                        ~~~~~

test/azure/AzureDataStore.spec.ts:112:76 - error TS7006: Parameter '_name' implicitly has an 'any' type.

112       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                               ~~~~~

test/azure/AzureDataStore.spec.ts:112:83 - error TS7006: Parameter '_key' implicitly has an 'any' type.

112       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                                      ~~~~

test/azure/AzureDataStore.spec.ts:112:89 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

112       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                                            ~~~~~~~~

test/azure/AzureDataStore.spec.ts:122:69 - error TS7006: Parameter 'stand' implicitly has an 'any' type.

122       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                        ~~~~~

test/azure/AzureDataStore.spec.ts:122:76 - error TS7006: Parameter '_name' implicitly has an 'any' type.

122       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                               ~~~~~

test/azure/AzureDataStore.spec.ts:122:83 - error TS7006: Parameter '_key' implicitly has an 'any' type.

122       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                                      ~~~~

test/azure/AzureDataStore.spec.ts:122:89 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

122       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                                            ~~~~~~~~

test/azure/AzureDataStore.spec.ts:132:69 - error TS7006: Parameter 'stand' implicitly has an 'any' type.

132       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                        ~~~~~

test/azure/AzureDataStore.spec.ts:132:76 - error TS7006: Parameter '_name' implicitly has an 'any' type.

132       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                               ~~~~~

test/azure/AzureDataStore.spec.ts:132:83 - error TS7006: Parameter '_key' implicitly has an 'any' type.

132       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                                      ~~~~

test/azure/AzureDataStore.spec.ts:132:89 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

132       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                                            ~~~~~~~~

test/azure/AzureDataStore.spec.ts:142:69 - error TS7006: Parameter 'stand' implicitly has an 'any' type.

142       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                        ~~~~~

test/azure/AzureDataStore.spec.ts:142:76 - error TS7006: Parameter '_name' implicitly has an 'any' type.

142       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                               ~~~~~

test/azure/AzureDataStore.spec.ts:142:83 - error TS7006: Parameter '_key' implicitly has an 'any' type.

142       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                                      ~~~~

test/azure/AzureDataStore.spec.ts:142:89 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

142       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                                            ~~~~~~~~

test/azure/AzureDataStore.spec.ts:158:84 - error TS7006: Parameter 'stand' implicitly has an 'any' type.

158       standin.replace(blobStore.getBlobService(), 'listBlobsSegmentedWithPrefix', (stand, _container, _prefix, currentToken, callback) => {
                                                                                       ~~~~~

test/azure/AzureDataStore.spec.ts:158:91 - error TS7006: Parameter '_container' implicitly has an 'any' type.

158       standin.replace(blobStore.getBlobService(), 'listBlobsSegmentedWithPrefix', (stand, _container, _prefix, currentToken, callback) => {
                                                                                              ~~~~~~~~~~

test/azure/AzureDataStore.spec.ts:158:103 - error TS7006: Parameter '_prefix' implicitly has an 'any' type.

158       standin.replace(blobStore.getBlobService(), 'listBlobsSegmentedWithPrefix', (stand, _container, _prefix, currentToken, callback) => {
                                                                                                          ~~~~~~~

test/azure/AzureDataStore.spec.ts:158:112 - error TS7006: Parameter 'currentToken' implicitly has an 'any' type.

158       standin.replace(blobStore.getBlobService(), 'listBlobsSegmentedWithPrefix', (stand, _container, _prefix, currentToken, callback) => {
                                                                                                                   ~~~~~~~~~~~~

test/azure/AzureDataStore.spec.ts:158:126 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

158       standin.replace(blobStore.getBlobService(), 'listBlobsSegmentedWithPrefix', (stand, _container, _prefix, currentToken, callback) => {
                                                                                                                                 ~~~~~~~~

test/azure/AzureDataStore.spec.ts:183:69 - error TS7006: Parameter 'stand' implicitly has an 'any' type.

183       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                        ~~~~~

test/azure/AzureDataStore.spec.ts:183:76 - error TS7006: Parameter '_name' implicitly has an 'any' type.

183       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                               ~~~~~

test/azure/AzureDataStore.spec.ts:183:83 - error TS7006: Parameter '_key' implicitly has an 'any' type.

183       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                                      ~~~~

test/azure/AzureDataStore.spec.ts:183:89 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

183       standin.replace(blobStore.getBlobService(), 'doesBlobExist', (stand, _name, _key, callback) => {
                                                                                            ~~~~~~~~

test/azure/mocks/MockBlobStorage.ts:5:10 - error TS7008: Member 'code' implicitly has an 'any' type.

5   public code;
           ~~~~

test/azure/mocks/MockBlobStorage.ts:7:10 - error TS7008: Member 'statusCode' implicitly has an 'any' type.

7   public statusCode;
           ~~~~~~~~~~

test/azure/mocks/MockBlobStorage.ts:8:16 - error TS7006: Parameter 'message' implicitly has an 'any' type.

8   constructor (message, code) {
                 ~~~~~~~

test/azure/mocks/MockBlobStorage.ts:8:25 - error TS7006: Parameter 'code' implicitly has an 'any' type.

8   constructor (message, code) {
                          ~~~~

test/azure/mocks/MockBlobStorage.ts:20:19 - error TS7006: Parameter 'blobService' implicitly has an 'any' type.

20 module.exports = (blobService) => {
                     ~~~~~~~~~~~

test/azure/mocks/MockBlobStorage.ts:24:92 - error TS7006: Parameter '_stand' implicitly has an 'any' type.

24   mocks.deleteContainerIfExists = standin.replace(blobService, 'deleteContainerIfExists', (_stand, key, callback) => {
                                                                                              ~~~~~~

test/azure/mocks/MockBlobStorage.ts:24:100 - error TS7006: Parameter 'key' implicitly has an 'any' type.

24   mocks.deleteContainerIfExists = standin.replace(blobService, 'deleteContainerIfExists', (_stand, key, callback) => {
                                                                                                      ~~~

test/azure/mocks/MockBlobStorage.ts:24:105 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

24   mocks.deleteContainerIfExists = standin.replace(blobService, 'deleteContainerIfExists', (_stand, key, callback) => {
                                                                                                           ~~~~~~~~

test/azure/mocks/MockBlobStorage.ts:33:72 - error TS7006: Parameter '_stand' implicitly has an 'any' type.

33   mocks.getBlobToText = standin.replace(blobService, 'getBlobToText', (_stand, _name, key, _options, callback) => {
                                                                          ~~~~~~

test/azure/mocks/MockBlobStorage.ts:33:80 - error TS7006: Parameter '_name' implicitly has an 'any' type.

33   mocks.getBlobToText = standin.replace(blobService, 'getBlobToText', (_stand, _name, key, _options, callback) => {
                                                                                  ~~~~~

test/azure/mocks/MockBlobStorage.ts:33:87 - error TS7006: Parameter 'key' implicitly has an 'any' type.

33   mocks.getBlobToText = standin.replace(blobService, 'getBlobToText', (_stand, _name, key, _options, callback) => {
                                                                                         ~~~

test/azure/mocks/MockBlobStorage.ts:33:92 - error TS7006: Parameter '_options' implicitly has an 'any' type.

33   mocks.getBlobToText = standin.replace(blobService, 'getBlobToText', (_stand, _name, key, _options, callback) => {
                                                                                              ~~~~~~~~

test/azure/mocks/MockBlobStorage.ts:33:102 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

33   mocks.getBlobToText = standin.replace(blobService, 'getBlobToText', (_stand, _name, key, _options, callback) => {
                                                                                                        ~~~~~~~~

test/azure/mocks/MockBlobStorage.ts:41:72 - error TS7006: Parameter '_standin' implicitly has an 'any' type.

41   mocks.doesBlobExist = standin.replace(blobService, 'doesBlobExist', (_standin, _name, key, callback) => {
                                                                          ~~~~~~~~

test/azure/mocks/MockBlobStorage.ts:41:82 - error TS7006: Parameter '_name' implicitly has an 'any' type.

41   mocks.doesBlobExist = standin.replace(blobService, 'doesBlobExist', (_standin, _name, key, callback) => {
                                                                                    ~~~~~

test/azure/mocks/MockBlobStorage.ts:41:89 - error TS7006: Parameter 'key' implicitly has an 'any' type.

41   mocks.doesBlobExist = standin.replace(blobService, 'doesBlobExist', (_standin, _name, key, callback) => {
                                                                                           ~~~

test/azure/mocks/MockBlobStorage.ts:41:94 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

41   mocks.doesBlobExist = standin.replace(blobService, 'doesBlobExist', (_standin, _name, key, callback) => {
                                                                                                ~~~~~~~~

test/azure/mocks/MockBlobStorage.ts:49:102 - error TS7006: Parameter '_standin' implicitly has an 'any' type.

49   mocks.listBlobsSegmentedWithPrefix = standin.replace(blobService, 'listBlobsSegmentedWithPrefix', (_standin, _name, prefix, _token, callback) => {
                                                                                                        ~~~~~~~~

test/azure/mocks/MockBlobStorage.ts:49:112 - error TS7006: Parameter '_name' implicitly has an 'any' type.

49   mocks.listBlobsSegmentedWithPrefix = standin.replace(blobService, 'listBlobsSegmentedWithPrefix', (_standin, _name, prefix, _token, callback) => {
                                                                                                                  ~~~~~

test/azure/mocks/MockBlobStorage.ts:49:119 - error TS7006: Parameter 'prefix' implicitly has an 'any' type.

49   mocks.listBlobsSegmentedWithPrefix = standin.replace(blobService, 'listBlobsSegmentedWithPrefix', (_standin, _name, prefix, _token, callback) => {
                                                                                                                         ~~~~~~

test/azure/mocks/MockBlobStorage.ts:49:127 - error TS7006: Parameter '_token' implicitly has an 'any' type.

49   mocks.listBlobsSegmentedWithPrefix = standin.replace(blobService, 'listBlobsSegmentedWithPrefix', (_standin, _name, prefix, _token, callback) => {
                                                                                                                                 ~~~~~~

test/azure/mocks/MockBlobStorage.ts:49:135 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

49   mocks.listBlobsSegmentedWithPrefix = standin.replace(blobService, 'listBlobsSegmentedWithPrefix', (_standin, _name, prefix, _token, callback) => {
                                                                                                                                         ~~~~~~~~

test/azure/mocks/MockBlobStorage.ts:57:11 - error TS2322: Type 'string' is not assignable to type 'never'.

57           Key: k
             ~~~

test/azure/mocks/MockBlobStorage.ts:65:92 - error TS7006: Parameter '_stand' implicitly has an 'any' type.

65   mocks.createBlockBlobFromText = standin.replace(blobService, 'createBlockBlobFromText', (_stand, _name, key, value, callback) => {
                                                                                              ~~~~~~

test/azure/mocks/MockBlobStorage.ts:65:100 - error TS7006: Parameter '_name' implicitly has an 'any' type.

65   mocks.createBlockBlobFromText = standin.replace(blobService, 'createBlockBlobFromText', (_stand, _name, key, value, callback) => {
                                                                                                      ~~~~~

test/azure/mocks/MockBlobStorage.ts:65:107 - error TS7006: Parameter 'key' implicitly has an 'any' type.

65   mocks.createBlockBlobFromText = standin.replace(blobService, 'createBlockBlobFromText', (_stand, _name, key, value, callback) => {
                                                                                                             ~~~

test/azure/mocks/MockBlobStorage.ts:65:112 - error TS7006: Parameter 'value' implicitly has an 'any' type.

65   mocks.createBlockBlobFromText = standin.replace(blobService, 'createBlockBlobFromText', (_stand, _name, key, value, callback) => {
                                                                                                                  ~~~~~

test/azure/mocks/MockBlobStorage.ts:65:119 - error TS7006: Parameter 'callback' implicitly has an 'any' type.

65   mocks.createBlockBlobFromText = standin.replace(blobService, 'createBlockBlobFromText', (_stand, _name, key, value, callback) => {
                                                                                                                         ~~~~~~~~


Found 80 errors.

However, I have used many any types.
So we need to fix it in a more strict type declaration in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set type-checking option strict to true in tsconfig.json and fix all errors
1 participant