From ee85a978394979b3b5e685ed3dd6d6d5e024a57c Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Fri, 2 Dec 2022 14:09:13 -0800 Subject: [PATCH] A bit of cleanup: eslint and yarn.lock --- .eslintrc.js | 29 ++++++++++++++----- package.json | 2 +- .../window/phase3-sticker-functions.ts | 1 - yarn.lock | 22 +------------- 4 files changed, 23 insertions(+), 31 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5599c44fd2f2..90a5a1897c3c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -95,9 +95,12 @@ const rules = { 'react/require-default-props': 'off', // Empty fragments are used in adapters between backbone and react views. - 'react/jsx-no-useless-fragment': ['error', { - allowExpressions: true, - }], + 'react/jsx-no-useless-fragment': [ + 'error', + { + allowExpressions: true, + }, + ], // Our code base has tons of arrow functions passed directly to components. 'react/jsx-no-bind': 'off', @@ -108,10 +111,13 @@ const rules = { // Not useful for us as we have lots of complicated types. 'react/destructuring-assignment': 'off', - 'react/function-component-definition': ['error', { - namedComponents: 'function-declaration', - unnamedComponents: 'arrow-function', - }], + 'react/function-component-definition': [ + 'error', + { + namedComponents: 'function-declaration', + unnamedComponents: 'arrow-function', + }, + ], 'react/display-name': 'error', @@ -195,6 +201,9 @@ const typescriptRules = { // Already enforced by TypeScript 'consistent-return': 'off', + + // TODO: DESKTOP-4655 + 'import/no-cycle': 'off', }; module.exports = { @@ -253,7 +262,11 @@ module.exports = { }, ], - rules, + rules: { + ...rules, + 'import/no-unresolved': 'off', + 'import/extensions': 'off', + }, reportUnusedDisableDirectives: true, }; diff --git a/package.json b/package.json index ae49627a2f75..e30108b7f3f4 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "test-mock": "mocha ts/test-mock/**/*_test.js", "test-node-coverage": "nyc --reporter=lcov --reporter=text mocha --recursive test/modules ts/test-node ts/test-both", "test-lint-intl": "ts-node ./build/intl-linter/linter.ts --test", - "eslint": "eslint --cache .", + "eslint": "eslint --cache . --max-warnings 0", "lint": "run-s --print-label lint-prettier check:types eslint", "lint-deps": "node ts/util/lint/linter.js", "lint-license-comments": "ts-node ts/util/lint/license_comments.ts", diff --git a/sticker-creator/window/phase3-sticker-functions.ts b/sticker-creator/window/phase3-sticker-functions.ts index 939af53c1959..5c678de7392d 100644 --- a/sticker-creator/window/phase3-sticker-functions.ts +++ b/sticker-creator/window/phase3-sticker-functions.ts @@ -160,7 +160,6 @@ window.processStickerImage = async function processStickerImage( quality: 0.8, }); - // eslint-disable-next-line no-await-in-loop processedBuffer = Buffer.from(await blob.arrayBuffer()); if ( diff --git a/yarn.lock b/yarn.lock index f5dd8bcd4e0a..2ca0156e2424 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6298,19 +6298,11 @@ color-name@1.1.3: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= -color-name@^1.0.0, color-name@~1.1.4: +color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-string@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.0.tgz#63b6ebd1bec11999d1df3a79a7569451ac2be8aa" - integrity sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ== - dependencies: - color-name "^1.0.0" - simple-swizzle "^0.2.2" - color-support@^1.1.2, color-support@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" @@ -10475,11 +10467,6 @@ is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" -is-arrayish@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" - integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== - is-bigint@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" @@ -15847,13 +15834,6 @@ simple-get@^3.0.3: once "^1.3.1" simple-concat "^1.0.0" -simple-swizzle@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" - integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= - dependencies: - is-arrayish "^0.3.1" - sinon@11.1.1: version "11.1.1" resolved "https://registry.yarnpkg.com/sinon/-/sinon-11.1.1.tgz#99a295a8b6f0fadbbb7e004076f3ae54fc6eab91"