diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 000000000..8f568eb39 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,164 @@ +env: + browser: true + es6: true + node: true + +parser: "@typescript-eslint/parser" + +parserOptions: + sourceType: module +# project: tsconfig.json + +plugins: + - "@typescript-eslint" + - import + - prefer-arrow + - local-rules + - jsdoc + - promise + +extends: + - "prettier/@typescript-eslint" + +rules: + "@typescript-eslint/adjacent-overload-signatures": error + "@typescript-eslint/array-type": [error, { default: array-simple } ] # was not correctly migrated + "@typescript-eslint/ban-types": error + "@typescript-eslint/class-name-casing": error + "@typescript-eslint/consistent-type-assertions": off + "@typescript-eslint/consistent-type-definitions": error + "@typescript-eslint/interface-name-prefix": error + "@typescript-eslint/member-ordering": error + "@typescript-eslint/no-empty-function": error + "@typescript-eslint/no-empty-interface": error + "@typescript-eslint/no-explicit-any": off + "@typescript-eslint/no-extraneous-class": error + "@typescript-eslint/no-inferrable-types": error + "@typescript-eslint/no-misused-new": error + "@typescript-eslint/no-namespace": error + "@typescript-eslint/no-non-null-assertion": error + "@typescript-eslint/no-parameter-properties": off + "@typescript-eslint/no-this-alias": error + # "@typescript-eslint/no-unnecessary-type-assertion": error # would need typescript --> parserOptions.project + "@typescript-eslint/no-use-before-define": off + "@typescript-eslint/no-var-requires": error + "@typescript-eslint/prefer-for-of": error + "@typescript-eslint/prefer-function-type": error + "@typescript-eslint/prefer-namespace-keyword": error + "@typescript-eslint/triple-slash-reference": error + "@typescript-eslint/unified-signatures": error + arrow-body-style: error + camelcase: error + comma-dangle: off + complexity: off + constructor-super: error + curly: error + dot-notation: error + eol-last: off + eqeqeq: [error, smart] + guard-for-in: error + # id-blacklist: # rule is totally shit and not working at all. + # should actually just ban these names as var names but reports errors when ever your using them like (x !== undefined) + # - error + # - any + # - Number + # - number + # - String + # - string + # - Boolean + # - boolean + # - Undefined + id-match: error + import/no-extraneous-dependencies: error + import/no-internal-modules: [error, { allow: ["aws-sdk/**/*", "rxjs/operators/*"]}] + import/order: error + jsdoc/check-alignment: 1 + # jsdoc/check-examples: 1 # its typescript.. + jsdoc/check-indentation: 1 + jsdoc/check-param-names: 1 + jsdoc/check-syntax: 1 + # jsdoc/check-tag-names: 1 + jsdoc/check-types: 1 + jsdoc/implements-on-classes: 1 + # jsdoc/match-description: 1 + jsdoc/newline-after-description: 1 + jsdoc/no-types: 1 + jsdoc/no-undefined-types: 1 + # jsdoc/require-description: 1 + # jsdoc/require-description-complete-sentence: 1 + # jsdoc/require-example: 1 + # jsdoc/require-hyphen-before-param-description: 1 + # jsdoc/require-jsdoc: 1 + # jsdoc/require-param: 1 + # jsdoc/require-param-description: 1 + # jsdoc/require-param-name: 1 + # jsdoc/require-param-type: 1 + # jsdoc/require-returns: 1 + jsdoc/require-returns-check: 1 + jsdoc/require-returns-description: 1 + # jsdoc/require-returns-type: 1 + jsdoc/valid-types: 1 + linebreak-style: off + max-classes-per-file: [error, 1] + max-len: off + new-parens: off + newline-per-chained-call: off + no-bitwise: error + no-caller: error + no-cond-assign: [error, always] + no-console: error + no-debugger: error + no-duplicate-case: error + no-duplicate-imports: error + no-empty: error + no-eval: error + no-extra-bind: error + no-extra-semi: off + no-fallthrough: off + no-invalid-this: off + no-irregular-whitespace: off + no-multiple-empty-lines: off + no-new-func: error + no-new-wrappers: error + no-redeclare: error + no-restricted-imports: [error, aws-sdk] + no-return-await: error + no-sequences: error + no-shadow: [error, {hoist: all} ] + no-sparse-arrays: error + no-template-curly-in-string: error + no-throw-literal: error + no-trailing-spaces: off + no-undef-init: error + no-underscore-dangle: error + no-unsafe-finally: error + no-unused-expressions: error + no-unused-labels: error + no-useless-constructor: error + # no-unused-vars: error # seems not to work fine in TS + no-var: error + object-shorthand: error + one-var: [error, never] + # prefer-arrow/prefer-arrow-functions: error # TODO --> SEE tslint-eeslint-config.log + prefer-const: error + prefer-object-spread: error + promise/always-return: error + promise/no-return-wrap: error + promise/param-names: error + promise/catch-or-return: error + promise/no-native: off + # promise/no-nesting: warn + promise/no-promise-in-callback: warn + promise/no-callback-in-promise: warn + # promise/avoid-new: warn + promise/no-new-statics: error + promise/no-return-in-finally: warn + promise/valid-params: warn + quote-props: off + radix: error + space-in-parens: [off, never] + spaced-comment: error + use-isnan: error + valid-typeof: off + # local rules located in tools/eslint-rules + local-rules/no-named-dynamo-import: error diff --git a/.lintstagedrc.yml b/.lintstagedrc.yml index db1e8fe49..f98dc9310 100644 --- a/.lintstagedrc.yml +++ b/.lintstagedrc.yml @@ -1,11 +1,5 @@ -"src/**/!(*.spec).ts": +"{src,test}/**/*.ts": - prettier --write --config ./.prettierrc.yml - - tslint --project ./tsconfig.json -t codeFrame --fix -"(src/**/*.spec.ts|test/**/*.ts)": - - prettier --write --config ./.prettierrc.yml - # TODO LOW tslint will not work because of the following error - # ✖ tslint --project ./tsconfig.jest.json -t codeFrame --fix found some errors. Please fix them and try committing again. - #'/Users/michaelwittwer/dev/shiftcode/dynamo-easy/test/models/complex.model.ts' is not included in project. - # - tslint --project ./tsconfig.jest.json -t codeFrame --fix + - eslint --config .eslintrc.yml --ext .ts --fix "**/package.json": - sort-package-json diff --git a/eslint-local-rules.js b/eslint-local-rules.js new file mode 100644 index 000000000..2c95d851a --- /dev/null +++ b/eslint-local-rules.js @@ -0,0 +1,5 @@ +'use strict' + +module.exports = { + 'no-named-dynamo-import': require('./tools/eslint-rules/no-named-dynamo-import'), +} diff --git a/package-lock.json b/package-lock.json index a6ad48b96..c58cc0c8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2164,6 +2164,12 @@ "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", "dev": true }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -2240,6 +2246,12 @@ "pretty-format": "^25.2.1" } }, + "@types/json-schema": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz", + "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==", + "dev": true + }, "@types/lodash": { "version": "4.14.137", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.137.tgz", @@ -2334,6 +2346,94 @@ "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.26.0.tgz", + "integrity": "sha512-4yUnLv40bzfzsXcTAtZyTjbiGUXMrcIJcIMioI22tSOyAxpdXiZ4r7YQUU8Jj6XXrLz9d5aMHPQf5JFR7h27Nw==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "2.26.0", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.26.0.tgz", + "integrity": "sha512-RELVoH5EYd+JlGprEyojUv9HeKcZqF7nZUGSblyAw1FwOGNnmQIU8kxJ69fttQvEwCsX5D6ECJT8GTozxrDKVQ==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.26.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.26.0.tgz", + "integrity": "sha512-+Xj5fucDtdKEVGSh9353wcnseMRkPpEAOY96EEenN7kJVrLqy/EVwtIh3mxcUz8lsFXW1mT5nN5vvEam/a5HiQ==", + "dev": true, + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "2.26.0", + "@typescript-eslint/typescript-estree": "2.26.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.26.0.tgz", + "integrity": "sha512-3x4SyZCLB4zsKsjuhxDLeVJN6W29VwBnYpCsZ7vIdPel9ZqLfIZJgJXO47MNUkurGpQuIBALdPQKtsSnWpE1Yg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^6.3.0", + "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", @@ -2374,6 +2474,12 @@ } } }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true + }, "acorn-walk": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", @@ -2536,6 +2642,17 @@ "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", "dev": true }, + "array-includes": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" + } + }, "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -2548,6 +2665,16 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, + "array.prototype.flat": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", + "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -3078,6 +3205,12 @@ "supports-color": "^5.2.0" } }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", @@ -3300,10 +3433,10 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "comment-parser": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.7.2.tgz", + "integrity": "sha512-4Rjb1FnxtOcv9qsfuaNuVsmmVn4ooVoBHzYfyKteiXwIU84PClyGA5jASoFMwPV93+FPh9spwueXauxFJZkGAg==", "dev": true }, "compare-func": { @@ -3334,6 +3467,12 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "conventional-changelog-angular": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.6.tgz", @@ -3692,6 +3831,15 @@ "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", "dev": true }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", @@ -3798,6 +3946,15 @@ } } }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "domexception": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", @@ -3959,47 +4116,779 @@ } } }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.1.tgz", + "integrity": "sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ==", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, + "eslint": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.3", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "inquirer": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "run-async": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", + "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + } + } + }, + "strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "eslint-config-prettier": { + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.10.1.tgz", + "integrity": "sha512-svTy6zh1ecQojvpbJSgH3aei/Rt7C6i090l5f2WQ4aB05lYHeZIR1qL4wZyyILTbtmnbHP5Yn8MrsOJMGa8RkQ==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + }, + "dependencies": { + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + } + } + }, + "eslint-import-resolver-node": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.3.tgz", + "integrity": "sha512-b8crLDo0M5RSe5YG8Pu2DYBj71tSB6OvXkfzwbJU2w7y8P4/yo0MyF8jU26IEuEuHF2K5/gcAJE3LhQGqBBbVg==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "resolve": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", + "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.20.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz", + "integrity": "sha512-FObidqpXrR8OnCh4iNsxy+WACztJLXAHBO5hK79T1Hc77PgQZkyDGA5Ag9xAvRpglvLNxhH/zSmZ70/pZ31dHg==", + "dev": true, + "requires": { + "array-includes": "^3.0.3", + "array.prototype.flat": "^1.2.1", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.2", + "eslint-module-utils": "^2.4.1", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.0", + "read-pkg-up": "^2.0.0", + "resolve": "^1.12.0" + }, + "dependencies": { + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "resolve": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", + "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "eslint-plugin-jsdoc": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-22.1.0.tgz", + "integrity": "sha512-54NdbICM7KrxsGUqQsev9aIMqPXyvyBx2218Qcm0TQ16P9CtBI+YY4hayJR6adrxlq4Ej0JLpgfUXWaQVFqmQg==", + "dev": true, + "requires": { + "comment-parser": "^0.7.2", + "debug": "^4.1.1", + "jsdoctypeparser": "^6.1.0", + "lodash": "^4.17.15", + "regextras": "^0.7.0", + "semver": "^6.3.0", + "spdx-expression-parse": "^3.0.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "eslint-plugin-local-rules": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-local-rules/-/eslint-plugin-local-rules-0.1.1.tgz", + "integrity": "sha512-+Wlic7MSxhVeGJT7a8vf7thVnzlRiessyHNaaOFT7PFlQS6Ff1oMO9vD803CSI5y6Nhu/+f+bVWGUDf8SRDxvg==", + "dev": true + }, + "eslint-plugin-prefer-arrow": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.1.7.tgz", + "integrity": "sha512-epsA4g804mRovlOHSbeO1xxW7REGeUjULRME9MJTJDOVscNIA01AkR66TP4cmHDfD+w72EQ9cPhf37MbZiFI2w==", + "dev": true + }, + "eslint-plugin-promise": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz", + "integrity": "sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==", + "dev": true + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", "dev": true, "requires": { - "is-arrayish": "^0.2.1" + "eslint-visitor-keys": "^1.1.0" } }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", "dev": true }, - "escodegen": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.1.tgz", - "integrity": "sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ==", + "espree": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", "dev": true, "requires": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" } }, "esprima": { @@ -4008,6 +4897,32 @@ "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, + "esquery": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.2.0.tgz", + "integrity": "sha512-weltsSqdeWIX9G2qQZz7KlTRJdkkOCTPgLYJUz1Hacf48R4YOwGPHO3+ORfWedqJKbq5WQmsgK90n+pFLIKt/Q==", + "dev": true, + "requires": { + "estraverse": "^5.0.0" + }, + "dependencies": { + "estraverse": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.0.0.tgz", + "integrity": "sha512-j3acdrMzqrxmJTNj5dbr1YbjacrYgAxVMeF0gK16E3j494mOe7xygM/ZLIguEQ0ETwAg2hlJCtHRGav+y0Ny5A==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", @@ -4183,6 +5098,17 @@ } } }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", @@ -4371,6 +5297,15 @@ "object-assign": "^4.1.0" } }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -4421,6 +5356,48 @@ "semver-regex": "^2.0.0" } }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -4512,6 +5489,18 @@ "dev": true, "optional": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "gensync": { "version": "1.0.0-beta.1", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", @@ -4705,6 +5694,15 @@ "har-schema": "^2.0.0" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -4720,6 +5718,12 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -5158,6 +6162,12 @@ "builtin-modules": "^1.0.0" } }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, "is-ci": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", @@ -5176,6 +6186,12 @@ "kind-of": "^3.0.2" } }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -5290,6 +6306,15 @@ "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", @@ -5302,6 +6327,21 @@ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-text-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", @@ -7112,6 +8152,12 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true }, + "jsdoctypeparser": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-6.1.0.tgz", + "integrity": "sha512-UCQBZ3xCUBv/PLfwKAJhp6jmGOSLFNKzrotXGNgbKhWvz27wPsCsVeP7gIcHPElQw2agBmynAitXqhxR58XAmA==", + "dev": true + }, "jsdom": { "version": "15.2.1", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-15.2.1.tgz", @@ -7189,6 +8235,12 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -12096,6 +13148,18 @@ } } }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -12113,6 +13177,18 @@ } } }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, "object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", @@ -12130,6 +13206,18 @@ } } }, + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -12193,6 +13281,12 @@ "windows-release": "^3.1.0" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, "p-each-series": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.1.0.tgz", @@ -12792,6 +13886,18 @@ "safe-regex": "^1.1.0" } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "regextras": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.7.0.tgz", + "integrity": "sha512-ds+fL+Vhl918gbAUb0k2gVKbTZLsg84Re3DI6p85Et0U0tYME3hyW4nMK8Px4dtDaBA2qNjvG5uWyW7eK5gfmw==", + "dev": true + }, "registry-auth-token": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.1.1.tgz", @@ -13925,6 +15031,48 @@ "strip-ansi": "^3.0.0" } }, + "string.prototype.trimend": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.0.tgz", + "integrity": "sha512-EEJnGqa/xNfIg05SxiPSqRS7S9qwDhYts1TSLR1BQfYUfPe1stofgGKvwERK9+9yf+PpfBMlpBaCHucXGPQfUA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimleft": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" + } + }, + "string.prototype.trimright": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.0.tgz", + "integrity": "sha512-iCP8g01NFYiiBOnwG1Xc3WZLyoo+RuBymwIlWncShXDDJYWN6DbnM3odslBJdgCdRlq94B5s63NWAZlcn2CS4w==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", @@ -14032,6 +15180,69 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "temp-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", @@ -14149,6 +15360,12 @@ "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", "dev": true }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, "throat": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", @@ -14203,6 +15420,15 @@ } } }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -14421,50 +15647,6 @@ "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", "dev": true }, - "tslint": { - "version": "5.19.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.19.0.tgz", - "integrity": "sha512-1LwwtBxfRJZnUvoS9c0uj8XQtAnyhWr9KlNvDIdB+oXyT+VpsOAaEhEgKi1HrZ8rq0ki/AAnbGSv4KM6/AfVZw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^3.2.0", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.8.0", - "tsutils": "^2.29.0" - }, - "dependencies": { - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - } - } - }, - "tslint-config-prettier": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz", - "integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==", - "dev": true - }, "tsutils": { "version": "3.17.1", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", @@ -14582,9 +15764,9 @@ "dev": true }, "typescript": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.1.tgz", - "integrity": "sha512-h6pM2f/GDchCFlldnriOhs1QHuwbnmj6/v7499eMHqPeW4V2G0elua2eIc2nu8v2NdHV0Gm+tzX83Hr6nUFjQA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.1.tgz", + "integrity": "sha512-jw7P2z/h6aPT4AENXDGjcfHTu5CSqzsbZc6YlUIebTyBAq8XaKp78x7VcSh30xwSCcsu5irZkYZUSFP1MrAMbg==", "dev": true }, "uglify-js": { @@ -14753,6 +15935,12 @@ "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", "dev": true }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true + }, "v8-to-istanbul": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-4.1.3.tgz", @@ -14957,6 +16145,15 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, "write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", diff --git a/package.json b/package.json index 6b37a37d8..f5a01768b 100644 --- a/package.json +++ b/package.json @@ -43,15 +43,13 @@ "commity": "commit", "docs:build": "rimraf ./dist/docs && typedoc --out dist/docs --readme ./doc-intro.md --target es6 --hideGenerator --theme minimal --excludePrivate --stripInternal --ignoreCompilerErrors", "docs:deploy": "ts-node tools/gh-pages-publish", - "lint": "tslint --project tsconfig.json -t codeFrame --fix", - "lint:ci": "tslint --project tsconfig.json -t codeFrame", + "lint": "eslint --config .eslintrc.yml --ext .ts --fix '{src,test}/**/*.ts'", + "lint:ci": "eslint --config .eslintrc.yml --ext .ts", "prettier": "prettier --write --config ./.prettierrc.yml '{src,test}/**/*.ts'", "report-coverage": "cat ./coverage/lcov.info | coveralls", "test": "jest", "test:ci": "jest --coverage --no-cache", - "test:watch": "jest --watch", - "tslint:custom-rule:build": "tsc ./tools/tslint/noDynamoNamedImportRule.ts", - "tslint:custom-rule:test": "tslint --test ./tools/tslint/test" + "test:watch": "jest --watch" }, "devDependencies": { "@commitlint/cli": "^8.1.0", @@ -60,9 +58,18 @@ "@types/jest": "^25.2.1", "@types/node": "8.10.40", "@types/uuid": "^3.4.5", + "@typescript-eslint/eslint-plugin": "^2.26.0", + "@typescript-eslint/parser": "^2.26.0", "aws-sdk": "^2.401.0", "colors": "^1.3.3", "coveralls": "^3.0.6", + "eslint": "^6.8.0", + "eslint-config-prettier": "^6.10.1", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-jsdoc": "^22.1.0", + "eslint-plugin-local-rules": "^0.1.1", + "eslint-plugin-prefer-arrow": "^1.1.7", + "eslint-plugin-promise": "^4.2.1", "husky": "^4.0.0", "jest": "^25.2.7", "lint-staged": "^10.0.0", @@ -74,12 +81,10 @@ "sort-package-json": "^1.22.1", "ts-jest": "^25.0.0", "ts-node": "^8.3.0", - "tslint": "^5.19.0", - "tslint-config-prettier": "^1.18.0", "tsutils": "^3.17.1", "typedoc": "0.14.0", "typedoc-plugin-external-module-name": "^2.1.0", - "typescript": ">=2.9.1", + "typescript": "^3.2.1", "uuid": "^3.3.2" }, "peerDependencies": { diff --git a/snippets/models/my-model.snippet.ts b/snippets/models/my-model.snippet.ts index 270a3079a..dc3dcdbd6 100644 --- a/snippets/models/my-model.snippet.ts +++ b/snippets/models/my-model.snippet.ts @@ -1,4 +1,3 @@ -// tslint:disable:no-unnecessary-class import { Model } from '@shiftcoders/dynamo-easy' @Model({ tableName: 'my-model-table-name' }) diff --git a/src/config/update-config.function.spec.ts b/src/config/update-config.function.spec.ts index 40c328fb7..3f826e5ba 100644 --- a/src/config/update-config.function.spec.ts +++ b/src/config/update-config.function.spec.ts @@ -1,5 +1,3 @@ -// tslint:disable:no-empty - import { resetDynamoEasyConfig } from '../../test/helper/resetDynamoEasyConfig.function' import { dateToNumberMapper } from '../mapper/custom/date-to-number.mapper' import { dynamoEasyConfig } from './dynamo-easy-config' @@ -42,6 +40,7 @@ describe('updateDynamoEasyConfig', () => { }) it('should work when providing valid stuff', () => { + /* eslint-disable-next-line @typescript-eslint/no-empty-function */ const myLogReceiver = () => {} const myDateMapper = { ...dateToNumberMapper } updateDynamoEasyConfig({ diff --git a/src/decorator/decorators.spec.ts b/src/decorator/decorators.spec.ts index 782b3bc7f..b93ad9b63 100644 --- a/src/decorator/decorators.spec.ts +++ b/src/decorator/decorators.spec.ts @@ -1,7 +1,4 @@ -// tslint:disable:max-classes-per-file -// tslint:disable:no-unnecessary-class -// tslint:disable:no-non-null-assertion -// tslint:disable:no-unused-variable +/* eslint-disable max-classes-per-file,,@typescript-eslint/no-non-null-assertion,@typescript-eslint/no-extraneous-class */ import { getMetaDataProperty } from '../../test/helper/get-meta-data-property.function' import { ComplexModel, diff --git a/src/decorator/impl/collection/collection-property.decorator.spec.ts b/src/decorator/impl/collection/collection-property.decorator.spec.ts index 3d0f40868..c99f992be 100644 --- a/src/decorator/impl/collection/collection-property.decorator.spec.ts +++ b/src/decorator/impl/collection/collection-property.decorator.spec.ts @@ -1,5 +1,4 @@ -// tslint:disable:max-classes-per-file -// tslint:disable:no-non-null-assertion +/* eslint-disable max-classes-per-file,@typescript-eslint/no-non-null-assertion */ import { FormId, formIdMapper } from '../../../../test/models/real-world' import { metadataForModel } from '../../metadata/metadata-for-model.function' import { Model } from '../model/model.decorator' diff --git a/src/decorator/impl/date/date-property.decorator.spec.ts b/src/decorator/impl/date/date-property.decorator.spec.ts index 57b541a95..68804e31e 100644 --- a/src/decorator/impl/date/date-property.decorator.spec.ts +++ b/src/decorator/impl/date/date-property.decorator.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable:no-non-null-assertion +/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { getMetaDataProperty } from '../../../../test/helper/get-meta-data-property.function' import { resetDynamoEasyConfig } from '../../../../test/helper/resetDynamoEasyConfig.function' import { updateDynamoEasyConfig } from '../../../config/update-config.function' diff --git a/src/decorator/impl/model/model.decorator.spec.ts b/src/decorator/impl/model/model.decorator.spec.ts index a7bdeaa3f..c63e71aa8 100644 --- a/src/decorator/impl/model/model.decorator.spec.ts +++ b/src/decorator/impl/model/model.decorator.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable:max-classes-per-file +/* eslint-disable max-classes-per-file */ import { GSIPartitionKey } from '../index/gsi-partition-key.decorator' import { GSISortKey } from '../index/gsi-sort-key.decorator' import { LSISortKey } from '../index/lsi-sort-key.decorator' @@ -14,8 +14,8 @@ describe('@model decorator', () => { it('throws when defining multiple partitionKeys for same gsi', () => { expect(() => { - // @ts-ignore @Model() + // @ts-ignore class FailModel { @GSIPartitionKey(IX_NAME) pk1: string @@ -28,8 +28,8 @@ describe('@model decorator', () => { }) it('throws when defining multiple sortKeys for same gsi', () => { expect(() => { - // @ts-ignore @Model() + // @ts-ignore class FailModel { @GSIPartitionKey(IX_NAME) pk1: string @@ -44,8 +44,8 @@ describe('@model decorator', () => { describe('getLocalSecondaryIndexes', () => { it('throws when defining LSI sortKey but no PartitionKey', () => { expect(() => { - // @ts-ignore @Model() + // @ts-ignore class FailModel { @LSISortKey(IX_NAME) sk1: string @@ -54,8 +54,8 @@ describe('@model decorator', () => { }) it('throws when defining multiple sortKeys for same lsi', () => { expect(() => { - // @ts-ignore @Model() + // @ts-ignore class FailModel { @PartitionKey() pk1: string diff --git a/src/decorator/impl/model/model.decorator.ts b/src/decorator/impl/model/model.decorator.ts index 6fbdac9ea..820074570 100644 --- a/src/decorator/impl/model/model.decorator.ts +++ b/src/decorator/impl/model/model.decorator.ts @@ -15,7 +15,6 @@ import { ModelData } from './model-data.model' * decorator to define a model for dynamo easy */ export function Model(opts: ModelData = {}): ClassDecorator { - // tslint:disable-next-line:ban-types return (constructor: Function) => { const type = constructor as any diff --git a/src/decorator/metadata/metadata.spec.ts b/src/decorator/metadata/metadata.spec.ts index df7127a14..825366342 100644 --- a/src/decorator/metadata/metadata.spec.ts +++ b/src/decorator/metadata/metadata.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable:no-non-null-assertion +/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { ComplexModel, FAIL_MODEL_GSI, diff --git a/src/decorator/metadata/metadata.ts b/src/decorator/metadata/metadata.ts index fcfee0b86..59ff2c04c 100644 --- a/src/decorator/metadata/metadata.ts +++ b/src/decorator/metadata/metadata.ts @@ -19,6 +19,7 @@ export type MetadataWithSortKey = Omit, 'getSortKey'> & { getSort /** * Checks if given metadata returns a sort key when calling metadata.getSortKey + * * @hidden */ export function hasSortKey(metadata: Metadata): metadata is MetadataWithSortKey { @@ -28,6 +29,10 @@ export function hasSortKey(metadata: Metadata): metadata is MetadataWithSo export class Metadata { readonly modelOptions: ModelMetadata + constructor(modelConstructor: ModelConstructor) { + this.modelOptions = Reflect.getMetadata(KEY_MODEL, modelConstructor) + } + private static findMetaDataForProperty( modelOpts: ModelMetadata, propertyName: keyof M, @@ -35,10 +40,6 @@ export class Metadata { return modelOpts.properties.find((property) => property.name === propertyName || property.nameDb === propertyName) } - constructor(modelConstructor: ModelConstructor) { - this.modelOptions = Reflect.getMetadata(KEY_MODEL, modelConstructor) - } - forProperty(propertyKey: keyof T | string): PropertyMetadata | undefined { if (this.modelOptions.properties.length === 0) { return @@ -49,7 +50,7 @@ export class Metadata { let currentMeta: ModelMetadata = this.modelOptions let lastPropMeta: PropertyMetadata | undefined let lastPathPart = '' - // tslint:disable-next-line:no-conditional-assignment + /* eslint-disable-next-line no-cond-assign */ while ((re = regex.exec(propertyKey)) !== null) { lastPathPart = re[1] lastPropMeta = Metadata.findMetaDataForProperty(currentMeta, lastPathPart) @@ -70,15 +71,15 @@ export class Metadata { /** * - * @returns {Array>} Returns all the properties property the @PartitionKeyUUID decorator is present, returns an empty array by default + * @returns Returns all the properties property the @PartitionKeyUUID decorator is present, returns an empty array by default */ getKeysWithUUID(): Array> { return filterBy(this.modelOptions, (p) => !!(p.key && p.key.uuid), []) } /** - * @param {string} indexName - * @returns {string} Returns the name of partition key (not the db name if it differs from property name) + * @param indexName + * @returns Returns the name of partition key (not the db name if it differs from property name) * @throws Throws an error if no partition key was defined for the current model * @throws Throws an error if an indexName was delivered but no index was found for given name */ @@ -106,8 +107,8 @@ export class Metadata { } /** - * @param {string} indexName - * @returns {keyof T} Returns the name of sort key (not the db name if it differs from property name) or null if none was defined + * @param indexName + * @returns Returns the name of sort key (not the db name if it differs from property name) or null if none was defined * @throws Throws an error if an indexName was delivered but no index was found for given name or the found index has no sort key defined */ getSortKey(indexName?: string): keyof T | null { @@ -130,15 +131,15 @@ export class Metadata { /** * - * @returns {SecondaryIndex[]} Returns all the secondary indexes if exists or an empty array if none is defined + * @returns Returns all the secondary indexes if exists or an empty array if none is defined */ getIndexes(): Array> { return Array.from(this.modelOptions.indexes.values()) } /** - * @param {string} indexName - * @returns {SecondaryIndex} Returns the index if one with given name exists, null otherwise + * @param indexName + * @returns Returns the index if one with given name exists, null otherwise */ getIndex(indexName: string): SecondaryIndex | null { return this.modelOptions.indexes.get(indexName) || null diff --git a/src/decorator/metadata/property-metadata.spec.ts b/src/decorator/metadata/property-metadata.spec.ts index cdcf1e8c6..86ff11c10 100644 --- a/src/decorator/metadata/property-metadata.spec.ts +++ b/src/decorator/metadata/property-metadata.spec.ts @@ -1,5 +1,5 @@ +/* eslint-disable max-classes-per-file,@typescript-eslint/no-non-null-assertion */ import { dateToStringMapper } from '../../mapper/custom/date-to-string.mapper' -// tslint:disable:no-non-null-assertion import { CollectionProperty } from '../impl/collection/collection-property.decorator' import { DateProperty } from '../impl/date/date-property.decorator' import { Model } from '../impl/model/model.decorator' diff --git a/src/dynamo/batchget/batch-get-full.response.ts b/src/dynamo/batchget/batch-get-full.response.ts index bd7057fd3..8d48798a0 100644 --- a/src/dynamo/batchget/batch-get-full.response.ts +++ b/src/dynamo/batchget/batch-get-full.response.ts @@ -1,8 +1,6 @@ /** * @module multi-model-requests/batch-get */ - -// tslint:disable-next-line:interface-over-type-literal import * as DynamoDB from 'aws-sdk/clients/dynamodb' import { BatchGetResponse } from './batch-get.response' diff --git a/src/dynamo/batchget/batch-get-utils.ts b/src/dynamo/batchget/batch-get-utils.ts index bf50daec6..6e37154f2 100644 --- a/src/dynamo/batchget/batch-get-utils.ts +++ b/src/dynamo/batchget/batch-get-utils.ts @@ -8,6 +8,7 @@ import { DynamoDbWrapper } from '../dynamo-db-wrapper' /** * Function which executes batchGetItem operations until all given items (as params) are processed (fetched). * Between each follow-up request (in case of unprocessed items) a delay is interposed calculated by the given backoffTime and throttleTimeSlot. + * * @param dynamoDBWrapper * @param params containing the keys per table to create the batchGet operation * @param backoffTimer used to determine how many time slots the follow-up request should be delayed @@ -61,6 +62,7 @@ export function hasUnprocessedKeys( /** * combines a first with a second response. ConsumedCapacity is always from the latter. + * * @hidden */ export function combineBatchGetResponses(response1: DynamoDB.BatchGetItemOutput) { diff --git a/src/dynamo/batchget/batch-get.request.spec.ts b/src/dynamo/batchget/batch-get.request.spec.ts index 8f8597c1b..ec6c5610e 100644 --- a/src/dynamo/batchget/batch-get.request.spec.ts +++ b/src/dynamo/batchget/batch-get.request.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable:no-non-null-assertion +/* eslint-disable @typescript-eslint/no-non-null-assertion */ import * as DynamoDB from 'aws-sdk/clients/dynamodb' import { Organization, SimpleWithCompositePartitionKeyModel, SimpleWithPartitionKeyModel } from '../../../test/models' import { toDb } from '../../mapper/mapper' diff --git a/src/dynamo/batchget/batch-get.request.ts b/src/dynamo/batchget/batch-get.request.ts index 021497f8f..bd0a324e7 100644 --- a/src/dynamo/batchget/batch-get.request.ts +++ b/src/dynamo/batchget/batch-get.request.ts @@ -44,6 +44,7 @@ export class BatchGetRequest { /** * read items of model by key + * * @param modelClazz the corresponding ModelConstructor * @param keys an array of partials of T that contains PartitionKey and SortKey (if necessary). Throws if missing. * @param consistentRead set to true so the operation uses strongly consistent reads, default false @@ -79,6 +80,7 @@ export class BatchGetRequest { /** * execute the request and return the raw response (without parsing the attributes to js objects) + * * @param backoffTimer when unprocessed items are returned the next value of backoffTimer is used to determine how many time slots to wait before doing the next request * @param throttleTimeSlot the duration of a time slot in ms */ @@ -91,6 +93,7 @@ export class BatchGetRequest { /** * execute and return full response with the mapped js objects per table + * * @param backoffTimer when unprocessed items are returned the next value of backoffTimer is used to determine how many time slots to wait before doing the next request * @param throttleTimeSlot the duration of a time slot in ms */ @@ -103,6 +106,7 @@ export class BatchGetRequest { /** * execute and return the parsed items per table + * * @param backoffTimer when unprocessed items are returned the next value of backoffTimer is used to determine how many time slots to wait before doing the next request * @param throttleTimeSlot the duration of a time slot in ms */ diff --git a/src/dynamo/batchget/batch-get.response.ts b/src/dynamo/batchget/batch-get.response.ts index 1164eab32..36c3434f7 100644 --- a/src/dynamo/batchget/batch-get.response.ts +++ b/src/dynamo/batchget/batch-get.response.ts @@ -4,5 +4,4 @@ /** * Response from {@link BatchGetRequest}::exec */ -// tslint:disable-next-line:interface-over-type-literal export type BatchGetResponse = Record diff --git a/src/dynamo/batchwrite/batch-write-utils.ts b/src/dynamo/batchwrite/batch-write-utils.ts index 320d9ab1a..18813929a 100644 --- a/src/dynamo/batchwrite/batch-write-utils.ts +++ b/src/dynamo/batchwrite/batch-write-utils.ts @@ -8,6 +8,7 @@ import { DynamoDbWrapper } from '../dynamo-db-wrapper' /** * Function which executes batchWriteItem operations until all given items (as params) are processed (written). * Between each follow-up request (in case of unprocessed items) a delay is interposed calculated by the given backoffTime and throttleTimeSlot. + * * @param dynamoDBWrapper * @param params containing the items per table to create the batchWrite operation * @param backoffTimer used to determine how many time slots the follow-up request should be delayed @@ -19,7 +20,7 @@ export function batchWriteItemsWriteAll( params: DynamoDB.BatchWriteItemInput, backoffTimer: IterableIterator, throttleTimeSlot: number, -): Promise { +): Promise { return dynamoDBWrapper.batchWriteItem(params).then((response) => { if (hasUnprocessedItems(response)) { // in case of unprocessedItems do a follow-up requests diff --git a/src/dynamo/batchwrite/batch-write.request.ts b/src/dynamo/batchwrite/batch-write.request.ts index cfa5f9bff..c92daed44 100644 --- a/src/dynamo/batchwrite/batch-write.request.ts +++ b/src/dynamo/batchwrite/batch-write.request.ts @@ -47,6 +47,7 @@ export class BatchWriteRequest { /** * add keys for deletion + * * @param modelClazz the corresponding ModelConstructor * @param keys an array of partials of T that contains PartitionKey and SortKey (if necessary). Throws if missing. */ @@ -57,6 +58,7 @@ export class BatchWriteRequest { /** * add items to put + * * @param modelClazz the corresponding ModelConstructor * @param items the items to put */ @@ -67,10 +69,12 @@ export class BatchWriteRequest { /** * execute request + * * @param backoffTimer generator for how much timeSlots should be waited before requesting next batch. only used when capacity was exceeded. default randomExponentialBackoffTimer * @param throttleTimeSlot defines how long one timeSlot is for throttling, default 1 second */ exec(backoffTimer = randomExponentialBackoffTimer, throttleTimeSlot = BATCH_WRITE_DEFAULT_TIME_SLOT): Promise { + /* eslint-disable-next-line arrow-body-style */ return this.write(backoffTimer, throttleTimeSlot).then(() => { return }) @@ -78,6 +82,7 @@ export class BatchWriteRequest { /** * execute request and return (last) response + * * @param backoffTimer generator for how much timeSlots should be waited before requesting next batch. only used when capacity was exceeded. default randomExponentialBackoffTimer * @param throttleTimeSlot defines how long one timeSlot is for throttling, default 1 second */ @@ -107,7 +112,7 @@ export class BatchWriteRequest { return (item: Partial): DynamoDB.WriteRequest => ({ DeleteRequest: { Key: toKey(item) } }) } - private createPutRequest = (modelClazz: ModelConstructor) => { - return (item: T): DynamoDB.WriteRequest => ({ PutRequest: { Item: toDb(item, modelClazz) } }) - } + private createPutRequest = (modelClazz: ModelConstructor) => (item: T): DynamoDB.WriteRequest => ({ + PutRequest: { Item: toDb(item, modelClazz) }, + }) } diff --git a/src/dynamo/dynamo-db-wrapper.spec.ts b/src/dynamo/dynamo-db-wrapper.spec.ts index 24e562b30..ad4b11c84 100644 --- a/src/dynamo/dynamo-db-wrapper.spec.ts +++ b/src/dynamo/dynamo-db-wrapper.spec.ts @@ -1,6 +1,3 @@ -// tslint:disable:no-empty -// tslint:disable:no-unnecessary-callback-wrapper - import * as DynamoDB from 'aws-sdk/clients/dynamodb' import { resetDynamoEasyConfig } from '../../test/helper/resetDynamoEasyConfig.function' import { updateDynamoEasyConfig } from '../config/update-config.function' @@ -113,7 +110,6 @@ describe('dynamo rx', () => { }) describe('query', () => { - beforeEach(() => {}) it('should throw when no KeyConditionExpression was given', () => { const dynamoDBWrapper = new DynamoDbWrapper() expect(() => dynamoDBWrapper.query({ TableName: 'tableName' })).toThrow() diff --git a/src/dynamo/dynamo-db-wrapper.ts b/src/dynamo/dynamo-db-wrapper.ts index ce6dab5b0..fbc5c524e 100644 --- a/src/dynamo/dynamo-db-wrapper.ts +++ b/src/dynamo/dynamo-db-wrapper.ts @@ -7,6 +7,7 @@ import { dynamoEasyConfig } from '../config/dynamo-easy-config' /** * Simply calls the sessionValidityEnsurer before each standard dynamoDB operations and returns a promise for each * request + * * @hidden */ export class DynamoDbWrapper { diff --git a/src/dynamo/dynamo-store.spec.ts b/src/dynamo/dynamo-store.spec.ts index c4b2371fc..1fdcb5fd2 100644 --- a/src/dynamo/dynamo-store.spec.ts +++ b/src/dynamo/dynamo-store.spec.ts @@ -1,6 +1,4 @@ -// tslint:disable:max-classes-per-file -// tslint:disable:no-unnecessary-class -// tslint:disable:no-unused-expression +/* eslint-disable max-classes-per-file, @typescript-eslint/no-extraneous-class */ import * as DynamoDB from 'aws-sdk/clients/dynamodb' import { resetDynamoEasyConfig } from '../../test/helper/resetDynamoEasyConfig.function' import { SimpleWithPartitionKeyModel } from '../../test/models' diff --git a/src/dynamo/expression/condition-expression-builder.spec.ts b/src/dynamo/expression/condition-expression-builder.spec.ts index ce565020d..48dffe9aa 100644 --- a/src/dynamo/expression/condition-expression-builder.spec.ts +++ b/src/dynamo/expression/condition-expression-builder.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable:max-classes-per-file +/* eslint-disable max-classes-per-file */ import { ComplexModel } from '../../../test/models' import { Form, FormId, formIdMapper, FormType } from '../../../test/models/real-world' import { CollectionProperty } from '../../decorator/impl/collection/collection-property.decorator' diff --git a/src/dynamo/expression/condition-expression-builder.ts b/src/dynamo/expression/condition-expression-builder.ts index ffa36eece..d31f69f91 100644 --- a/src/dynamo/expression/condition-expression-builder.ts +++ b/src/dynamo/expression/condition-expression-builder.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-template-curly-in-string */ /** * @module expression */ @@ -41,9 +42,7 @@ type BuildFilterFn = ( /** * Will walk the object tree recursively and removes all items which do not satisfy the filterFn - * @param obj - * @param {(value: any) => boolean} filterFn - * @returns {any} + * * @hidden */ export function deepFilter(obj: any, filterFn: (value: any) => boolean): any { @@ -94,12 +93,11 @@ export function deepFilter(obj: any, filterFn: (value: any) => boolean): any { * Will create a condition which can be added to a request using the param object. * It will create the expression statement and the attribute names and values. * - * @param {string} attributePath - * @param {ConditionOperator} operator - * @param {any[]} values Depending on the operator the amount of values differs - * @param {string[]} existingValueNames If provided the existing names are used to make sure we have a unique name for the current attributePath - * @param {Metadata} metadata If provided we use the metadata to define the attribute name and use it to map the given value(s) to attributeValue(s) - * @returns {Expression} + * @param attributePath + * @param operator + * @param values Depending on the operator the amount of values differs + * @param existingValueNames If provided the existing names are used to make sure we have a unique name for the current attributePath + * @param metadata If provided we use the metadata to define the attribute name and use it to map the given value(s) to attributeValue(s) * @hidden */ export function buildFilterExpression( @@ -162,11 +160,6 @@ export function buildFilterExpression( /** * IN expression is unlike all the others property the operand is an array of unwrapped values (not attribute values) * - * @param {string} attributePath - * @param {string[]} values - * @param {string[]} existingValueNames - * @param {PropertyMetadata} propertyMetadata - * @returns {Expression} * @hidden */ function buildInConditionExpression( @@ -317,7 +310,6 @@ function validateForOperator(operator: ConditionOperator, values?: any[]) { } } -// tslint:disable:no-invalid-template-strings /* * error messages for arity issues */ @@ -329,11 +321,11 @@ export const ERR_ARITY_IN = /** * @hidden + * TODO: fix. stop using {@link dynamicTemplate} */ export const ERR_ARITY_DEFAULT = 'expected ${parameterArity} value(s) for operator ${operator}, this is not the right amount of method parameters for this operator' -// tslint:enable:no-invalid-template-strings /** * @hidden */ @@ -362,7 +354,6 @@ function validateArity(operator: ConditionOperator, values?: any[]) { /* * error message for wrong operator values */ -// tslint:disable:no-invalid-template-strings /** * @hidden */ @@ -373,11 +364,10 @@ export const ERR_VALUES_BETWEEN_TYPE = */ export const ERR_VALUES_IN = 'the provided value for IN operator must be an array' -// tslint:enable:no-invalid-template-strings - /** * Every operator has some constraints about the values it supports, this method makes sure everything is fine for given * operator and values + * * @hidden */ function validateValues(operator: ConditionOperator, values: any[]) { diff --git a/src/dynamo/expression/functions/attribute-names.function.ts b/src/dynamo/expression/functions/attribute-names.function.ts index 905dc00e9..f1fbc82cf 100644 --- a/src/dynamo/expression/functions/attribute-names.function.ts +++ b/src/dynamo/expression/functions/attribute-names.function.ts @@ -13,7 +13,6 @@ export function resolveAttributeNames( metadata?: Metadata | undefined, ): { placeholder: string; attributeNames: Record } { let placeholder: string - // tslint:disable-next-line:no-shadowed-variable const attributeNames: Record = {} if (new RegExp(NESTED_ATTR_PATH_REGEX).test(attributePath)) { const regex = new RegExp(NESTED_ATTR_PATH_CAPTURED_REGEX) @@ -21,7 +20,7 @@ export function resolveAttributeNames( const currentPath = [] let regExpResult: RegExpExecArray | null const namePlaceholders: string[] = [] - // tslint:disable-next-line:no-conditional-assignment + /* eslint-disable-next-line no-cond-assign */ while ((regExpResult = regex.exec(attributePath)) !== null) { // path part is pos 1 - full match would be 0 const pathPart = regExpResult[1] diff --git a/src/dynamo/expression/functions/is-function-operator.function.ts b/src/dynamo/expression/functions/is-function-operator.function.ts index 1d4368138..5d054a392 100644 --- a/src/dynamo/expression/functions/is-function-operator.function.ts +++ b/src/dynamo/expression/functions/is-function-operator.function.ts @@ -7,8 +7,9 @@ import { FunctionOperator } from '../type/function-operator.type' /** * An operator can either be an comparator or a function, this method helps to check for function operator - * @param {ConditionOperator} operator - * @returns {boolean} Returns true if the operator is a function operator, false otherwise + * + * @param operator + * @returns Returns true if the operator is a function operator, false otherwise * @hidden */ export function isFunctionOperator(operator: ConditionOperator): operator is FunctionOperator { diff --git a/src/dynamo/expression/functions/is-no-param-function-operator.function.ts b/src/dynamo/expression/functions/is-no-param-function-operator.function.ts index ee7fbc91e..b4e92d0bf 100644 --- a/src/dynamo/expression/functions/is-no-param-function-operator.function.ts +++ b/src/dynamo/expression/functions/is-no-param-function-operator.function.ts @@ -5,7 +5,7 @@ import { NON_PARAM_FUNCTION_OPERATORS } from '../non-param-function-operators.co import { FunctionOperator } from '../type/function-operator.type' /** - * @returns {boolean} Returns true for all function operators with no param false otherwise + * @returns Returns true for all function operators with no param false otherwise * @hidden */ export function isNoParamFunctionOperator(operator: FunctionOperator): boolean { diff --git a/src/dynamo/expression/functions/operator-parameter-arity.function.ts b/src/dynamo/expression/functions/operator-parameter-arity.function.ts index 27f91c7bf..88f8373b7 100644 --- a/src/dynamo/expression/functions/operator-parameter-arity.function.ts +++ b/src/dynamo/expression/functions/operator-parameter-arity.function.ts @@ -9,7 +9,7 @@ import { isNoParamFunctionOperator } from './is-no-param-function-operator.funct * Every expression condition operator has a predefined arity (amount) of function parameters, this method * returns this value * - * @returns {number} The amount of required method parameters when calling an operator function + * @returns The amount of required method parameters when calling an operator function * @hidden */ export function operatorParameterArity(operator: ConditionOperator): number { diff --git a/src/dynamo/expression/functions/resolve-attribute-value-name-conflicts.function.ts b/src/dynamo/expression/functions/resolve-attribute-value-name-conflicts.function.ts index 8229d70e4..0094449f9 100644 --- a/src/dynamo/expression/functions/resolve-attribute-value-name-conflicts.function.ts +++ b/src/dynamo/expression/functions/resolve-attribute-value-name-conflicts.function.ts @@ -8,6 +8,7 @@ import { uniqueAttributeValueName } from './unique-attribute-value-name.function /** * resolves name conflict when expression uses an attributeValueName that is already used in given *Input + * * @param expression * @param params * @return safe-to-use Expression diff --git a/src/dynamo/expression/functions/unique-attribute-value-name.function.ts b/src/dynamo/expression/functions/unique-attribute-value-name.function.ts index 851a0edc0..6e9226147 100644 --- a/src/dynamo/expression/functions/unique-attribute-value-name.function.ts +++ b/src/dynamo/expression/functions/unique-attribute-value-name.function.ts @@ -11,7 +11,7 @@ export const BRACED_INDEX_REGEX = /\[(\d+)]/g /** * Creates a unique attribute value placeholder name to use in the expression * - * @returns {string} The unique attribute value placeholder name in respect to the given existing value names (no duplicates allowed) + * @returns The unique attribute value placeholder name in respect to the given existing value names (no duplicates allowed) * @hidden */ export function uniqueAttributeValueName(key: string, existingValueNames?: string[]): string { diff --git a/src/dynamo/expression/logical-operator/and.function.ts b/src/dynamo/expression/logical-operator/and.function.ts index 5798964a7..b41f7e7c3 100644 --- a/src/dynamo/expression/logical-operator/and.function.ts +++ b/src/dynamo/expression/logical-operator/and.function.ts @@ -6,6 +6,7 @@ import { mergeConditions } from './merge-conditions.function' /** * function to combine multiple conditions with 'and' + * * @example * ```typescript * and(attribute('propA').eq('foo'), attribute('propB').eq('bar')) diff --git a/src/dynamo/expression/logical-operator/attribute.function.ts b/src/dynamo/expression/logical-operator/attribute.function.ts index 5d3924d26..f8302a131 100644 --- a/src/dynamo/expression/logical-operator/attribute.function.ts +++ b/src/dynamo/expression/logical-operator/attribute.function.ts @@ -10,13 +10,13 @@ import { /** * Use this method when accessing a top level attribute of a model with strict typing of the value in chained function + * * @example * ```typescript * - * @Model() - * class Person{ - * - * @PartitionKeyUUID() + * \@Model() + * class Person { + * \@PartitionKeyUUID() * id: string * age: number * } @@ -40,6 +40,7 @@ export function attribute2( /** * Use this method when accessing a top level attribute of a model to have type checking of the attributePath + * * @example * ```typescript * attribute('myProp').eq('foo') diff --git a/src/dynamo/expression/logical-operator/not.function.ts b/src/dynamo/expression/logical-operator/not.function.ts index 8e136031c..43b03f754 100644 --- a/src/dynamo/expression/logical-operator/not.function.ts +++ b/src/dynamo/expression/logical-operator/not.function.ts @@ -7,6 +7,7 @@ import { Expression } from '../type/expression.type' /** * function to negate a condition + * * @example * ```typescript * not(attribute('propA').eq('foo')) diff --git a/src/dynamo/expression/logical-operator/or.function.ts b/src/dynamo/expression/logical-operator/or.function.ts index 18b3fc44f..88867f5c2 100644 --- a/src/dynamo/expression/logical-operator/or.function.ts +++ b/src/dynamo/expression/logical-operator/or.function.ts @@ -6,6 +6,7 @@ import { mergeConditions } from './merge-conditions.function' /** * function to combine multiple conditions with or + * * @example * ```typescript * or(attribute('propA').eq('foo'), attribute('propB').eq('bar')) diff --git a/src/dynamo/expression/logical-operator/update.function.ts b/src/dynamo/expression/logical-operator/update.function.ts index 16ce4d566..7b6d78bec 100644 --- a/src/dynamo/expression/logical-operator/update.function.ts +++ b/src/dynamo/expression/logical-operator/update.function.ts @@ -10,12 +10,13 @@ import { /** * Use this method when accessing a top level attribute of a model with strict typing of the value in chained function + * * @example * ```typescript - * @Model() + * \@Model() * class Person { * - * @PartitionKeyUUID() + * \@PartitionKeyUUID() * id: string * age: number * } @@ -38,6 +39,7 @@ export function update2( /** * Use this method when accessing a top level attribute of a model to have type checking for attributePath + * * @example * ```typescript * update('myProp').set('foo') diff --git a/src/dynamo/expression/param-util.ts b/src/dynamo/expression/param-util.ts index f88ca7a3b..6c09b1ee4 100644 --- a/src/dynamo/expression/param-util.ts +++ b/src/dynamo/expression/param-util.ts @@ -86,6 +86,7 @@ export function mergeUpdateExpressions(expression1: string, expression2: string) /** * Will return an object containing all the update statements mapped to an update action keyword + * * @hidden */ function splitUpdateExpressionToActionKeyword(updateExpression: string): UpdateExpressionsByKeyword { diff --git a/src/dynamo/expression/prepare-and-add-update-expressions.function.ts b/src/dynamo/expression/prepare-and-add-update-expressions.function.ts index e282073d2..e8e7041db 100644 --- a/src/dynamo/expression/prepare-and-add-update-expressions.function.ts +++ b/src/dynamo/expression/prepare-and-add-update-expressions.function.ts @@ -20,9 +20,7 @@ export function prepareAndAddUpdateExpressions( ) { if (updateDefFns && updateDefFns.length) { const sortedByActionKeyWord: Map = updateDefFns - .map((updateDefFn) => { - return updateDefFn(params.ExpressionAttributeNames, metadata) - }) + .map((updateDefFn) => updateDefFn(params.ExpressionAttributeNames, metadata)) .reduce((result, expr) => { const actionKeyword = expr.type if (!result.has(actionKeyword)) { diff --git a/src/dynamo/expression/request-expression-builder.ts b/src/dynamo/expression/request-expression-builder.ts index 7555f9463..1686008af 100644 --- a/src/dynamo/expression/request-expression-builder.ts +++ b/src/dynamo/expression/request-expression-builder.ts @@ -34,6 +34,7 @@ import { buildUpdateExpression } from './update-expression-builder' /** * return the update-functions which then can apply an updateDefinition to the given request.params * and afterwards will return the request object (which allows chaining) + * * @param attributePath * @param request * @param metadata @@ -45,9 +46,9 @@ export function addUpdate( metadata: Metadata, ): RequestUpdateFunction { // f the function to create the update functions - const f = (operator: UpdateActionDef) => { + const f = (operator: UpdateActionDef) => // return the function the user will call in the end - return (...values: any[]): R => { + (...values: any[]): R => { const copy = [...values] const curried = curry< string, @@ -62,7 +63,7 @@ export function addUpdate( // return the request so the user can continue to chain return request } - } + // let the update functions be created with f return createUpdateFunctions>(f) } @@ -70,6 +71,7 @@ export function addUpdate( /** * return the condition-functions which then can apply a conditionDefinition to the given request.params * and afterwards will return the request object (which allows chaining) + * * @hidden */ export function addCondition( @@ -79,12 +81,11 @@ export function addCondition, ): RequestConditionFunctionTyped { // f the function to create the condition functions - const f = (operator: ConditionOperator) => { + const f = (operator: ConditionOperator) => // return the function the user will call in the end - return (...values: any[]): R => { - return doAddCondition(expressionType, attributePath, request, metadata, operator, ...values) - } - } + (...values: any[]): R => + doAddCondition(expressionType, attributePath, request, metadata, operator, ...values) + return createConditionFunctions>(f) } @@ -114,12 +115,10 @@ export function addSortKeyCondition( metadata?: Metadata, ): SortKeyConditionFunction { // f the function to create the condition functions - const f = (operator: ConditionOperator) => { + const f = (operator: ConditionOperator) => // return the function the user will call in the end - return (...values: any[]): R => { - return doAddCondition('KeyConditionExpression', keyName, request, metadata, operator, ...values) - } - } + (...values: any[]): R => + doAddCondition('KeyConditionExpression', keyName, request, metadata, operator, ...values) // only a subset of available operators are supported for sort keys return createConditionFunctions(f, '=', '<=', '<', '>', '>=', 'begins_with', 'BETWEEN') @@ -185,9 +184,9 @@ export function updateDefinitionFunction( ): UpdateExpressionDefinitionChainTyped export function updateDefinitionFunction(attributePath: keyof T): UpdateExpressionDefinitionChain { // f the function to create the update functions - const f = (operation: UpdateActionDef) => { + const f = (operation: UpdateActionDef) => // return the function the user will call in the end - return (...values: any[]): UpdateExpressionDefinitionFunction => { + (...values: any[]): UpdateExpressionDefinitionFunction => { const copy = [...values] const curried = curry< string, @@ -200,7 +199,7 @@ export function updateDefinitionFunction(attributePath: keyof T): UpdateExpre // return the UpdateExpressionDefinitionFunction which the request will execute return curried(attributePath, operation, copy) } - } + // let the update functions be created with f return createUpdateFunctions(f) } @@ -213,14 +212,10 @@ export function propertyDefinitionFunction( attributePath: K, ): ConditionExpressionDefinitionChainTyped export function propertyDefinitionFunction(attributePath: keyof T): ConditionExpressionDefinitionChain { - const f = (operator: ConditionOperator) => { - return (...values: any[]): ConditionExpressionDefinitionFunction => { - const copy = [...values] - const curried = curry, Expression>( - buildFilterExpression, - ) - return curried(attributePath, operator, copy) - } + const f = (operator: ConditionOperator) => (...values: any[]): ConditionExpressionDefinitionFunction => { + const copy = [...values] + const curried = curry, Expression>(buildFilterExpression) + return curried(attributePath, operator, copy) } return createConditionFunctions(f) @@ -230,7 +225,7 @@ export function propertyDefinitionFunction(attributePath: keyof T): Condition * Creates an object which contains callable functions for all update operations defined in update-operation type * for all the values included in operators * - * @param {(operator: ConditionOperator) => any} impl The function which is called with the operator and returns a function which expects the value + * @param impl The function which is called with the operator and returns a function which expects the value * for the condition. when executed the implementation defines what to do with the condition, just return it for example or add the condition to the request * parameters as another example * @hidden @@ -247,7 +242,7 @@ function createUpdateFunctions(impl: (operation: UpdateActionDef) => any): T * Creates an object which contains callable functions for all aliases defined in CONDITION_OPERATOR_ALIAS or if operators parameter is defined, * for all the values included in operators * - * @param {(operator: ConditionOperator) => any} impl The function which is called with the operator and returns a function which expects the value + * @param impl The function which is called with the operator and returns a function which expects the value * for the condition. when executed the implementation defines what to do with the condition, just return it for example or add the condition to the request * parameters as another example * @hidden diff --git a/src/dynamo/expression/type/condition-operator-to-alias-map.const.ts b/src/dynamo/expression/type/condition-operator-to-alias-map.const.ts index 037d11f98..f6866e146 100644 --- a/src/dynamo/expression/type/condition-operator-to-alias-map.const.ts +++ b/src/dynamo/expression/type/condition-operator-to-alias-map.const.ts @@ -1,3 +1,4 @@ +/* eslint-disable camelcase */ /** * @module expression */ @@ -6,6 +7,7 @@ import { ConditionOperator } from './condition-operator.type' /** * mapped type + * * @hidden */ export interface AliasedOperatorMapEntry extends Record { diff --git a/src/dynamo/expression/type/condition-operator.type.ts b/src/dynamo/expression/type/condition-operator.type.ts index f3d7be9d0..281ebc272 100644 --- a/src/dynamo/expression/type/condition-operator.type.ts +++ b/src/dynamo/expression/type/condition-operator.type.ts @@ -4,12 +4,10 @@ import { ComparatorOperator } from './comparator-operator.type' import { FunctionOperator } from './function-operator.type' -/** - * +/* * http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Syntax * - * condition-expression ::= - * operand comparator operand + * condition-expression ::= operand comparator operand * | operand BETWEEN operand AND operand * | operand IN ( operand (',' operand (, ...) )) * | function @@ -33,6 +31,9 @@ import { FunctionOperator } from './function-operator.type' * | begins_with (path, substr) * | contains (path, operand) * | size (path) + */ + +/** * @hidden */ export type ConditionOperator = FunctionOperator | ComparatorOperator diff --git a/src/dynamo/expression/type/update-action-def.ts b/src/dynamo/expression/type/update-action-def.ts index cac27f034..de0521ec2 100644 --- a/src/dynamo/expression/type/update-action-def.ts +++ b/src/dynamo/expression/type/update-action-def.ts @@ -5,5 +5,11 @@ import { UpdateActionKeyword } from './update-action-keyword.type' import { UpdateAction } from './update-action.type' export class UpdateActionDef { - constructor(public actionKeyword: UpdateActionKeyword, public action: UpdateAction) {} + actionKeyword: UpdateActionKeyword + action: UpdateAction + + constructor(actionKeyword: UpdateActionKeyword, action: UpdateAction) { + this.actionKeyword = actionKeyword + this.action = action + } } diff --git a/src/dynamo/expression/type/update-action.type.ts b/src/dynamo/expression/type/update-action.type.ts index e6e3c0e03..abcf2bc84 100644 --- a/src/dynamo/expression/type/update-action.type.ts +++ b/src/dynamo/expression/type/update-action.type.ts @@ -13,6 +13,7 @@ * [ DELETE action [, action] ...] * * we provide our own aliases for easier usage + * * @hidden */ export type UpdateAction = diff --git a/src/dynamo/expression/type/update-expression-definition-chain.ts b/src/dynamo/expression/type/update-expression-definition-chain.ts index 27f8069b7..156d28ef4 100644 --- a/src/dynamo/expression/type/update-expression-definition-chain.ts +++ b/src/dynamo/expression/type/update-expression-definition-chain.ts @@ -15,12 +15,14 @@ export interface UpdateFunctions { ---------------------------------------------------------------- */ /** * only works for numbers. So it either is a number or maps to a NumberAttribute (with custom mapper) + * * @param value which maps to NumberAttribute */ incrementBy: (value: T) => R /** * only works for numbers. So it either is a number or maps to a NumberAttribute (with custom mapper) + * * @param value which maps to NumberAttribute */ decrementBy: (value: T) => R @@ -66,8 +68,8 @@ export interface UpdateFunctions { * --update-expression "ADD QuantityOnHand :q" \ * --expression-attribute-values '{":q": {"N": "5"}}' \ * - * --update-expression "ADD Color :c" \ - * --expression-attribute-values '{":c": {"SS":["Orange", "Purple"]}}' \ + * --update-expression "ADD Color :c" \ + * --expression-attribute-values '{":c": {"SS":["Orange", "Purple"]}}' \ */ add: (values: T | Array> | Set>) => R @@ -76,8 +78,8 @@ export interface UpdateFunctions { ---------------------------------------------------------------- */ /** * delete items from sets + * * @param values {multiple values as Array | Set} - * @returns {R} * * --update-expression "DELETE Color :p" \ * --expression-attribute-values '{":p": {"SS": ["Yellow", "Purple"]}}' diff --git a/src/dynamo/expression/update-expression-builder.ts b/src/dynamo/expression/update-expression-builder.ts index 48d3d9923..b180e8e6b 100644 --- a/src/dynamo/expression/update-expression-builder.ts +++ b/src/dynamo/expression/update-expression-builder.ts @@ -21,12 +21,11 @@ import { UpdateExpression } from './type/update-expression.type' * Will create a condition which can be added to a request using the param object. * It will create the expression statement and the attribute names and values. * - * @param {string} attributePath - * @param {ConditionOperator} operation - * @param {any[]} values Depending on the operation the amount of values differs - * @param {string[]} existingValueNames If provided the existing names are used to make sure we have a unique name for the current attributePath - * @param {Metadata} metadata If provided we use the metadata to define the attribute name and use it to map the given value(s) to attributeValue(s) - * @returns {Expression} + * @param attributePath + * @param operation + * @param values Depending on the operation the amount of values differs + * @param existingValueNames If provided the existing names are used to make sure we have a unique name for the current attributePath + * @param metadata If provided we use the metadata to define the attribute name and use it to map the given value(s) to attributeValue(s) * @hidden */ export function buildUpdateExpression( diff --git a/src/dynamo/expression/util.spec.ts b/src/dynamo/expression/util.spec.ts index d8e1557dd..65b7869a5 100644 --- a/src/dynamo/expression/util.spec.ts +++ b/src/dynamo/expression/util.spec.ts @@ -1,8 +1,8 @@ +/* eslint-disable no-template-curly-in-string */ import { dynamicTemplate } from './util' describe('util', () => { it('should replace template vars dynamically', () => { - // tslint:disable-next-line const error = 'my sample error ${errorMessage} with some stuff in there and another ${secondValue}' const built = dynamicTemplate(error, { errorMessage: 'the message', secondValue: 5 }) expect(built).toBe('my sample error the message with some stuff in there and another 5') diff --git a/src/dynamo/expression/util.ts b/src/dynamo/expression/util.ts index 50c785b2d..704b2b461 100644 --- a/src/dynamo/expression/util.ts +++ b/src/dynamo/expression/util.ts @@ -1,3 +1,5 @@ +// TODO: I'd say this dynamic template function could be replaced with specific functions like x = (a,b)=>`${a} + /** * @module expression */ @@ -8,7 +10,7 @@ export function dynamicTemplate(templateString: string, templateVariables: Record) { const keys = Object.keys(templateVariables) const values = Object.values(templateVariables) - // tslint:disable-next-line:function-constructor + /* eslint-disable-next-line no-new-func */ const templateFunction = new Function(...keys, `return \`${templateString}\`;`) return templateFunction(...values) } diff --git a/src/dynamo/get-table-name.function.spec.ts b/src/dynamo/get-table-name.function.spec.ts index 542cc7bb1..99f1bb180 100644 --- a/src/dynamo/get-table-name.function.spec.ts +++ b/src/dynamo/get-table-name.function.spec.ts @@ -26,7 +26,6 @@ describe('getTableName', () => { }) it('throw error because table name is invalid', () => { - // tslint:disable-next-line:no-unused-expression updateDynamoEasyConfig({ tableNameResolver: (tableName) => `${tableName}$` }) expect(() => getTableName(metadataForModel(SimpleModel))).toThrowError() expect(() => getTableName(Organization)).toThrowError() diff --git a/src/dynamo/get-table-name.function.ts b/src/dynamo/get-table-name.function.ts index db9d4e2be..23e4fd4e0 100644 --- a/src/dynamo/get-table-name.function.ts +++ b/src/dynamo/get-table-name.function.ts @@ -9,6 +9,7 @@ import { ModelConstructor } from '../model/model-constructor' /** * only contains these characters «a-z A-Z 0-9 - _ .» and is between 3 and 255 characters long * http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html#limits-naming-rules + * * @hidden */ const REGEX_TABLE_NAME = /^[a-zA-Z0-9_\-.]{3,255}$/ diff --git a/src/dynamo/operation-params.type.ts b/src/dynamo/operation-params.type.ts index e555036ee..803d8bbfc 100644 --- a/src/dynamo/operation-params.type.ts +++ b/src/dynamo/operation-params.type.ts @@ -14,9 +14,9 @@ export interface ConditionalParamsHost { * @hidden */ export interface ConditionalParams { + [key: string]: any expressionAttributeNames?: DynamoDB.ExpressionAttributeNameMap expressionAttributeValues?: DynamoDB.ExpressionAttributeValueMap - [key: string]: any } /** diff --git a/src/dynamo/request/base.request.spec.ts b/src/dynamo/request/base.request.spec.ts index 8495b0d70..54664703b 100644 --- a/src/dynamo/request/base.request.spec.ts +++ b/src/dynamo/request/base.request.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable:max-classes-per-file +/* eslint-disable max-classes-per-file */ import { SimpleWithPartitionKeyModel } from '../../../test/models' import { ModelConstructor } from '../../model/model-constructor' import { BaseRequest } from './base.request' diff --git a/src/dynamo/request/base.request.ts b/src/dynamo/request/base.request.ts index 58956dcdd..e2f51a26d 100644 --- a/src/dynamo/request/base.request.ts +++ b/src/dynamo/request/base.request.ts @@ -55,7 +55,7 @@ export abstract class BaseRequest< this.dynamoDBWrapper = dynamoDBWrapper if (modelClazz === null || modelClazz === undefined) { - throw new Error(`please provide the ModelConstructor for the request, won't work otherwise`) + throw new Error("please provide the ModelConstructor for the request, won't work otherwise") } this.modelClazz = modelClazz @@ -72,6 +72,7 @@ export abstract class BaseRequest< /** * return ConsumedCapacity of the corresponding table(s) in the response + * * @param level not all requests support all values */ returnConsumedCapacity(level: DynamoDB.ReturnConsumedCapacity): R { diff --git a/src/dynamo/request/batchgetsingletable/batch-get-single-table.request.spec.ts b/src/dynamo/request/batchgetsingletable/batch-get-single-table.request.spec.ts index c8e056aae..d50910805 100644 --- a/src/dynamo/request/batchgetsingletable/batch-get-single-table.request.spec.ts +++ b/src/dynamo/request/batchgetsingletable/batch-get-single-table.request.spec.ts @@ -1,7 +1,5 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion,@typescript-eslint/no-extraneous-class */ import * as DynamoDB from 'aws-sdk/clients/dynamodb' -// tslint:disable:no-unnecessary-class -// tslint:disable:no-unused-expression -// tslint:disable:no-non-null-assertion import { resetDynamoEasyConfig } from '../../../../test/helper/resetDynamoEasyConfig.function' import { SimpleWithCompositePartitionKeyModel, SimpleWithPartitionKeyModel } from '../../../../test/models' import { updateDynamoEasyConfig } from '../../../config/update-config.function' diff --git a/src/dynamo/request/batchgetsingletable/batch-get-single-table.request.ts b/src/dynamo/request/batchgetsingletable/batch-get-single-table.request.ts index 11d44b473..bae42cc77 100644 --- a/src/dynamo/request/batchgetsingletable/batch-get-single-table.request.ts +++ b/src/dynamo/request/batchgetsingletable/batch-get-single-table.request.ts @@ -44,13 +44,14 @@ export class BatchGetSingleTableRequest extends BaseRequest< /** * Determines the read consistency model: If set to true, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads. */ - consistentRead(value: boolean = true): this { + consistentRead(value = true): this { this.params.RequestItems[this.tableName].ConsistentRead = value return this } /** * Specifies the list of model attributes to be returned from the table instead of returning the entire document + * * @param attributesToGet List of model attributes to be returned */ projectionExpression(...attributesToGet: Array): BatchGetSingleTableRequest> { @@ -60,6 +61,7 @@ export class BatchGetSingleTableRequest extends BaseRequest< /** * fetch all entries and return the raw response (without parsing the attributes to js objects) + * * @param backoffTimer when unprocessed keys are returned the next value of backoffTimer is used to determine how many time slots to wait before doing the next request * @param throttleTimeSlot the duration of a time slot in ms */ @@ -72,6 +74,7 @@ export class BatchGetSingleTableRequest extends BaseRequest< /** * fetch all entries and return an object containing the mapped items and the other response data + * * @param backoffTimer when unprocessed keys are returned the next value of backoffTimer is used to determine how many time slots to wait before doing the next request * @param throttleTimeSlot the duration of a time slot in ms */ @@ -86,6 +89,7 @@ export class BatchGetSingleTableRequest extends BaseRequest< /** * fetch all entries and return the parsed items + * * @param backoffTimer when unprocessed keys are returned the next value of backoffTimer is used to determine how many time slots to wait before doing the next request * @param throttleTimeSlot the duration of a time slot in ms */ diff --git a/src/dynamo/request/batchwritesingletable/batch-write-single-table.request.spec.ts b/src/dynamo/request/batchwritesingletable/batch-write-single-table.request.spec.ts index b48ca4abe..186283434 100644 --- a/src/dynamo/request/batchwritesingletable/batch-write-single-table.request.spec.ts +++ b/src/dynamo/request/batchwritesingletable/batch-write-single-table.request.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable:no-unnecessary-class +/* eslint "@typescript-eslint/no-extraneous-class": 0 */ import * as DynamoDB from 'aws-sdk/clients/dynamodb' import { Organization } from '../../../../test/models' diff --git a/src/dynamo/request/batchwritesingletable/batch-write-single-table.request.ts b/src/dynamo/request/batchwritesingletable/batch-write-single-table.request.ts index 1719922bd..cc67957ad 100644 --- a/src/dynamo/request/batchwritesingletable/batch-write-single-table.request.ts +++ b/src/dynamo/request/batchwritesingletable/batch-write-single-table.request.ts @@ -57,11 +57,13 @@ export class BatchWriteSingleTableRequest extends BaseRequest< /** * execute the request + * * @param backoffTimer when unprocessed items are returned the next value of backoffTimer is used to determine how many time slots to wait before doing the next request * @param throttleTimeSlot the duration of a time slot in ms */ exec(backoffTimer = randomExponentialBackoffTimer, throttleTimeSlot = BATCH_WRITE_DEFAULT_TIME_SLOT): Promise { this.logger.debug('starting batchWriteItem') + /* eslint-disable-next-line arrow-body-style */ return this.write(backoffTimer, throttleTimeSlot).then(() => { return }) @@ -69,6 +71,7 @@ export class BatchWriteSingleTableRequest extends BaseRequest< /** * execute the request and return the full response + * * @param backoffTimer when unprocessed items are returned the next value of backoffTimer is used to determine how many time slots to wait before doing the next request * @param throttleTimeSlot the duration of a time slot in ms */ diff --git a/src/dynamo/request/get/get.request.spec.ts b/src/dynamo/request/get/get.request.spec.ts index ce4a14c7b..5871c9784 100644 --- a/src/dynamo/request/get/get.request.spec.ts +++ b/src/dynamo/request/get/get.request.spec.ts @@ -1,4 +1,3 @@ -// tslint:disable:no-unused-expression import * as DynamoDB from 'aws-sdk/clients/dynamodb' import { SimpleWithCompositePartitionKeyModel, SimpleWithPartitionKeyModel } from '../../../../test/models' import { updateDynamoEasyConfig } from '../../../config/update-config.function' diff --git a/src/dynamo/request/get/get.request.ts b/src/dynamo/request/get/get.request.ts index b57854e72..609cc8332 100644 --- a/src/dynamo/request/get/get.request.ts +++ b/src/dynamo/request/get/get.request.ts @@ -27,13 +27,14 @@ export class GetRequest extends StandardRequest): GetRequest> { diff --git a/src/dynamo/request/put/put.request.ts b/src/dynamo/request/put/put.request.ts index d0853f40c..64984e04e 100644 --- a/src/dynamo/request/put/put.request.ts +++ b/src/dynamo/request/put/put.request.ts @@ -29,9 +29,10 @@ export class PutRequest extends WriteRequest< /** * Adds a condition expression to the request, which makes sure the item will only be saved if the id does not exist + * * @param predicate if false is provided nothing happens (it does NOT remove the condition) */ - ifNotExists(predicate: boolean = true): this { + ifNotExists(predicate = true): this { if (predicate) { this.onlyIf(...createIfNotExistsCondition(this.metadata)) } diff --git a/src/dynamo/request/query/query.request.spec.ts b/src/dynamo/request/query/query.request.spec.ts index 5ea90bc5b..7440ca26f 100644 --- a/src/dynamo/request/query/query.request.spec.ts +++ b/src/dynamo/request/query/query.request.spec.ts @@ -1,6 +1,5 @@ -// tslint:disable:no-non-null-assertion -// tslint:disable:max-classes-per-file - +/* eslint-disable max-classes-per-file,@typescript-eslint/no-non-null-assertion */ +import * as DynamoDB from 'aws-sdk/clients/dynamodb' import { ComplexModel, CustomId, @@ -18,7 +17,6 @@ import { DynamoDbWrapper } from '../../dynamo-db-wrapper' import { attribute } from '../../expression/logical-operator/attribute.function' import { ReadManyRequest } from '../read-many.request' import { QueryRequest } from './query.request' -import * as DynamoDB from 'aws-sdk/clients/dynamodb' describe('query request', () => { let querySpy: jasmine.Spy diff --git a/src/dynamo/request/read-many.request.spec.ts b/src/dynamo/request/read-many.request.spec.ts index 873a01d5c..10ddc82e8 100644 --- a/src/dynamo/request/read-many.request.spec.ts +++ b/src/dynamo/request/read-many.request.spec.ts @@ -15,13 +15,13 @@ import { getTableName } from '../get-table-name.function' import { ReadManyRequest } from './read-many.request' class TestRequest extends ReadManyRequest { + protected readonly logger: Logger + constructor(modelClazz: ModelConstructor) { super(null, modelClazz) this.logger = createLogger('TestRequest', modelClazz) } - protected readonly logger: Logger - protected doRequest(params: any): Promise { return Promise.resolve({}) } diff --git a/src/dynamo/request/read-many.request.ts b/src/dynamo/request/read-many.request.ts index 8e8ef1dce..3c50df744 100644 --- a/src/dynamo/request/read-many.request.ts +++ b/src/dynamo/request/read-many.request.ts @@ -8,8 +8,6 @@ import { promiseTap } from '../../helper/promise-tap.function' import { Logger } from '../../logger/logger' import { fromDb } from '../../mapper/mapper' import { Attributes } from '../../mapper/type/attribute.type' -import { ModelConstructor } from '../../model/model-constructor' -import { DynamoDbWrapper } from '../dynamo-db-wrapper' import { and } from '../expression/logical-operator/and.function' import { addExpression } from '../expression/param-util' import { addCondition } from '../expression/request-expression-builder' @@ -44,15 +42,6 @@ export abstract class ReadManyRequest< protected abstract readonly logger: Logger - /** - * method that executes the actual call on dynamoDBWrapper with the given params. - */ - protected abstract doRequest(params: I): Promise - - protected constructor(dynamoDBWrapper: DynamoDbWrapper, modelClazz: ModelConstructor) { - super(dynamoDBWrapper, modelClazz) - } - /** * * @param key A map representing the start id which is included in next call, if null is delivered @@ -104,13 +93,14 @@ export abstract class ReadManyRequest< /** * Determines the read consistency model: If set to true, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads. */ - consistentRead(consistentRead: boolean = true): this { + consistentRead(consistentRead = true): this { this.params.ConsistentRead = consistentRead return this } /** * Specifies the list of model attributes to be returned from the table instead of returning the entire document + * * @param attributesToGet List of model attributes to be returned */ projectionExpression(...attributesToGet: Array): R2 { @@ -120,6 +110,7 @@ export abstract class ReadManyRequest< /** * add a condition for propertyPath + * * @example req.whereAttribute('path.to.prop').eq('value') */ whereAttribute(attributePath: K): RequestConditionFunctionTyped @@ -132,6 +123,7 @@ export abstract class ReadManyRequest< /** * add one or multiple conditions. + * * @example req.where( attribute('age').eq(23) ) * @example req.where( or( attribute('age').lt(18), attribute('age').gt(65) ) ) */ @@ -222,4 +214,9 @@ export abstract class ReadManyRequest< return response } + + /** + * method that executes the actual call on dynamoDBWrapper with the given params. + */ + protected abstract doRequest(params: I): Promise } diff --git a/src/dynamo/request/transactgetsingletable/transact-get-single-table.request.spec.ts b/src/dynamo/request/transactgetsingletable/transact-get-single-table.request.spec.ts index 6dd97d2ea..e6dea23da 100644 --- a/src/dynamo/request/transactgetsingletable/transact-get-single-table.request.spec.ts +++ b/src/dynamo/request/transactgetsingletable/transact-get-single-table.request.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable:no-non-null-assertion +/* eslint-disable @typescript-eslint/no-non-null-assertion */ import * as DynamoDB from 'aws-sdk/clients/dynamodb' import { SimpleWithPartitionKeyModel } from '../../../../test/models' import { metadataForModel } from '../../../decorator/metadata/metadata-for-model.function' diff --git a/src/dynamo/request/transactgetsingletable/transact-get-single-table.request.ts b/src/dynamo/request/transactgetsingletable/transact-get-single-table.request.ts index 1fb277623..0af3d33be 100644 --- a/src/dynamo/request/transactgetsingletable/transact-get-single-table.request.ts +++ b/src/dynamo/request/transactgetsingletable/transact-get-single-table.request.ts @@ -50,10 +50,8 @@ export class TransactGetSingleTableRequest extends BaseRequest< .then((r) => r.Items) } - private mapResponse = (response: DynamoDB.TransactGetItemsOutput): TransactGetResponse => { - return { - ConsumedCapacity: response.ConsumedCapacity, - Items: (response.Responses || []).map((item) => fromDb(>item.Item, this.modelClazz)), - } - } + private mapResponse = (response: DynamoDB.TransactGetItemsOutput): TransactGetResponse => ({ + ConsumedCapacity: response.ConsumedCapacity, + Items: (response.Responses || []).map((item) => fromDb(>item.Item, this.modelClazz)), + }) } diff --git a/src/dynamo/request/update/update.request.ts b/src/dynamo/request/update/update.request.ts index d0d4573b7..de629d881 100644 --- a/src/dynamo/request/update/update.request.ts +++ b/src/dynamo/request/update/update.request.ts @@ -32,6 +32,7 @@ export class UpdateRequest extends WriteRequest< /** * create and add a single update operation + * * @example req.updateAttribute('path.to.attr').set('newVal') */ updateAttribute(attributePath: K): RequestUpdateFunction { @@ -40,6 +41,7 @@ export class UpdateRequest extends WriteRequest< /** * add multiple update operations comma separated + * * @example req.operations(update('path.to.attr).set('newVal'), ... ) */ operations(...updateDefFns: UpdateExpressionDefinitionFunction[]): this { diff --git a/src/dynamo/request/write.request.spec.ts b/src/dynamo/request/write.request.spec.ts index 4b1e19bce..5db0e6ae7 100644 --- a/src/dynamo/request/write.request.spec.ts +++ b/src/dynamo/request/write.request.spec.ts @@ -8,8 +8,8 @@ import { WriteRequest } from './write.request' describe('write request', () => { class TestWriteRequest extends WriteRequest> { - protected readonly logger: Logger readonly params: any = {} + protected readonly logger: Logger constructor(modelClazz: ModelConstructor) { super(null, modelClazz) diff --git a/src/dynamo/request/write.request.ts b/src/dynamo/request/write.request.ts index ba9916a5c..4f537ee10 100644 --- a/src/dynamo/request/write.request.ts +++ b/src/dynamo/request/write.request.ts @@ -6,9 +6,7 @@ import { promiseTap } from '../../helper/promise-tap.function' import { Logger } from '../../logger/logger' import { fromDb } from '../../mapper/mapper' import { Attributes } from '../../mapper/type/attribute.type' -import { ModelConstructor } from '../../model/model-constructor' import { Omit } from '../../model/omit.type' -import { DynamoDbWrapper } from '../dynamo-db-wrapper' import { and } from '../expression/logical-operator/public.api' import { addExpression } from '../expression/param-util' import { addCondition } from '../expression/request-expression-builder' @@ -36,12 +34,6 @@ export abstract class WriteRequest< > extends StandardRequest { protected abstract readonly logger: Logger - protected constructor(dynamoDBWrapper: DynamoDbWrapper, modelClazz: ModelConstructor) { - super(dynamoDBWrapper, modelClazz) - } - - protected abstract doRequest(params: I): Promise - /** * return item collection metrics. */ @@ -52,6 +44,7 @@ export abstract class WriteRequest< /** * add a condition for propertyPath + * * @param attributePath */ onlyIfAttribute(attributePath: K): RequestConditionFunctionTyped @@ -70,6 +63,7 @@ export abstract class WriteRequest< return this } + /* eslint-disable-next-line jsdoc/no-types */ /** * @returns { void } if no ReturnValues are requested, { T } if the requested ReturnValues are ALL_OLD|ALL_NEW or {Partial} if the requested ReturnValues are UPDATED_OLD|UPDATED_NEW */ @@ -111,4 +105,6 @@ export abstract class WriteRequest< this.logger.debug('request', this.params) return this.doRequest(this.params).then(promiseTap((response) => this.logger.debug('response', response))) } + + protected abstract doRequest(params: I): Promise } diff --git a/src/dynamo/transactget/transact-get.request.spec.ts b/src/dynamo/transactget/transact-get.request.spec.ts index 9ffa7ec31..945758c2e 100644 --- a/src/dynamo/transactget/transact-get.request.spec.ts +++ b/src/dynamo/transactget/transact-get.request.spec.ts @@ -1,5 +1,4 @@ -// tslint:disable:no-non-null-assertion -// tslint:disable:no-unnecessary-class +/* eslint-disable @typescript-eslint/no-extraneous-class,@typescript-eslint/no-non-null-assertion */ import * as DynamoDB from 'aws-sdk/clients/dynamodb' import { SimpleWithCompositePartitionKeyModel, SimpleWithPartitionKeyModel } from '../../../test/models' import { Attributes } from '../../mapper/type/attribute.type' diff --git a/src/dynamo/transactget/transact-get.request.ts b/src/dynamo/transactget/transact-get.request.ts index 478f211f6..e5e5b2bc2 100644 --- a/src/dynamo/transactget/transact-get.request.ts +++ b/src/dynamo/transactget/transact-get.request.ts @@ -36,6 +36,7 @@ export class TransactGetRequest { /** * read item of model by key + * * @param modelClazz the corresponding ModelConstructor * @param key partial of T that contains PartitionKey and SortKey (if necessary). Throws if missing. */ diff --git a/src/dynamo/transactwrite/transact-base-operation.spec.ts b/src/dynamo/transactwrite/transact-base-operation.spec.ts index b4a7e825e..68acad462 100644 --- a/src/dynamo/transactwrite/transact-base-operation.spec.ts +++ b/src/dynamo/transactwrite/transact-base-operation.spec.ts @@ -1,5 +1,5 @@ -// tslint:disable:max-classes-per-file -// tslint:disable:no-unnecessary-class +/* eslint-disable max-classes-per-file */ +/* eslint "@typescript-eslint/no-extraneous-class": 0 */ import * as DynamoDB from 'aws-sdk/clients/dynamodb' import { SimpleWithPartitionKeyModel } from '../../../test/models' import { ModelConstructor } from '../../model/model-constructor' @@ -8,6 +8,7 @@ import { TransactBaseOperation } from './transact-base-operation' describe('TransactBaseOperation', () => { class TestOperation extends TransactBaseOperation> { + /* eslint-disable-next-line no-useless-constructor */ constructor(modelClazz: ModelConstructor) { super(modelClazz) } diff --git a/src/dynamo/transactwrite/transact-base-operation.ts b/src/dynamo/transactwrite/transact-base-operation.ts index e13fa536a..8983e7bcd 100644 --- a/src/dynamo/transactwrite/transact-base-operation.ts +++ b/src/dynamo/transactwrite/transact-base-operation.ts @@ -32,7 +32,7 @@ export abstract class TransactBaseOperation< protected constructor(modelClazz: ModelConstructor) { if (!modelClazz) { - throw new Error(`please provide the model class`) + throw new Error('please provide the model class') } this.modelClazz = modelClazz @@ -48,6 +48,7 @@ export abstract class TransactBaseOperation< /** * create a condition on given attributePath + * * @example req.onlyIfAttribute('age').lt(10) */ onlyIfAttribute(attributePath: K): RequestConditionFunctionTyped @@ -60,6 +61,7 @@ export abstract class TransactBaseOperation< /** * add a condition necessary for the transaction to succeed + * * @example req.onlyIf(or(attribute('age').lt(10), attribute('age').gt(20))) */ onlyIf(...conditionDefFns: ConditionExpressionDefinitionFunction[]): this { diff --git a/src/dynamo/transactwrite/transact-put.ts b/src/dynamo/transactwrite/transact-put.ts index d02a800bd..3af96d2aa 100644 --- a/src/dynamo/transactwrite/transact-put.ts +++ b/src/dynamo/transactwrite/transact-put.ts @@ -19,7 +19,7 @@ export class TransactPut extends TransactBaseOperation extends TransactBaseOperation(attributePath: K): RequestUpdateFunction { @@ -29,6 +30,7 @@ export class TransactUpdate extends TransactBaseOperation { + /* eslint-disable-next-line arrow-body-style */ return this.dynamoDBWrapper.transactWriteItems(this.params).then((response) => { return }) diff --git a/src/helper/curry.function.ts b/src/helper/curry.function.ts index bdc0ad636..17470831d 100644 --- a/src/helper/curry.function.ts +++ b/src/helper/curry.function.ts @@ -108,6 +108,7 @@ interface CurriedFunction8 { * Creates a function that accepts one or more arguments of func that when called either invokes func returning * its result, if all func arguments have been provided, or returns a function that accepts one or more of the * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * * @param func The function to curry. * @param arity The arity of func. * @return Returns the new curried function. diff --git a/src/helper/extract-list-type.type.ts b/src/helper/extract-list-type.type.ts index 2fecfa94f..3991817c5 100644 --- a/src/helper/extract-list-type.type.ts +++ b/src/helper/extract-list-type.type.ts @@ -6,6 +6,7 @@ * * ExtractListType => string * ExtractListType> => string + * * @hidden */ export type ExtractListType = T extends Array ? A : T extends Set ? B : never diff --git a/src/helper/is-boolean.spec.ts b/src/helper/is-boolean.spec.ts index 6902d8cda..1a538b364 100644 --- a/src/helper/is-boolean.spec.ts +++ b/src/helper/is-boolean.spec.ts @@ -1,10 +1,11 @@ +/* eslint-disable no-new-wrappers */ + import { isBoolean } from './is-boolean.function' describe('is boolean', () => { it('should be a boolean', () => { expect(isBoolean(true)).toBeTruthy() expect(isBoolean(false)).toBeTruthy() - // tslint:disable:no-construct expect(isBoolean(new Boolean(1))).toBeTruthy() expect(isBoolean(new Boolean(0))).toBeTruthy() }) diff --git a/src/helper/is-number.spec.ts b/src/helper/is-number.spec.ts index 735b15113..a152c17ae 100644 --- a/src/helper/is-number.spec.ts +++ b/src/helper/is-number.spec.ts @@ -1,3 +1,5 @@ +/* eslint-disable no-new-wrappers */ + import { isNumber } from './is-number.function' describe('is number', () => { @@ -5,7 +7,6 @@ describe('is number', () => { expect(isNumber(3)).toBeTruthy() expect(isNumber(NaN)).toBeTruthy() expect(isNumber(Infinity)).toBeTruthy() - // tslint:disable:no-construct expect(isNumber(new Number('2'))).toBeTruthy() expect(isNumber(new Number('myNumber'))).toBeTruthy() }) diff --git a/src/helper/is-string.spec.ts b/src/helper/is-string.spec.ts index 16e96ae27..2cbf41042 100644 --- a/src/helper/is-string.spec.ts +++ b/src/helper/is-string.spec.ts @@ -1,9 +1,10 @@ +/* eslint-disable no-new-wrappers */ + import { isString } from './is-string.function' describe('is string', () => { it('should be a string', () => { expect(isString('myValue')).toBeTruthy() - // tslint:disable:no-construct expect(isString(new String('2'))).toBeTruthy() expect(isString(new String('someValue'))).toBeTruthy() }) diff --git a/src/helper/promise-delay.function.ts b/src/helper/promise-delay.function.ts index c572b3bd0..14e45d395 100644 --- a/src/helper/promise-delay.function.ts +++ b/src/helper/promise-delay.function.ts @@ -3,12 +3,9 @@ */ /** * Will resolve after given duration + * * @hidden */ export function promiseDelay(duration: number): (arg: T) => Promise { - return (arg: T) => { - return new Promise((resolve, reject) => { - setTimeout(() => resolve(arg), duration) - }) - } + return (arg: T) => new Promise((resolve, reject) => setTimeout(() => resolve(arg), duration)) } diff --git a/src/helper/promise-tap.function.ts b/src/helper/promise-tap.function.ts index d49916128..1de43e9db 100644 --- a/src/helper/promise-tap.function.ts +++ b/src/helper/promise-tap.function.ts @@ -3,6 +3,7 @@ */ /** * mimics the tap operator from rxjs, will execute some side effect and return the input value + * * @hidden */ export function promiseTap(tapFunction: (arg: T) => void): (arg: T) => Promise { diff --git a/src/logger/default-log-receiver.const.ts b/src/logger/default-log-receiver.const.ts index b1aafb674..c3577ab52 100644 --- a/src/logger/default-log-receiver.const.ts +++ b/src/logger/default-log-receiver.const.ts @@ -1,8 +1,9 @@ +/* eslint "@typescript-eslint/no-empty-function": 0 */ + /** * @module logger */ /** * @hidden */ -// tslint:disable-next-line:no-empty export const DEFAULT_LOG_RECEIVER = () => {} diff --git a/src/mapper/custom/date-to-string.mapper.spec.ts b/src/mapper/custom/date-to-string.mapper.spec.ts index 87beaf402..e4725aee9 100644 --- a/src/mapper/custom/date-to-string.mapper.spec.ts +++ b/src/mapper/custom/date-to-string.mapper.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable:no-non-null-assertion +/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { dateToStringMapper } from './date-to-string.mapper' describe('dateToStringMapper', () => { diff --git a/src/mapper/for-type/collection.mapper.ts b/src/mapper/for-type/collection.mapper.ts index 7adadef58..4d6cf798c 100644 --- a/src/mapper/for-type/collection.mapper.ts +++ b/src/mapper/for-type/collection.mapper.ts @@ -36,7 +36,6 @@ function collectionFromDb( if (hasGenericType(propertyMetadata)) { arr = attributeValue.L.map((item) => fromDb((item).M, propertyMetadata.typeInfo.genericType)) } else { - // tslint:disable-next-line:no-unnecessary-callback-wrapper arr = attributeValue.L.map((v) => fromDbOne(v)) } return explicitType && explicitType === Set ? new Set(arr) : arr @@ -103,10 +102,7 @@ function collectionToDb( } } else { return { - L: propertyValue - // tslint:disable-next-line:no-unnecessary-callback-wrapper - .map((v) => toDbOne(v)) - .filter(notNull), + L: propertyValue.map((v) => toDbOne(v)).filter(notNull), } } // no 'default' necessary, all possible cases caught diff --git a/src/mapper/mapper.spec.ts b/src/mapper/mapper.spec.ts index 3e1152a3c..6c1c6c414 100644 --- a/src/mapper/mapper.spec.ts +++ b/src/mapper/mapper.spec.ts @@ -1,5 +1,5 @@ -// tslint:disable:no-non-null-assertion -// tslint:disable:no-string-literal +/* eslint-disable dot-notation,camelcase,@typescript-eslint/no-non-null-assertion */ + import * as DynamoDb from 'aws-sdk/clients/dynamodb' import { organization1CreatedAt, diff --git a/src/mapper/mapper.ts b/src/mapper/mapper.ts index bdb7d381c..56dcba376 100644 --- a/src/mapper/mapper.ts +++ b/src/mapper/mapper.ts @@ -101,6 +101,7 @@ export function toDb(item: T, modelConstructor?: ModelConstructor): Attrib /** * maps a js value to its dynamoDB attribute + * * @param propertyValue The value which should be mapped * @param propertyMetadata Some optional metadata */ @@ -165,6 +166,7 @@ function testForKey(p: PropertyMetadata): p is PropertyMetadata & { key /** * returns the function for the given ModelConstructor to create the AttributeMap with HASH (and RANGE) Key of a given item. + * * @param modelConstructor */ export function createToKeyFn(modelConstructor: ModelConstructor): (item: Partial) => Attributes { @@ -191,6 +193,7 @@ export function createToKeyFn(modelConstructor: ModelConstructor): (item: /** * creates toKeyFn and applies item to it. + * * @see {@link createToKeyFn} */ export function toKey(item: T, modelConstructor: ModelConstructor): Attributes { diff --git a/src/mapper/type/binary.type.ts b/src/mapper/type/binary.type.ts index 1dcf58cec..1b53f813a 100644 --- a/src/mapper/type/binary.type.ts +++ b/src/mapper/type/binary.type.ts @@ -1,5 +1,5 @@ /** * @module mapper */ -// tslint:disable:no-unnecessary-class +/* eslint "@typescript-eslint/no-extraneous-class": 0 */ export class Binary {} diff --git a/src/mapper/type/null.type.ts b/src/mapper/type/null.type.ts index ef28bb380..5f91b610f 100644 --- a/src/mapper/type/null.type.ts +++ b/src/mapper/type/null.type.ts @@ -1,5 +1,5 @@ /** * @module mapper */ -// tslint:disable:no-unnecessary-class +/* eslint "@typescript-eslint/no-extraneous-class": 0 */ export class NullType {} diff --git a/src/mapper/type/undefined.type.ts b/src/mapper/type/undefined.type.ts index fe46c738c..2fe36c990 100644 --- a/src/mapper/type/undefined.type.ts +++ b/src/mapper/type/undefined.type.ts @@ -1,5 +1,5 @@ /** * @module mapper */ -// tslint:disable:no-unnecessary-class +/* eslint "@typescript-eslint/no-extraneous-class": 0 */ export class UndefinedType {} diff --git a/src/mapper/util.spec.ts b/src/mapper/util.spec.ts index ab1bdb53f..8f2970cb5 100644 --- a/src/mapper/util.spec.ts +++ b/src/mapper/util.spec.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-new-wrappers */ import { Employee } from '../../test/models' import { NullType } from './type/null.type' import { UndefinedType } from './type/undefined.type' @@ -94,13 +95,11 @@ describe('Util', () => { it('detects string', () => { expect(detectType('aString')).toBe('S') expect(detectType(String('aString'))).toBe('S') - // tslint:disable-next-line:no-construct expect(detectType(new String('aString'))).toBe('S') }) it('detects number', () => { expect(detectType(3)).toBe('N') expect(detectType(Number(-5))).toBe('N') - // tslint:disable-next-line:no-construct expect(detectType(new Number(83))).toBe('N') }) it('detects binary', () => { @@ -118,7 +117,6 @@ describe('Util', () => { it('detects bool', () => { expect(detectType(true)).toBe('BOOL') expect(detectType(false)).toBe('BOOL') - // tslint:disable-next-line:no-construct expect(detectType(new Boolean(1))).toBe('BOOL') }) it('detects collection', () => { @@ -223,7 +221,6 @@ describe('Util', () => { }) it('undefined', () => { - // tslint:disable-next-line:prefer-const let undfn: undefined expect(typeOf(undfn)).toBe(UndefinedType) }) diff --git a/src/mapper/util.ts b/src/mapper/util.ts index 942e6be59..5bcc490b2 100644 --- a/src/mapper/util.ts +++ b/src/mapper/util.ts @@ -64,8 +64,6 @@ const BUFFER_TYPES = [ * type. If the item types are heterogeneous or it is a non supported set type the returned type will be L(ist). * The logic for collection fo type Set is the same. * - * @param {any[] | Set} collection - * @returns {AttributeCollectionType} * @hidden */ export function detectCollectionTypeFromValue(collection: any[] | Set): AttributeCollectionType { @@ -84,12 +82,12 @@ export function detectCollectionTypeFromValue(collection: any[] | Set): Att return 'BS' default: throw new Error( - `"Set" without decorator is not supported. Add the @CollectionProperty() decorator (optionally with {itemType:CustomType}) for a Set<->[L]ist mapping)`, + '"Set" without decorator is not supported. Add the @CollectionProperty() decorator (optionally with {itemType:CustomType}) for a Set<->[L]ist mapping)', ) } } else { // sets can not contain items with different types (heterogeneous) - throw new Error(`"Set with values of different types without decorator is not supported. Use an array instead.`) + throw new Error('"Set with values of different types without decorator is not supported. Use an array instead.') } } else { /* @@ -169,7 +167,8 @@ export function detectType(value: any): AttributeType { } /** - * Will resolve the type based on given property value + * Will resolve the type based on given property value. + * * @hidden */ export function typeOf(propertyValue: any, propertyPath?: string | null): AttributeValueType { @@ -201,6 +200,7 @@ export function typeOf(propertyValue: any, propertyPath?: string | null): Attrib /** * copied from https://github.com/aws/aws-sdk-js/blob/0c974a7ff6749a541594de584b43a040978d4b72/lib/dynamodb/types.js * should we work with string match + * * @hidden */ export function typeOfFromDb(attributeValue?: Attribute): AttributeValueType { @@ -254,6 +254,7 @@ export function isBufferType(type: any): boolean { /** * copied from https://github.com/aws/aws-sdk-js/blob/0c974a7ff6749a541594de584b43a040978d4b72/lib/js + * * @hidden */ export function isType(obj: any, type: any): boolean { @@ -268,7 +269,7 @@ export function isType(obj: any, type: any): boolean { /** * @hidden */ -// tslint:disable-next-line:function-constructor +/* eslint-disable-next-line no-new-func */ const isGlobalScopeWindow = new Function('try {return this===window;}catch(e){ return false;}')() /** @@ -287,6 +288,7 @@ export function isNode() { /** * Returns the name of the given Type. null and undefined are special cases were we return 'Null' vs. 'Undefined' + * * @hidden */ export function typeName(type: any): 'Null' | 'Undefined' | string { diff --git a/src/mapper/wrap-mapper-for-collection.function.spec.ts b/src/mapper/wrap-mapper-for-collection.function.spec.ts index fa056ddd4..ebc9d7b81 100644 --- a/src/mapper/wrap-mapper-for-collection.function.spec.ts +++ b/src/mapper/wrap-mapper-for-collection.function.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable:max-classes-per-file +/* eslint-disable max-classes-per-file */ import { FailModel } from '../../test/models/fail-model.model' import { ModelWithCollections } from '../../test/models/model-with-collections.model' import { FormId, formIdMapper, FormType } from '../../test/models/real-world' diff --git a/src/mapper/wrap-mapper-for-collection.function.ts b/src/mapper/wrap-mapper-for-collection.function.ts index f5629ab7f..b1afbdc39 100644 --- a/src/mapper/wrap-mapper-for-collection.function.ts +++ b/src/mapper/wrap-mapper-for-collection.function.ts @@ -90,6 +90,7 @@ export function arrayToSetAttribute(fn: (values: T[]) => R) { @@ -103,6 +104,7 @@ function spreadSetAndApplyToFn(fn: (values: T[]) => R) { /** * returns a function which will execute the given function and wraps its return value in a Set + * * @hidden */ function applyFnWrapWithSet(fn: (arg: A) => R[]) { diff --git a/src/model/omit.type.ts b/src/model/omit.type.ts index 0c3dab1cf..c0bb1d94c 100644 --- a/src/model/omit.type.ts +++ b/src/model/omit.type.ts @@ -3,6 +3,7 @@ */ /** * https://www.typescriptlang.org/play/index.html#src=%2F%2F%20general%20sample%0D%0A%2F%2F%20type%20A%20%3D%20keyof%20Sample%0D%0Atype%20S1%20%3D%20Pick%3CSample%2C%20'a'%3E%0D%0Atype%20S2%20%3D%20Pick%3CSample%2C%20Exclude%3Ckeyof%20Sample%2C%20'b'%3E%3E%0D%0Atype%20S3%20%3D%20Pick%3CSample%2C%20Extract%3Ckeyof%20Sample%2C%20'b'%3E%3E%0D%0Atype%20T00%20%3D%20Exclude%3C'a'%20%7C%20'b'%20%7C%20'c'%20%7C%20'd'%2C%20'a'%20%7C%20'c'%20%7C%20'f'%3E%3B%20%20%2F%2F%20%22b%22%20%7C%20%22d%22%0D%0Atype%20Meta2%3CT%3E%20%3D%20Exclude%3Ckeyof%20Metadata%3CT%3E%2C%20'getSortKey'%3E%20%26%20%7B%20getSortKey%3A%20(indexName%3F%3A%20string)%20%3D%3E%20keyof%20T%20%7D%0D%0A%0D%0Aexport%20function%20bla()%20%7B%0D%0A%20%20const%20a%3A%20S1%20%3D%20%7B%20a%3A%20'a'%20%7D%0D%0A%20%20const%20b%3A%20S2%20%3D%20%7B%20a%3A%20'a'%2C%20c%3A%20true%20%7D%0D%0A%20%20const%20c%3A%20S3%20%3D%20%7B%20b%3A%205%20%7D%0D%0A%20%20const%20d%3A%20T00%20%3D%20%7B%20b%3A%205%2C%20a%3A%20'asd'%20%7D%0D%0A%0D%0A%0D%0A%20%20return%20%7B%20a%2C%20b%2C%20c%2C%20d%20%7D%0D%0A%7D%0D%0A%0D%0Ainterface%20Sample%20%7B%0D%0A%20%20a%3A%20string%0D%0A%20%20b%3A%20number%0D%0A%20%20c%3A%20boolean%0D%0A%7D%0D%0A%0D%0Atype%20Key%3CT%3E%20%3D%20%7Bname%3A%20keyof%20T%2C%20type%3A%20'HASH'%20%7C%20'RANGE'%7D%0D%0A%0D%0Aclass%20Metadata%3CT%3E%7B%0D%0A%20%20%20%20constructor(public%20properties%3A%20Array%3Ckeyof%20T%20%7C%20Key%3CT%3E%3E)%20%7B%0D%0A%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20getSortKey()%3A%20keyof%20T%20%7C%20null%20%7B%0D%0A%20%20%20%20%20%20%20%20const%20keys%20%3D%20this.properties.filter(p%20%3D%3E%20isKey%3CT%3E(p))%0D%0A%20%20%20%20%20%20%20%20if%20(keys%20%26%26%20keys.length)%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20keys%5B0%5D.name%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20null%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0Afunction%20isKey%3CT%3E(value%3A%20any)%3A%20value%20is%20Key%3Cany%3E%20%7B%0D%0A%20%20%20%20return%20typeof%20value%20%3D%3D%3D%20'object'%20%26%26%20'name'%20in%20value%20%26%26%20'type'%20in%20value%0D%0A%7D%0D%0A%0D%0Atype%20Omit%3CT%2C%20K%20extends%20keyof%20T%3E%20%3D%20Pick%3CT%2C%20Exclude%3Ckeyof%20T%2C%20K%3E%3E%0D%0A%0D%0Atype%20MetadataWithSortKey%3CT%3E%20%3D%20Omit%3CMetadata%3CT%3E%2C%20'getSortKey'%3E%20%26%20%7B%20getSortKey%3A%20(indexName%3F%3A%20string)%20%3D%3E%20keyof%20T%20%7D%0D%0A%0D%0Aexport%20function%20hasSortKey%3CT%3E(metadata%3A%20Metadata%3CT%3E)%3A%20metadata%20is%20MetadataWithSortKey%3CT%3E%20%7B%0D%0A%20%20return%20metadata.getSortKey()%20!%3D%3D%20null%0D%0A%7D%0D%0A%0D%0A%2F%2F%20asdf%0D%0Aconst%20metadata%3A%20Metadata%3CSample%3E%20%3D%20new%20Metadata%3CSample%3E(%5B%22a%22%2C%20%22b%22%5D)%0D%0A%0D%0Aif%20(hasSortKey(metadata))%20%7B%0D%0A%20%20%20%20const%20sortKey%20%3D%20metadata.getSortKey()%0D%0A%20%20%20%20if%20(!!sortKey)%20%7B%0D%0A%20%20%20%20%20%20%20%20throw%20new%20Error('sort%20key%20must%20be%20defined')%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A + * * @hidden */ export type Omit = Pick> diff --git a/test/models/brutalist.model.ts b/test/models/brutalist.model.ts index 56ed43e91..42f99b51c 100644 --- a/test/models/brutalist.model.ts +++ b/test/models/brutalist.model.ts @@ -1,4 +1,4 @@ -// tslint:disable:max-classes-per-file +/* eslint-disable max-classes-per-file */ import { CollectionProperty, DateProperty, Model, PartitionKey, Property } from '../../src/dynamo-easy' import { FormId, formIdMapper } from './real-world' diff --git a/test/models/custom-table-name.model.ts b/test/models/custom-table-name.model.ts index cc3e4ee78..1ac774460 100644 --- a/test/models/custom-table-name.model.ts +++ b/test/models/custom-table-name.model.ts @@ -1,5 +1,4 @@ -// tslint:disable:no-unnecessary-class - +/* eslint-disable @typescript-eslint/no-extraneous-class */ import { Model } from '../../src/dynamo-easy' @Model({ tableName: 'myCustomName' }) diff --git a/test/models/fail-model.model.ts b/test/models/fail-model.model.ts index e3199d91a..cade5fca1 100644 --- a/test/models/fail-model.model.ts +++ b/test/models/fail-model.model.ts @@ -1,4 +1,4 @@ -// tslint:disable:max-classes-per-file +/* eslint-disable max-classes-per-file */ import { CollectionProperty, MapAttribute, MapperForType, Model, StringAttribute } from '../../src/dynamo-easy' const strangeMapper: MapperForType = { diff --git a/test/models/model-with-custom-mapper-for-sort-key.model.ts b/test/models/model-with-custom-mapper-for-sort-key.model.ts index 5fb22f7f8..2ee45ef29 100644 --- a/test/models/model-with-custom-mapper-for-sort-key.model.ts +++ b/test/models/model-with-custom-mapper-for-sort-key.model.ts @@ -1,4 +1,4 @@ -// tslint:disable:max-classes-per-file +/* eslint-disable max-classes-per-file */ import { MapperForType, Model, NumberAttribute, PartitionKey, Property, SortKey } from '../../src/dynamo-easy' export class CustomId { @@ -8,6 +8,11 @@ export class CustomId { id: number + constructor(date: Date, id: number) { + this.date = date + this.id = id + } + static parse(value: string): CustomId { const id = parseInt(value.substr(0, value.length - CustomId.MULTIPLIER_E), 10) const date = value.substr(value.length - CustomId.MULTIPLIER_E) @@ -25,11 +30,6 @@ export class CustomId { const dd = (customId.date.getDate().toString()).padStart(2, '0') return `${yyyy}${mm}${dd}${(customId.id.toString()).padStart(CustomId.MULTIPLIER_E, '0')}` } - - constructor(date: Date, id: number) { - this.date = date - this.id = id - } } export const CustomIdMapper: MapperForType = { diff --git a/test/models/model-with-custom-mapper.model.ts b/test/models/model-with-custom-mapper.model.ts index 47ad827ba..bbc9374b4 100644 --- a/test/models/model-with-custom-mapper.model.ts +++ b/test/models/model-with-custom-mapper.model.ts @@ -1,12 +1,15 @@ -// tslint:disable:max-classes-per-file -// tslint:disable:no-non-null-assertion - +/* eslint-disable max-classes-per-file, @typescript-eslint/no-non-null-assertion */ import { MapperForType, Model, PartitionKey, Property, StringAttribute } from '../../src/dynamo-easy' export class Id { counter: number year: number + constructor(counter?: number, year?: number) { + this.counter = counter! + this.year = year! + } + static parse(idString: string): Id { const id: Id = new Id() id.counter = parseInt(idString.slice(0, 4).replace('0', ''), 10) @@ -19,11 +22,6 @@ export class Id { const leadingZeroes: string = new Array(4 + 1 - (propertyValue.counter + '').length).join('0') return `${leadingZeroes}${propertyValue.counter}${propertyValue.year}` } - - constructor(counter?: number, year?: number) { - this.counter = counter! - this.year = year! - } } export const IdMapper: MapperForType = { diff --git a/test/models/model-with-date-as-key.model.ts b/test/models/model-with-date-as-key.model.ts index ee72d2c8f..e9114604a 100644 --- a/test/models/model-with-date-as-key.model.ts +++ b/test/models/model-with-date-as-key.model.ts @@ -1,4 +1,4 @@ -// tslint:disable:max-classes-per-file +/* eslint-disable max-classes-per-file */ import { DateProperty, GSIPartitionKey, Model, PartitionKey, SortKey } from '../../src/dynamo-easy' @Model() diff --git a/test/models/model-with-enum.model.ts b/test/models/model-with-enum.model.ts index 47e56c553..43b2193d8 100644 --- a/test/models/model-with-enum.model.ts +++ b/test/models/model-with-enum.model.ts @@ -1,3 +1,4 @@ +/* eslint-disable max-classes-per-file */ import { Model, PartitionKey, Property } from '../../src/dynamo-easy' import { StringType, Type } from './types.enum' diff --git a/test/models/model-with-indexes.model.ts b/test/models/model-with-indexes.model.ts index a6cb9cde3..4d50bbd79 100644 --- a/test/models/model-with-indexes.model.ts +++ b/test/models/model-with-indexes.model.ts @@ -1,4 +1,4 @@ -// tslint:disable:max-classes-per-file +/* eslint-disable max-classes-per-file */ import { DateProperty, GSIPartitionKey, diff --git a/test/models/model-with-nested-model-with-custom-mapper.model.ts b/test/models/model-with-nested-model-with-custom-mapper.model.ts index 412f74153..2658643d8 100644 --- a/test/models/model-with-nested-model-with-custom-mapper.model.ts +++ b/test/models/model-with-nested-model-with-custom-mapper.model.ts @@ -1,4 +1,4 @@ -// tslint:disable:max-classes-per-file +/* eslint-disable max-classes-per-file */ import { Model, Property } from '../../src/dynamo-easy' import { Id, IdMapper } from './model-with-custom-mapper.model' diff --git a/test/models/model-without-custom-mapper.model.ts b/test/models/model-without-custom-mapper.model.ts index 7d01e75a8..c3ef689d4 100644 --- a/test/models/model-without-custom-mapper.model.ts +++ b/test/models/model-without-custom-mapper.model.ts @@ -1,4 +1,4 @@ -// tslint:disable:max-classes-per-file +/* eslint-disable max-classes-per-file */ import { GSIPartitionKey, Model, PartitionKey } from '../../src/dynamo-easy' @Model() diff --git a/test/models/organization.model.ts b/test/models/organization.model.ts index 6cf0347ae..c83f0ae5a 100644 --- a/test/models/organization.model.ts +++ b/test/models/organization.model.ts @@ -1,3 +1,4 @@ +/* eslint-disable max-classes-per-file */ import { CollectionProperty, DateProperty, @@ -9,7 +10,6 @@ import { } from '../../src/dynamo-easy' import { Employee } from './employee.model' -// tslint:disable:max-classes-per-file @Model() export class Gift { description: string @@ -109,7 +109,4 @@ export class Organization { @CollectionProperty() emptySet: Set = new Set() - - // tslint:disable-next-line:no-empty - constructor() {} } diff --git a/test/models/product.model.ts b/test/models/product.model.ts index 67d4ed1f0..8184c2669 100644 --- a/test/models/product.model.ts +++ b/test/models/product.model.ts @@ -1,4 +1,4 @@ -// tslint:disable:max-classes-per-file +/* eslint-disable max-classes-per-file */ import { CollectionProperty, Model, Property } from '../../src/dynamo-easy' import { NestedComplexModel } from './nested-complex.model' diff --git a/test/models/real-world/form-id.model.ts b/test/models/real-world/form-id.model.ts index d8db26d32..d4cbc0a9b 100644 --- a/test/models/real-world/form-id.model.ts +++ b/test/models/real-world/form-id.model.ts @@ -1,5 +1,4 @@ -// tslint:disable:no-non-null-assertion - +/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { MapperForType, StringAttribute } from '../../../src/dynamo-easy' import { FormType } from './form-type.enum' @@ -33,6 +32,13 @@ export class FormId { counter: number year: number + constructor(type: FormType, counter: number, year: number, postfix: string | null = null) { + this.type = type + this.postfix = postfix + this.year = year + this.counter = counter + } + // BE00042018(-postfix) static parse(formId: string): FormId { // formType BEL / DBL has 3 digits prefix for type. if so we add +1 otherwise +0 @@ -53,10 +59,6 @@ export class FormId { * full: Bestellung00012017(-postfix) * print: Bestellung BE00012017(-postfix) * - * @param formId - * @param mode - * @param hidePostfix - * @returns {string} */ static unparse(formId: FormId, hidePostfix?: boolean): string { // use the join method with array length to produce leading zeroes @@ -75,13 +77,6 @@ export class FormId { (formId.postfix && hidePostfix !== true ? `-${formId.postfix}` : '') ) } - - constructor(type: FormType, counter: number, year: number, postfix: string | null = null) { - this.type = type - this.postfix = postfix - this.year = year - this.counter = counter - } } export const formIdMapper: MapperForType = { diff --git a/test/models/real-world/order-id.model.ts b/test/models/real-world/order-id.model.ts index c829c59c8..f331e122b 100644 --- a/test/models/real-world/order-id.model.ts +++ b/test/models/real-world/order-id.model.ts @@ -4,6 +4,11 @@ export class OrderId { counter: number year: number + constructor(counter: number, year: number) { + this.counter = counter + this.year = year + } + static parse(orderId?: string): OrderId { if (orderId) { const counter: number = parseInt(orderId.slice(0, 4).replace('0', ''), 10) @@ -20,11 +25,6 @@ export class OrderId { const leadingZeroes: string = new Array(4 + 1 - (formId.counter + '').length).join('0') return leadingZeroes + formId.counter + formId.year } - - constructor(counter: number, year: number) { - this.counter = counter - this.year = year - } } export const orderIdMapper: MapperForType = { diff --git a/test/models/real-world/order.model.ts b/test/models/real-world/order.model.ts index a5d28789f..3df6de568 100644 --- a/test/models/real-world/order.model.ts +++ b/test/models/real-world/order.model.ts @@ -1,5 +1,4 @@ -// tslint:disable:max-classes-per-file - +/* eslint-disable max-classes-per-file */ import { CollectionProperty, DateProperty, diff --git a/test/models/simple-with-composite-partition-key.model.ts b/test/models/simple-with-composite-partition-key.model.ts index 292f86a45..7c6bda341 100644 --- a/test/models/simple-with-composite-partition-key.model.ts +++ b/test/models/simple-with-composite-partition-key.model.ts @@ -1,3 +1,4 @@ +/* eslint-disable max-classes-per-file */ import { DateProperty, Model, PartitionKey, Property, SortKey } from '../../src/dynamo-easy' @Model() diff --git a/test/models/simple-with-partition-key.model.ts b/test/models/simple-with-partition-key.model.ts index 578984390..246ad7d93 100644 --- a/test/models/simple-with-partition-key.model.ts +++ b/test/models/simple-with-partition-key.model.ts @@ -1,3 +1,4 @@ +/* eslint-disable max-classes-per-file */ import { Model, PartitionKey, Property } from '../../src/dynamo-easy' @Model() diff --git a/test/models/simple.model.ts b/test/models/simple.model.ts index f5a1ff729..c1cb7e69a 100644 --- a/test/models/simple.model.ts +++ b/test/models/simple.model.ts @@ -1,4 +1,4 @@ -// tslint:disable:no-unnecessary-class +/* eslint-disable @typescript-eslint/no-extraneous-class */ import { Model } from '../../src/dynamo-easy' @Model() diff --git a/test/models/update.model.ts b/test/models/update.model.ts index 878dc3b5c..04123ec35 100644 --- a/test/models/update.model.ts +++ b/test/models/update.model.ts @@ -1,6 +1,6 @@ +/* eslint-disable max-classes-per-file */ import { CollectionProperty, DateProperty, Model, PartitionKey, Property } from '../../src/dynamo-easy' -// tslint:disable-next-line:max-classes-per-file @Model() export class Address { street: string @@ -8,7 +8,6 @@ export class Address { zip: number } -// tslint:disable-next-line:max-classes-per-file @Model() export class Info { details: string @@ -17,7 +16,6 @@ export class Info { createdAt: Date } -// tslint:disable-next-line:max-classes-per-file @Model() export class UpdateModel { @PartitionKey() diff --git a/tools/eslint-rules/no-named-dynamo-import.js b/tools/eslint-rules/no-named-dynamo-import.js new file mode 100644 index 000000000..5449c66ea --- /dev/null +++ b/tools/eslint-rules/no-named-dynamo-import.js @@ -0,0 +1,28 @@ +'use strict' + +module.exports = { + meta: { + type: 'suggestion', + docs: { + description: 'DynamoDB needs to be imported with wildcard (import * as DynamoDB from \'aws-sdk/clients/dynamodb\')', + }, + schema: [], // no options + messages: { + unexpected: 'only wildcard import (import * as DynamoDB from \'aws-sdk/clients/dynamodb\') is allowed', + }, + }, + create: function (context) { + return { + ImportDeclaration(node) { + const { source, specifiers } = node + if (source && source.value === 'aws-sdk/clients/dynamodb') { + // necessary to check the specifiers + if (Array.isArray(specifiers) && specifiers.some(sp => sp.type === 'ImportSpecifier')) { + // fail, only allowed type is ImportNamespaceSpecifier + context.report({ node, messageId: 'unexpected' }) + } + } + }, + } + }, +} diff --git a/tools/eslint-rules/no-named-dynamo-import.test.js b/tools/eslint-rules/no-named-dynamo-import.test.js new file mode 100644 index 000000000..8683bbbd1 --- /dev/null +++ b/tools/eslint-rules/no-named-dynamo-import.test.js @@ -0,0 +1,26 @@ +const { RuleTester } = require('eslint') +const typeCheckRule = require('./no-named-dynamo-import') + +const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2015, sourceType: 'module' } }) +const errors = [{ messageId: 'unexpected' }] + + +ruleTester.run('type-check', typeCheckRule, { + valid: [ + 'import * as DynamoDB from "aws-sdk/clients/dynamodb"', // normal + 'import * as Dynamo2 from \'aws-sdk/clients/dynamodb\'', // alt name is allowed + 'import DynamoDB from \'aws-sdk/clients/dynamodb\'', // default is allowed + 'import { Config } from \'aws-sdk\'', // other stuff is allowed + 'import * as moment from \'moment\'', + ], + invalid: [ + { + code: 'import { StringAttributeValue } from "aws-sdk/clients/dynamodb"', + errors, + }, + // { + // code: 'import { StringAttributeValue }, * as DynamoDB from "aws-sdk/clients/dynamodb"', + // errors, + // }, + ], +}) diff --git a/tools/tslint/noDynamoNamedImportRule.js b/tools/tslint/noDynamoNamedImportRule.js deleted file mode 100644 index fa691ba0c..000000000 --- a/tools/tslint/noDynamoNamedImportRule.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -var tsutils_1 = require("tsutils"); -var Lint = require("tslint"); -// The walker takes care of all the work. -var NoDynamoDbWildcardImportWalker = /** @class */ (function (_super) { - __extends(NoDynamoDbWildcardImportWalker, _super); - function NoDynamoDbWildcardImportWalker() { - return _super !== null && _super.apply(this, arguments) || this; - } - NoDynamoDbWildcardImportWalker.prototype.visitImportDeclaration = function (node) { - var moduleName = node.moduleSpecifier.getText(this.getSourceFile()) - // remove outer quotes string looks like "'moduleName'" - .replace(/"|'/g, ''); - if (moduleName === 'aws-sdk/clients/dynamodb' && tsutils_1.isNamedImports(node.importClause.namedBindings)) { - this.addFailureAtNode(node, Rule.FAILURE_STRING); - } - // call the base version of this visitor to actually parse this node - _super.prototype.visitImportDeclaration.call(this, node); - }; - return NoDynamoDbWildcardImportWalker; -}(Lint.RuleWalker)); -var Rule = /** @class */ (function (_super) { - __extends(Rule, _super); - function Rule() { - return _super !== null && _super.apply(this, arguments) || this; - } - Rule.prototype.apply = function (sourceFile) { - return this.applyWithWalker(new NoDynamoDbWildcardImportWalker(sourceFile, this.getOptions())); - }; - Rule.FAILURE_STRING = 'only wildcard import (import * as DynamoDB from \'aws-sdk/clients/dynamodb\') is allowed for this module'; - return Rule; -}(Lint.Rules.AbstractRule)); -exports.Rule = Rule; diff --git a/tools/tslint/noDynamoNamedImportRule.ts b/tools/tslint/noDynamoNamedImportRule.ts deleted file mode 100644 index 69e523d77..000000000 --- a/tools/tslint/noDynamoNamedImportRule.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as ts from 'typescript' -import * as Lint from 'tslint' -import { isNamedImports } from 'tsutils' - -/** - * We prevent named imports from aws-sdk/clients/dynamodb, this is a design decision to be more obvious about where the - * import is from, this is not common practice but because our code has a lot of code dependent on dynamoDB we do this - * for easier reading and understanding - */ -class NoDynamoDbWildcardImportWalker extends Lint.RuleWalker { - - visitImportDeclaration(node: ts.ImportDeclaration) { - const moduleName = node.moduleSpecifier.getText(this.getSourceFile()) - // remove outer quotes string looks like "'moduleName'" - .replace(/"|'/g, '') - if (moduleName === 'aws-sdk/clients/dynamodb' && isNamedImports(node.importClause.namedBindings)) { - this.addFailureAtNode(node, Rule.FAILURE_STRING) - } - - // call the base version of this visitor to actually parse this node - super.visitImportDeclaration(node) - } -} - -export class Rule extends Lint.Rules.AbstractRule { - static FAILURE_STRING = 'only wildcard import (import * as DynamoDB from \'aws-sdk/clients/dynamodb\') is allowed for this module' - - apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { - return this.applyWithWalker(new NoDynamoDbWildcardImportWalker(sourceFile, this.getOptions())) - } -} diff --git a/tools/tslint/test/test.ts.lint b/tools/tslint/test/test.ts.lint deleted file mode 100644 index 421dd30d2..000000000 --- a/tools/tslint/test/test.ts.lint +++ /dev/null @@ -1,5 +0,0 @@ -import * as moment from 'moment' -import * as DynamoDB from 'aws-sdk' -import { Config } from 'aws-sdk' -import { Key } from 'aws-sdk/clients/dynamodb' -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [only wildcard import (import * as DynamoDB from 'aws-sdk/clients/dynamodb') is allowed for this module] diff --git a/tools/tslint/test/tslint.json b/tools/tslint/test/tslint.json deleted file mode 100644 index 77c6233c6..000000000 --- a/tools/tslint/test/tslint.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "rulesDirectory": [ - "../" - ], - "rules": { - "no-dynamo-named-import": true - } -} diff --git a/tslint.yml b/tslint.yml deleted file mode 100644 index 7ab4a5615..000000000 --- a/tslint.yml +++ /dev/null @@ -1,60 +0,0 @@ -extends: - - "tslint:latest" - - "tslint-config-prettier" -rulesDirectory: - - ./tools/tslint -rules: - # - # override rules from tslint:recommended - # - interface-name: [true, "never-prefix"] - member-access: [true, "no-public"] # true - member-ordering: [ # order: "statics-first" - true, - { - order: [ - "public-static-field", - "private-static-field", - "public-instance-field", - "private-instance-field", - "public-static-method", - "private-static-method", - "constructor", - "public-instance-method", - "private-instance-method", - ] - } - ] - no-angle-bracket-type-assertion: false # true - use «» instead of «as Type» for casting - no-console: [false, "debug", "warn", "error"] # true - object-literal-sort-keys: false - quotemark: [true, "single", "avoid-escape"] # ["double", "avoid-escape"] - triple-equals: [true, "allow-null-check"] # true - allow for != null check to catch null & undefined - - # - # override rules from tslint:latest - # - no-object-literal-type-assertion: false - no-submodule-imports: [true, "aws-sdk", "rxjs/operators"] - prefer-conditional-expression: false - - # - # additional rules - # - no-inferrable-types: [true, "ignore-params"] - no-non-null-assertion: true - no-unnecessary-callback-wrapper: true - no-unnecessary-class: true - no-unnecessary-type-assertion: true - no-unused-variable: true - import-blacklist: - - true - - aws-sdk - # introduced with v5.12.0 - unnecessary-constructor: true - unnecessary-bind: true - - # - # custom rules - # - no-dynamo-named-import: true