diff --git a/.eslintignore b/.eslintignore index 0531dfdfa0b..caeb31d85fc 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,8 +1,3 @@ -.eslintrc.js -scripts/*.js docs/* plugin/* -eslintrc.js -jest.config.js eslintPlugin/* -mock.js diff --git a/.eslintrc.js b/.eslintrc.js index b640e57c89e..7d8dcdae0cb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,13 +1,49 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - project: true, - tsconfigRootDir: __dirname, - }, + overrides: [ + { + files: ['*.ts', '*.tsx'], + parser: '@typescript-eslint/parser', + parserOptions: { + project: true, + tsconfigRootDir: __dirname, + }, + extends: ['plugin:@typescript-eslint/recommended-type-checked'], + rules: { + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/ban-ts-comment': [ + 'error', + { + 'ts-ignore': 'allow-with-description', + 'ts-expect-error': 'allow-with-description', + }, + ], + '@typescript-eslint/no-unused-vars': [ + 'error', + { argsIgnorePattern: '^_' }, + ], + '@typescript-eslint/no-var-requires': 'warn', + '@typescript-eslint/consistent-type-imports': [ + 'error', + { prefer: 'type-imports' }, + ], + '@typescript-eslint/consistent-type-exports': [ + 'error', + { fixMixedExportsWithInlineTypeSpecifier: false }, + ], + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-duplicate-type-constituents': 'error', + '@typescript-eslint/no-shadow': 'error', + }, + }, + ], extends: [ 'standard', - 'plugin:@typescript-eslint/recommended-type-checked', 'prettier', 'plugin:import/typescript', 'plugin:react-hooks/recommended', @@ -32,43 +68,16 @@ module.exports = { }, }, rules: { - '@typescript-eslint/no-unsafe-call': 'off', - '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/no-unsafe-return': 'off', - '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-unsafe-argument': 'off', - '@typescript-eslint/no-explicit-any': 'warn', 'object-shorthand': 'error', - curly: 'error', + curly: ['error', 'all'], 'no-case-declarations': 'error', - '@typescript-eslint/no-shadow': 'error', 'import/no-unresolved': 'error', 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'], 'react/jsx-uses-vars': 'error', 'react/jsx-uses-react': 'error', 'no-use-before-define': 'off', - '@typescript-eslint/no-explicit-any': 'warn', - '@typescript-eslint/ban-ts-comment': [ - 'error', - { - 'ts-ignore': 'allow-with-description', - 'ts-expect-error': 'allow-with-description', - }, - ], - '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], - '@typescript-eslint/no-var-requires': 'warn', - // '@typescript-eslint/no-duplicate-type-constituents': 'error', // TODO this currently breaks ESLint for VSCode in plugin eqeqeq: 'error', 'no-unreachable': 'error', - '@typescript-eslint/consistent-type-imports': [ - 'error', - { prefer: 'type-imports' }, - ], - '@typescript-eslint/consistent-type-exports': [ - 'error', - { fixMixedExportsWithInlineTypeSpecifier: false }, - ], 'tsdoc/syntax': 'error', - '@typescript-eslint/no-non-null-assertion': 'off', }, }; diff --git a/Example/package.json b/Example/package.json index a462450ed03..a53d07e4a02 100644 --- a/Example/package.json +++ b/Example/package.json @@ -38,7 +38,7 @@ "@types/react": "^18.2.6", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", - "eslint": "^8.19.0", + "eslint": "^8.0.0-0", "jest": "^29.6.3", "patch-package": "^8.0.0", "prettier": "2.8.8", diff --git a/Example/yarn.lock b/Example/yarn.lock index 57bf68049eb..ccf76747307 100644 --- a/Example/yarn.lock +++ b/Example/yarn.lock @@ -3161,7 +3161,7 @@ __metadata: "@types/react": "npm:^18.2.6" "@types/react-test-renderer": "npm:^18.0.0" babel-jest: "npm:^29.6.3" - eslint: "npm:^8.19.0" + eslint: "npm:^8.0.0-0" jest: "npm:^29.6.3" patch-package: "npm:^8.0.0" prettier: "npm:2.8.8" @@ -4874,7 +4874,7 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.19.0": +"eslint@npm:^8.0.0-0": version: 8.57.0 resolution: "eslint@npm:8.57.0" dependencies: diff --git a/FabricExample/package.json b/FabricExample/package.json index 38f7105a0c3..6d883f42e19 100644 --- a/FabricExample/package.json +++ b/FabricExample/package.json @@ -36,7 +36,7 @@ "@types/react": "^18.2.6", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", - "eslint": "^8.19.0", + "eslint": "^8.0.0-0", "jest": "^29.6.3", "prettier": "2.8.8", "react-test-renderer": "18.2.0", diff --git a/FabricExample/yarn.lock b/FabricExample/yarn.lock index 82d3b686be6..082acbd4ac7 100644 --- a/FabricExample/yarn.lock +++ b/FabricExample/yarn.lock @@ -3143,7 +3143,7 @@ __metadata: "@types/react": "npm:^18.2.6" "@types/react-test-renderer": "npm:^18.0.0" babel-jest: "npm:^29.6.3" - eslint: "npm:^8.19.0" + eslint: "npm:^8.0.0-0" jest: "npm:^29.6.3" prettier: "npm:2.8.8" react: "npm:18.2.0" @@ -4848,7 +4848,7 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.19.0": +"eslint@npm:^8.0.0-0": version: 8.57.0 resolution: "eslint@npm:8.57.0" dependencies: diff --git a/MacOSExample/package.json b/MacOSExample/package.json index 53e9881ff0e..9e5cc282df7 100644 --- a/MacOSExample/package.json +++ b/MacOSExample/package.json @@ -39,7 +39,7 @@ "@types/react": "^18.2.6", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", - "eslint": "^8.19.0", + "eslint": "^8.0.0-0", "jest": "^29.6.3", "prettier": "2.8.8", "react-test-renderer": "18.2.0", diff --git a/MacOSExample/yarn.lock b/MacOSExample/yarn.lock index 6890563f6de..b845c787ba8 100644 --- a/MacOSExample/yarn.lock +++ b/MacOSExample/yarn.lock @@ -3268,7 +3268,7 @@ __metadata: "@types/react": "npm:^18.2.6" "@types/react-test-renderer": "npm:^18.0.0" babel-jest: "npm:^29.6.3" - eslint: "npm:^8.19.0" + eslint: "npm:^8.0.0-0" jest: "npm:^29.6.3" prettier: "npm:2.8.8" react: "npm:18.2.0" @@ -5019,7 +5019,7 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.19.0": +"eslint@npm:^8.0.0-0": version: 8.57.0 resolution: "eslint@npm:8.57.0" dependencies: diff --git a/TVOSExample/package.json b/TVOSExample/package.json index bfa0f239a56..076f0e7aa88 100644 --- a/TVOSExample/package.json +++ b/TVOSExample/package.json @@ -27,7 +27,7 @@ "@types/react": "^18.2.6", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", - "eslint": "^8.19.0", + "eslint": "^8.0.0-0", "jest": "^29.6.3", "prettier": "2.8.8", "react-test-renderer": "18.2.0", diff --git a/TVOSExample/yarn.lock b/TVOSExample/yarn.lock index 484a211f9f4..7c1702f4703 100644 --- a/TVOSExample/yarn.lock +++ b/TVOSExample/yarn.lock @@ -3493,7 +3493,7 @@ __metadata: "@types/react": "npm:^18.2.6" "@types/react-test-renderer": "npm:^18.0.0" babel-jest: "npm:^29.6.3" - eslint: "npm:^8.19.0" + eslint: "npm:^8.0.0-0" expo: "npm:^50.0.2" jest: "npm:^29.6.3" prettier: "npm:2.8.8" @@ -5545,7 +5545,7 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.19.0": +"eslint@npm:^8.0.0-0": version: 8.57.0 resolution: "eslint@npm:8.57.0" dependencies: diff --git a/WebExample/package.json b/WebExample/package.json index 44bb5fbce9d..36eed5aae83 100644 --- a/WebExample/package.json +++ b/WebExample/package.json @@ -29,7 +29,7 @@ "@react-native/metro-config": "0.74.81", "@react-native/typescript-config": "0.74.81", "@types/react": "~18.0.14", - "eslint": "^8.19.0", + "eslint": "^8.0.0-0", "prettier": "^2.4.1", "typescript": "5.0.4" }, diff --git a/WebExample/yarn.lock b/WebExample/yarn.lock index bc3b4b1124b..889e86b8183 100644 --- a/WebExample/yarn.lock +++ b/WebExample/yarn.lock @@ -6178,7 +6178,7 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.19.0": +"eslint@npm:^8.0.0-0": version: 8.57.0 resolution: "eslint@npm:8.57.0" dependencies: @@ -13267,7 +13267,7 @@ __metadata: "@react-native/metro-config": "npm:0.74.81" "@react-native/typescript-config": "npm:0.74.81" "@types/react": "npm:~18.0.14" - eslint: "npm:^8.19.0" + eslint: "npm:^8.0.0-0" expo: "npm:~48.0.10" expo-status-bar: "npm:~1.4.0" prettier: "npm:^2.4.1" diff --git a/__tests__/plugin.test.ts b/__tests__/plugin.test.ts index ac547fdd1ec..7bde103c0b4 100644 --- a/__tests__/plugin.test.ts +++ b/__tests__/plugin.test.ts @@ -3,7 +3,7 @@ import plugin from '../plugin'; import { TransformOptions, transformSync } from '@babel/core'; import traverse from '@babel/traverse'; import { strict as assert } from 'assert'; -import '../plugin/jestUtils'; +import '../plugin/src/jestMatchers'; import { version as packageVersion } from '../package.json'; import { ReanimatedPluginOptions } from '../plugin/src/types'; diff --git a/app/package.json b/app/package.json index c44fa1ee5a4..8730171727b 100644 --- a/app/package.json +++ b/app/package.json @@ -32,7 +32,7 @@ "devDependencies": { "@tsconfig/react-native": "^3.0.0", "@types/d3-shape": "^3.1.1", - "eslint": "^8.36.0", + "eslint": "^8.0.0-0", "eslint-plugin-reanimated": "link:../eslintPlugin", "patch-package": "^7.0.0", "prettier": "^2.8.7", diff --git a/app/yarn.lock b/app/yarn.lock index 720915be11c..a711b6c66d6 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -693,7 +693,7 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.36.0": +"eslint@npm:^8.0.0-0": version: 8.57.0 resolution: "eslint@npm:8.57.0" dependencies: @@ -1716,7 +1716,7 @@ __metadata: "@tsconfig/react-native": "npm:^3.0.0" "@types/d3-shape": "npm:^3.1.1" d3-shape: "npm:^3.2.0" - eslint: "npm:^8.36.0" + eslint: "npm:^8.0.0-0" eslint-plugin-reanimated: "link:../eslintPlugin" patch-package: "npm:^7.0.0" prettier: "npm:^2.8.7" diff --git a/eslintPlugin/package.json b/eslintPlugin/package.json index dda51bcfb84..d23c927540a 100644 --- a/eslintPlugin/package.json +++ b/eslintPlugin/package.json @@ -15,7 +15,7 @@ "@typescript-eslint/rule-tester": "^6.19.1", "@typescript-eslint/utils": "^6.19.1", "esbuild": "^0.20.0", - "eslint": "^8.56.0", + "eslint": "^8.0.0-0", "jest": "^29.7.0", "ts-jest": "^29.1.2", "typescript": "^5.3.3" diff --git a/eslintPlugin/yarn.lock b/eslintPlugin/yarn.lock index c7631779f13..b2057362153 100644 --- a/eslintPlugin/yarn.lock +++ b/eslintPlugin/yarn.lock @@ -2025,7 +2025,7 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.56.0": +"eslint@npm:^8.0.0-0": version: 8.57.0 resolution: "eslint@npm:8.57.0" dependencies: @@ -2083,7 +2083,7 @@ __metadata: "@typescript-eslint/rule-tester": "npm:^6.19.1" "@typescript-eslint/utils": "npm:^6.19.1" esbuild: "npm:^0.20.0" - eslint: "npm:^8.56.0" + eslint: "npm:^8.0.0-0" jest: "npm:^29.7.0" ts-jest: "npm:^29.1.2" typescript: "npm:^5.3.3" diff --git a/package.json b/package.json index b2babb7dfc2..b3278889683 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "babel-plugin-module-resolver": "^5.0.0", "clang-format": "^1.6.0", "code-tag": "^1.1.0", - "eslint": "^8.56.0", + "eslint": "^8.0.0-0", "eslint-config-prettier": "^8.3.0", "eslint-config-standard": "^17.1.0", "eslint-import-resolver-babel-module": "^5.3.1", diff --git a/plugin/.eslintignore b/plugin/.eslintignore new file mode 100644 index 00000000000..95046190893 --- /dev/null +++ b/plugin/.eslintignore @@ -0,0 +1,3 @@ +types/* +lib/* +build/* diff --git a/plugin/.eslintrc.js b/plugin/.eslintrc.js index f747ed36b56..457dcdd8fc8 100644 --- a/plugin/.eslintrc.js +++ b/plugin/.eslintrc.js @@ -1,14 +1,14 @@ module.exports = { root: true, - extends: '../.eslintrc.js', - extends: [ - 'standard', - 'plugin:@typescript-eslint/recommended', //We overwrite this not to use type-checked rules in plugin - 'prettier', - 'plugin:import/typescript', - 'plugin:react-hooks/recommended', + overrides: [ + { + files: ['*.ts'], + parser: '@typescript-eslint/parser', + parserOptions: { + project: true, + tsconfigRootDir: __dirname, + }, + }, ], - rules: { - 'curly': 'error', - }, - ignorePatterns: ['**/*.d.ts','jestUtils.ts']}; + extends: ['../.eslintrc.js'], +}; diff --git a/plugin/build/plugin.js b/plugin/build/plugin.js index bc5db4e0c6d..cbc222c18cf 100644 --- a/plugin/build/plugin.js +++ b/plugin/build/plugin.js @@ -1027,7 +1027,7 @@ module.exports = function() { try { fun(); } catch (e) { - throw new Error("[Reanimated] Babel plugin exception: " + e); + throw new Error(`[Reanimated] Babel plugin exception: ${e}`); } } return { diff --git a/plugin/package.json b/plugin/package.json index 80d4cc13a79..de65bafe485 100644 --- a/plugin/package.json +++ b/plugin/package.json @@ -2,8 +2,11 @@ "devDependencies": { "@react-native/eslint-config": "^0.72.1", "@types/node": "^18.15.11", + "@typescript-eslint/eslint-plugin": "^7.0.2", + "@typescript-eslint/parser": "^7.0.2", "esbuild": "^0.17.11", - "eslint": "^8.35.0", + "eslint": "^8.0.0-0", + "eslint-plugin-standard": "^5.0.0", "prettier": "^2.5.1", "tsc-watch": "^6.0.0", "typescript": "^4.1.3" diff --git a/plugin/jestUtils.ts b/plugin/src/jestMatchers.ts similarity index 100% rename from plugin/jestUtils.ts rename to plugin/src/jestMatchers.ts diff --git a/plugin/src/plugin.ts b/plugin/src/plugin.ts index e71d210132b..305a25d0d22 100644 --- a/plugin/src/plugin.ts +++ b/plugin/src/plugin.ts @@ -17,7 +17,7 @@ module.exports = function (): PluginItem { try { fun(); } catch (e) { - throw new Error('[Reanimated] Babel plugin exception: ' + e); + throw new Error(`[Reanimated] Babel plugin exception: ${e as string}`); } } diff --git a/plugin/yarn.lock b/plugin/yarn.lock index c92cf8fcef5..8f306cf3ec7 100644 --- a/plugin/yarn.lock +++ b/plugin/yarn.lock @@ -416,7 +416,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/eslint-utils@npm:^4.2.0": +"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0": version: 4.4.0 resolution: "@eslint-community/eslint-utils@npm:4.4.0" dependencies: @@ -427,7 +427,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.4.0, @eslint-community/regexpp@npm:^4.6.1": +"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.4.0, @eslint-community/regexpp@npm:^4.6.1": version: 4.10.0 resolution: "@eslint-community/regexpp@npm:4.10.0" checksum: 10/8c36169c815fc5d726078e8c71a5b592957ee60d08c6470f9ce0187c8046af1a00afbda0a065cc40ff18d5d83f82aed9793c6818f7304a74a7488dc9f3ecbd42 @@ -592,7 +592,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:^7.0.9": +"@types/json-schema@npm:^7.0.15, @types/json-schema@npm:^7.0.9": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" checksum: 10/1a3c3e06236e4c4aab89499c428d585527ce50c24fe8259e8b3926d3df4cfbbbcf306cfc73ddfb66cbafc973116efd15967020b0f738f63e09e64c7d260519e7 @@ -608,7 +608,7 @@ __metadata: languageName: node linkType: hard -"@types/semver@npm:^7.3.12": +"@types/semver@npm:^7.3.12, @types/semver@npm:^7.5.8": version: 7.5.8 resolution: "@types/semver@npm:7.5.8" checksum: 10/3496808818ddb36deabfe4974fd343a78101fa242c4690044ccdc3b95dcf8785b494f5d628f2f47f38a702f8db9c53c67f47d7818f2be1b79f2efb09692e1178 @@ -639,6 +639,31 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/eslint-plugin@npm:^7.0.2": + version: 7.7.1 + resolution: "@typescript-eslint/eslint-plugin@npm:7.7.1" + dependencies: + "@eslint-community/regexpp": "npm:^4.10.0" + "@typescript-eslint/scope-manager": "npm:7.7.1" + "@typescript-eslint/type-utils": "npm:7.7.1" + "@typescript-eslint/utils": "npm:7.7.1" + "@typescript-eslint/visitor-keys": "npm:7.7.1" + debug: "npm:^4.3.4" + graphemer: "npm:^1.4.0" + ignore: "npm:^5.3.1" + natural-compare: "npm:^1.4.0" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^1.3.0" + peerDependencies: + "@typescript-eslint/parser": ^7.0.0 + eslint: ^8.56.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/54064fe466edcebece50cf4cfc4cb18753bcba7da0e3f0db29bf628586716b14945cadf01529ebc3d823e35bc62debf21aa636ae1f5e4fa92670dce65b3dec8c + languageName: node + linkType: hard + "@typescript-eslint/parser@npm:^5.30.5": version: 5.62.0 resolution: "@typescript-eslint/parser@npm:5.62.0" @@ -656,6 +681,24 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/parser@npm:^7.0.2": + version: 7.7.1 + resolution: "@typescript-eslint/parser@npm:7.7.1" + dependencies: + "@typescript-eslint/scope-manager": "npm:7.7.1" + "@typescript-eslint/types": "npm:7.7.1" + "@typescript-eslint/typescript-estree": "npm:7.7.1" + "@typescript-eslint/visitor-keys": "npm:7.7.1" + debug: "npm:^4.3.4" + peerDependencies: + eslint: ^8.56.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/39cd5c686e9f7e86da669fc3622b203e1025f162d42c4f45373e827c659b8823535fe4ea62ccb5e672ef999f8491d74c8c5c4c497367c884672fc835497ea180 + languageName: node + linkType: hard + "@typescript-eslint/scope-manager@npm:5.62.0": version: 5.62.0 resolution: "@typescript-eslint/scope-manager@npm:5.62.0" @@ -666,6 +709,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/scope-manager@npm:7.7.1": + version: 7.7.1 + resolution: "@typescript-eslint/scope-manager@npm:7.7.1" + dependencies: + "@typescript-eslint/types": "npm:7.7.1" + "@typescript-eslint/visitor-keys": "npm:7.7.1" + checksum: 10/7823cd15e7205d2c0d9e69432717c385b2ecd7559d5edba79113c2e97c6c5e8ca3dae9343a734bc740be97e096bfcb9dfb81a3da697f9fbf5600a56a42cf70e9 + languageName: node + linkType: hard + "@typescript-eslint/type-utils@npm:5.62.0": version: 5.62.0 resolution: "@typescript-eslint/type-utils@npm:5.62.0" @@ -683,6 +736,23 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/type-utils@npm:7.7.1": + version: 7.7.1 + resolution: "@typescript-eslint/type-utils@npm:7.7.1" + dependencies: + "@typescript-eslint/typescript-estree": "npm:7.7.1" + "@typescript-eslint/utils": "npm:7.7.1" + debug: "npm:^4.3.4" + ts-api-utils: "npm:^1.3.0" + peerDependencies: + eslint: ^8.56.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/c64dfd3e535741270012d289d1327e487df877adfa8a9920b1f8d6616f3b7159ef8ee1d6b62e866b6a5c64d675c5008e87f4ea20b5fc032e95f197a749d38ae6 + languageName: node + linkType: hard + "@typescript-eslint/types@npm:5.62.0": version: 5.62.0 resolution: "@typescript-eslint/types@npm:5.62.0" @@ -690,6 +760,13 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/types@npm:7.7.1": + version: 7.7.1 + resolution: "@typescript-eslint/types@npm:7.7.1" + checksum: 10/a1ecbaf3b8a5243394d421644f2b3eb164feea645e36dd07f1afb5008598201f19c7988141fc162c647f380dda7cf571017c0eabbbc4c5432b0143383853e134 + languageName: node + linkType: hard + "@typescript-eslint/typescript-estree@npm:5.62.0": version: 5.62.0 resolution: "@typescript-eslint/typescript-estree@npm:5.62.0" @@ -708,6 +785,25 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/typescript-estree@npm:7.7.1": + version: 7.7.1 + resolution: "@typescript-eslint/typescript-estree@npm:7.7.1" + dependencies: + "@typescript-eslint/types": "npm:7.7.1" + "@typescript-eslint/visitor-keys": "npm:7.7.1" + debug: "npm:^4.3.4" + globby: "npm:^11.1.0" + is-glob: "npm:^4.0.3" + minimatch: "npm:^9.0.4" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^1.3.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/df5fe6c573b15e8058b88d1535eeca11115118adc54225f511d2762d74e2d453205ba27e63f6666cb5f3dc73d639208a183fb05db1f75063b115d52b1fae3e20 + languageName: node + linkType: hard + "@typescript-eslint/utils@npm:5.62.0, @typescript-eslint/utils@npm:^5.10.0": version: 5.62.0 resolution: "@typescript-eslint/utils@npm:5.62.0" @@ -726,6 +822,23 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/utils@npm:7.7.1": + version: 7.7.1 + resolution: "@typescript-eslint/utils@npm:7.7.1" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.4.0" + "@types/json-schema": "npm:^7.0.15" + "@types/semver": "npm:^7.5.8" + "@typescript-eslint/scope-manager": "npm:7.7.1" + "@typescript-eslint/types": "npm:7.7.1" + "@typescript-eslint/typescript-estree": "npm:7.7.1" + semver: "npm:^7.6.0" + peerDependencies: + eslint: ^8.56.0 + checksum: 10/5a352c3a849300b5d676bf5f451418a2fb0cd3ab515f3733521ad03cf047849c52c76f6e5d2406e08f6d0dbad3a4708b490f909c91a1a9e3d73060a750b3bca2 + languageName: node + linkType: hard + "@typescript-eslint/visitor-keys@npm:5.62.0": version: 5.62.0 resolution: "@typescript-eslint/visitor-keys@npm:5.62.0" @@ -736,6 +849,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/visitor-keys@npm:7.7.1": + version: 7.7.1 + resolution: "@typescript-eslint/visitor-keys@npm:7.7.1" + dependencies: + "@typescript-eslint/types": "npm:7.7.1" + eslint-visitor-keys: "npm:^3.4.3" + checksum: 10/dcc5748b10bb1b169516b33e87b6d86b562e25725a95e5ac515cb197589d9667aaa7cfffa93234095a73c80addb6dd88e2a9ab01d2be0c274254b5be1ca4057a + languageName: node + linkType: hard + "@ungap/structured-clone@npm:^1.2.0": version: 1.2.0 resolution: "@ungap/structured-clone@npm:1.2.0" @@ -941,6 +1064,15 @@ __metadata: languageName: node linkType: hard +"brace-expansion@npm:^2.0.1": + version: 2.0.1 + resolution: "brace-expansion@npm:2.0.1" + dependencies: + balanced-match: "npm:^1.0.0" + checksum: 10/a61e7cd2e8a8505e9f0036b3b6108ba5e926b4b55089eeb5550cd04a471fe216c96d4fe7e4c7f995c728c554ae20ddfc4244cad10aef255e72b62930afd233d1 + languageName: node + linkType: hard + "braces@npm:^3.0.2": version: 3.0.2 resolution: "braces@npm:3.0.2" @@ -1537,6 +1669,15 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-standard@npm:^5.0.0": + version: 5.0.0 + resolution: "eslint-plugin-standard@npm:5.0.0" + peerDependencies: + eslint: ">=5.0.0" + checksum: 10/f11e6b0a58606347a256d2ab9c63d290ee580389f09cc29f58fbcaf9a588560f5a8043640a2ced63060eab469e2807d5d81f238ca4fc65a945444ebf71296727 + languageName: node + linkType: hard + "eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1": version: 5.1.1 resolution: "eslint-scope@npm:5.1.1" @@ -1571,7 +1712,7 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.35.0": +"eslint@npm:^8.0.0-0": version: 8.57.0 resolution: "eslint@npm:8.57.0" dependencies: @@ -2009,7 +2150,7 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^5.0.5, ignore@npm:^5.2.0": +"ignore@npm:^5.0.5, ignore@npm:^5.2.0, ignore@npm:^5.3.1": version: 5.3.1 resolution: "ignore@npm:5.3.1" checksum: 10/0a884c2fbc8c316f0b9f92beaf84464253b73230a4d4d286697be45fca081199191ca33e1c2e82d9e5f851f5e9a48a78e25a35c951e7eb41e59f150db3530065 @@ -2483,6 +2624,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^9.0.4": + version: 9.0.4 + resolution: "minimatch@npm:9.0.4" + dependencies: + brace-expansion: "npm:^2.0.1" + checksum: 10/4cdc18d112b164084513e890d6323370db14c22249d536ad1854539577a895e690a27513dc346392f61a4a50afbbd8abc88f3f25558bfbbbb862cd56508b20f5 + languageName: node + linkType: hard + "ms@npm:2.1.2": version: 2.1.2 resolution: "ms@npm:2.1.2" @@ -2863,8 +3013,11 @@ __metadata: dependencies: "@react-native/eslint-config": "npm:^0.72.1" "@types/node": "npm:^18.15.11" + "@typescript-eslint/eslint-plugin": "npm:^7.0.2" + "@typescript-eslint/parser": "npm:^7.0.2" esbuild: "npm:^0.17.11" - eslint: "npm:^8.35.0" + eslint: "npm:^8.0.0-0" + eslint-plugin-standard: "npm:^5.0.0" prettier: "npm:^2.5.1" tsc-watch: "npm:^6.0.0" typescript: "npm:^4.1.3" @@ -2912,7 +3065,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.7": +"semver@npm:^7.3.7, semver@npm:^7.6.0": version: 7.6.0 resolution: "semver@npm:7.6.0" dependencies: @@ -3141,6 +3294,15 @@ __metadata: languageName: node linkType: hard +"ts-api-utils@npm:^1.3.0": + version: 1.3.0 + resolution: "ts-api-utils@npm:1.3.0" + peerDependencies: + typescript: ">=4.2.0" + checksum: 10/3ee44faa24410cd649b5c864e068d438aa437ef64e9e4a66a41646a6d3024d3097a695eeb3fb26ee364705d3cb9653a65756d009e6a53badb6066a5f447bf7ed + languageName: node + linkType: hard + "tsc-watch@npm:^6.0.0": version: 6.2.0 resolution: "tsc-watch@npm:6.2.0" diff --git a/src/createAnimatedComponent/InlinePropManager.ts b/src/createAnimatedComponent/InlinePropManager.ts index f33b5426975..6c1a4ceebdb 100644 --- a/src/createAnimatedComponent/InlinePropManager.ts +++ b/src/createAnimatedComponent/InlinePropManager.ts @@ -37,7 +37,9 @@ function inlinePropsHasChanged( } for (const key of Object.keys(styles1)) { - if (styles1[key] !== styles2[key]) return true; + if (styles1[key] !== styles2[key]) { + return true; + } } return false; diff --git a/src/reanimated2/ViewDescriptorsSet.ts b/src/reanimated2/ViewDescriptorsSet.ts index 1807865909e..1e8858ff988 100644 --- a/src/reanimated2/ViewDescriptorsSet.ts +++ b/src/reanimated2/ViewDescriptorsSet.ts @@ -70,7 +70,9 @@ function useViewRefSetJS(): ViewRefSet { items: new Set(), add: (item: T) => { - if (data.items.has(item)) return; + if (data.items.has(item)) { + return; + } data.items.add(item); }, diff --git a/src/reanimated2/interpolation.ts b/src/reanimated2/interpolation.ts index 4b404d79dc6..cbf8a24e72b 100644 --- a/src/reanimated2/interpolation.ts +++ b/src/reanimated2/interpolation.ts @@ -135,7 +135,9 @@ function internalInterpolate( 'worklet'; const { leftEdgeInput, rightEdgeInput, leftEdgeOutput, rightEdgeOutput } = narrowedInput; - if (rightEdgeInput - leftEdgeInput === 0) return leftEdgeOutput; + if (rightEdgeInput - leftEdgeInput === 0) { + return leftEdgeOutput; + } const progress = (x - leftEdgeInput) / (rightEdgeInput - leftEdgeInput); const val = leftEdgeOutput + progress * (rightEdgeOutput - leftEdgeOutput); const coef = rightEdgeOutput >= leftEdgeOutput ? 1 : -1; diff --git a/yarn.lock b/yarn.lock index 1ba693f05a1..e25e54b01ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5645,7 +5645,7 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.56.0": +"eslint@npm:^8.0.0-0": version: 8.57.0 resolution: "eslint@npm:8.57.0" dependencies: @@ -10002,7 +10002,7 @@ __metadata: clang-format: "npm:^1.6.0" code-tag: "npm:^1.1.0" convert-source-map: "npm:^2.0.0" - eslint: "npm:^8.56.0" + eslint: "npm:^8.0.0-0" eslint-config-prettier: "npm:^8.3.0" eslint-config-standard: "npm:^17.1.0" eslint-import-resolver-babel-module: "npm:^5.3.1"