From c45853d0813f1869b7739bcd7329ddb3e75f05e7 Mon Sep 17 00:00:00 2001 From: Justin Hernandez Date: Thu, 16 Oct 2025 20:43:29 -0700 Subject: [PATCH] speed up prettier and eslint (#1295) * speed up prettier and eslint * throw error * turn off --- app/.eslintrc.cjs | 29 ++++++++++------------------- app/.gitignore | 6 ++++++ app/package.json | 8 ++++---- 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/app/.eslintrc.cjs b/app/.eslintrc.cjs index 20cf3787c..cb1509f8d 100644 --- a/app/.eslintrc.cjs +++ b/app/.eslintrc.cjs @@ -34,24 +34,6 @@ module.exports = { ], settings: { react: { version: 'detect' }, - 'import/resolver': { - typescript: { - alwaysTryTypes: true, - project: './tsconfig.json', - extensions: [ - '.ts', - '.tsx', - '.native.ts', - '.native.tsx', - '.web.ts', - '.web.tsx', - '.ios.ts', - '.ios.tsx', - '.android.ts', - '.android.tsx', - ], - }, - }, 'import/ignore': ['react-native'], }, rules: { @@ -169,7 +151,7 @@ module.exports = { '@typescript-eslint/no-namespace': 'off', 'no-case-declarations': 'off', 'react/no-children-prop': 'off', - 'import/no-unresolved': 'error', + 'import/no-unresolved': 'off', // TypeScript handles this '@typescript-eslint/ban-ts-comment': 'off', 'no-empty': 'off', @@ -188,6 +170,14 @@ module.exports = { '@typescript-eslint/indent': 'off', }, overrides: [ + { + // Enable TypeScript project service for source files for faster parsing + files: ['src/**/*.{ts,tsx}'], + parserOptions: { + project: true, + EXPERIMENTAL_useProjectService: true, + }, + }, { files: ['docs/examples/**/*.ts'], rules: { @@ -218,6 +208,7 @@ module.exports = { }, parserOptions: { project: './tsconfig.test.json', + EXPERIMENTAL_useProjectService: true, }, rules: { // Allow console logging and relaxed typing in tests diff --git a/app/.gitignore b/app/.gitignore index 6397bff3c..32956c13b 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -74,6 +74,12 @@ yarn-error.log # testing /coverage +# linting cache +.eslintcache + +# prettier cache +.cache/ + .env **/Pods/ diff --git a/app/package.json b/app/package.json index 72bffcf7e..dbb798992 100644 --- a/app/package.json +++ b/app/package.json @@ -24,8 +24,8 @@ "clean:xcode": "rm -rf ~/Library/Developer/Xcode/DerivedData", "clean:xcode-env-local": "rm -f ios/.xcode.env.local", "find:type-imports": "node scripts/find-type-import-issues.mjs", - "fmt": "yarn prettier --check .", - "fmt:fix": "yarn prettier --write .", + "fmt": "yarn prettier --check --cache .", + "fmt:fix": "yarn prettier --write --cache .", "format": "yarn nice", "ia": "yarn install-app", "imports:fix": "node ./scripts/alias-imports.cjs", @@ -34,8 +34,8 @@ "install-app:setup": "yarn install && yarn build:deps && yarn setup:android-deps && cd ios && bundle install && scripts/pod-install-with-cache-fix.sh && cd ..", "ios": "yarn build:deps && node scripts/run-ios-simulator.cjs", "ios:fastlane-debug": "yarn reinstall && bundle exec fastlane --verbose ios internal_test", - "lint": "eslint .", - "lint:fix": "eslint --fix .", + "lint": "eslint . --cache --cache-location .eslintcache", + "lint:fix": "eslint --fix . --cache --cache-location .eslintcache", "mobile-deploy": "node scripts/mobile-deploy-confirm.cjs both", "mobile-deploy:android": "node scripts/mobile-deploy-confirm.cjs android", "mobile-deploy:ios": "node scripts/mobile-deploy-confirm.cjs ios",