diff --git a/.eslintrc.json b/.eslintrc.json index fc1848b0519..227f364fc22 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -48,6 +48,8 @@ } ], "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-use-before-define": "error", + "no-use-before-define": "off", "jest/no-conditional-expect": "off", "garden-local/require-default-theme": "error" }, @@ -65,7 +67,13 @@ } }, { - "files": ["*.spec.{js,ts,tsx}", "**/stories/**/*", "utils/**/*.{js,ts,tsx}", ".storybook/**/*.{js,ts,tsx}", "styleguide.config.js"], + "files": [ + "*.spec.{js,ts,tsx}", + "**/stories/**/*", + "utils/**/*.{js,ts,tsx}", + ".storybook/**/*.{js,ts,tsx}", + "styleguide.config.js" + ], "rules": { "garden-local/require-default-theme": "off", "@typescript-eslint/no-var-requires": "off" diff --git a/package.json b/package.json index c71d75b1be7..54f8b624482 100644 --- a/package.json +++ b/package.json @@ -60,8 +60,8 @@ "@types/react": "^16.9.33", "@types/react-dom": "^16.9.6", "@types/styled-components": "4.4.3", - "@typescript-eslint/eslint-plugin": "3.10.1", - "@typescript-eslint/parser": "3.10.1", + "@typescript-eslint/eslint-plugin": "4.3.0", + "@typescript-eslint/parser": "4.3.0", "@zendeskgarden/css-bedrock": "8.0.1", "@zendeskgarden/eslint-config": "15.0.0", "@zendeskgarden/scripts": "0.1.11", diff --git a/packages/datepickers/src/elements/Datepicker/utils/datepicker-reducer.ts b/packages/datepickers/src/elements/Datepicker/utils/datepicker-reducer.ts index ae15e2cc0e4..e4b3b3a737d 100644 --- a/packages/datepickers/src/elements/Datepicker/utils/datepicker-reducer.ts +++ b/packages/datepickers/src/elements/Datepicker/utils/datepicker-reducer.ts @@ -27,7 +27,7 @@ function parseInputValue({ customParseDate }: { inputValue: string; - customParseDate?: (inputValue: string) => Date; + customParseDate?: (value: string) => Date; }): Date { if (customParseDate) { return customParseDate(inputValue); @@ -65,7 +65,7 @@ function formatInputValue({ }: { date?: Date; locale: string; - formatDate?: (date: Date) => string; + formatDate?: (d: Date) => string; }) { if (!date) { return ''; diff --git a/yarn.lock b/yarn.lock index 36970ea7275..5658012db45 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4253,11 +4253,6 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== -"@types/eslint-visitor-keys@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" - integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== - "@types/estree@*": version "0.0.45" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.45.tgz#e9387572998e5ecdac221950dab3e8c3b16af884" @@ -4642,26 +4637,28 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.1.tgz#7e061338a1383f59edc204c605899f93dc2e2c8f" - integrity sha512-PQg0emRtzZFWq6PxBcdxRH3QIQiyFO3WCVpRL3fgj5oQS3CDs3AeAKfv4DxNhzn8ITdNJGJ4D3Qw8eAJf3lXeQ== +"@typescript-eslint/eslint-plugin@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.3.0.tgz#1a23d904bf8ea248d09dc3761af530d90f39c8fa" + integrity sha512-RqEcaHuEKnn3oPFislZ6TNzsBLqpZjN93G69SS+laav/I8w/iGMuMq97P0D2/2/kW4SCebHggqhbcCfbDaaX+g== dependencies: - "@typescript-eslint/experimental-utils" "3.10.1" + "@typescript-eslint/experimental-utils" "4.3.0" + "@typescript-eslint/scope-manager" "4.3.0" debug "^4.1.1" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz#e179ffc81a80ebcae2ea04e0332f8b251345a686" - integrity sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw== +"@typescript-eslint/experimental-utils@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.3.0.tgz#3f3c6c508e01b8050d51b016e7f7da0e3aefcb87" + integrity sha512-cmmIK8shn3mxmhpKfzMMywqiEheyfXLV/+yPDnOTvQX/ztngx7Lg/OD26J8gTZfkLKUmaEBxO2jYP3keV7h2OQ== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/types" "3.10.1" - "@typescript-eslint/typescript-estree" "3.10.1" + "@typescript-eslint/scope-manager" "4.3.0" + "@typescript-eslint/types" "4.3.0" + "@typescript-eslint/typescript-estree" "4.3.0" eslint-scope "^5.0.0" eslint-utils "^2.0.0" @@ -4677,16 +4674,15 @@ eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.10.1.tgz#1883858e83e8b442627e1ac6f408925211155467" - integrity sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw== +"@typescript-eslint/parser@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.3.0.tgz#684fc0be6551a2bfcb253991eec3c786a8c063a3" + integrity sha512-JyfRnd72qRuUwItDZ00JNowsSlpQGeKfl9jxwO0FHK1qQ7FbYdoy5S7P+5wh1ISkT2QyAvr2pc9dAemDxzt75g== dependencies: - "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "3.10.1" - "@typescript-eslint/types" "3.10.1" - "@typescript-eslint/typescript-estree" "3.10.1" - eslint-visitor-keys "^1.1.0" + "@typescript-eslint/scope-manager" "4.3.0" + "@typescript-eslint/types" "4.3.0" + "@typescript-eslint/typescript-estree" "4.3.0" + debug "^4.1.1" "@typescript-eslint/scope-manager@4.1.0": version "4.1.0" @@ -4696,29 +4692,23 @@ "@typescript-eslint/types" "4.1.0" "@typescript-eslint/visitor-keys" "4.1.0" -"@typescript-eslint/types@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.10.1.tgz#1d7463fa7c32d8a23ab508a803ca2fe26e758727" - integrity sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ== +"@typescript-eslint/scope-manager@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.3.0.tgz#c743227e087545968080d2362cfb1273842cb6a7" + integrity sha512-cTeyP5SCNE8QBRfc+Lgh4Xpzje46kNUhXYfc3pQWmJif92sjrFuHT9hH4rtOkDTo/si9Klw53yIr+djqGZS1ig== + dependencies: + "@typescript-eslint/types" "4.3.0" + "@typescript-eslint/visitor-keys" "4.3.0" "@typescript-eslint/types@4.1.0": version "4.1.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.1.0.tgz#edbd3fec346f34e13ce7aa176b03b497a32c496a" integrity sha512-rkBqWsO7m01XckP9R2YHVN8mySOKKY2cophGM8K5uDK89ArCgahItQYdbg/3n8xMxzu2elss+an1TphlUpDuJw== -"@typescript-eslint/typescript-estree@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.1.tgz#fd0061cc38add4fad45136d654408569f365b853" - integrity sha512-QbcXOuq6WYvnB3XPsZpIwztBoquEYLXh2MtwVU+kO8jgYCiv4G5xrSP/1wg4tkvrEE+esZVquIPX/dxPlePk1w== - dependencies: - "@typescript-eslint/types" "3.10.1" - "@typescript-eslint/visitor-keys" "3.10.1" - debug "^4.1.1" - glob "^7.1.6" - is-glob "^4.0.1" - lodash "^4.17.15" - semver "^7.3.2" - tsutils "^3.17.1" +"@typescript-eslint/types@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.3.0.tgz#1f0b2d5e140543e2614f06d48fb3ae95193c6ddf" + integrity sha512-Cx9TpRvlRjOppGsU6Y6KcJnUDOelja2NNCX6AZwtVHRzaJkdytJWMuYiqi8mS35MRNA3cJSwDzXePfmhU6TANw== "@typescript-eslint/typescript-estree@4.1.0": version "4.1.0" @@ -4734,6 +4724,20 @@ semver "^7.3.2" tsutils "^3.17.1" +"@typescript-eslint/typescript-estree@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.3.0.tgz#0edc1068e6b2e4c7fdc54d61e329fce76241cee8" + integrity sha512-ZAI7xjkl+oFdLV/COEz2tAbQbR3XfgqHEGy0rlUXzfGQic6EBCR4s2+WS3cmTPG69aaZckEucBoTxW9PhzHxxw== + dependencies: + "@typescript-eslint/types" "4.3.0" + "@typescript-eslint/visitor-keys" "4.3.0" + debug "^4.1.1" + globby "^11.0.1" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^7.3.2" + tsutils "^3.17.1" + "@typescript-eslint/typescript-estree@^2.29.0": version "2.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.32.0.tgz#0e4ae2e883557f94039b13ac0ecfcfbb09835b8d" @@ -4747,13 +4751,6 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/visitor-keys@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.1.tgz#cd4274773e3eb63b2e870ac602274487ecd1e931" - integrity sha512-9JgC82AaQeglebjZMgYR5wgmfUdUc+EitGUUMW8u2nDckaeimzW+VsoLV6FoimPv2id3VQzfjwBxEMVz08ameQ== - dependencies: - eslint-visitor-keys "^1.1.0" - "@typescript-eslint/visitor-keys@4.1.0": version "4.1.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.1.0.tgz#b2d528c9484e7eda1aa4f86ccf0432fb16e4d545" @@ -4762,6 +4759,14 @@ "@typescript-eslint/types" "4.1.0" eslint-visitor-keys "^2.0.0" +"@typescript-eslint/visitor-keys@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.3.0.tgz#0e5ab0a09552903edeae205982e8521e17635ae0" + integrity sha512-xZxkuR7XLM6RhvLkgv9yYlTcBHnTULzfnw4i6+z2TGBLy9yljAypQaZl9c3zFvy7PNI7fYWyvKYtohyF8au3cw== + dependencies: + "@typescript-eslint/types" "4.3.0" + eslint-visitor-keys "^2.0.0" + "@vxna/mini-html-webpack-template@^0.1.7": version "0.1.7" resolved "https://registry.yarnpkg.com/@vxna/mini-html-webpack-template/-/mini-html-webpack-template-0.1.7.tgz#2a8270e513ee14f395cc17c2ce22ced383c45d22"