Skip to content

Commit 9bc39b5

Browse files
authored
Merge pull request Expensify#79286 from margelo/@chrispader/react-compiler-v1-lint-rules
[No QA] React Compiler v1 Rules (latest `eslint-plugin-react-hooks`)
2 parents 3bf7f14 + c447262 commit 9bc39b5

250 files changed

Lines changed: 711 additions & 856 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/javascript/authorChecklist/index.js

Lines changed: 442 additions & 423 deletions
Large diffs are not rendered by default.

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@
784784
"Yema",
785785
"yourcompany",
786786
"yourname",
787+
"yalc",
787788
"YYMM",
788789
"zencdn",
789790
"Zenefit",

eslint.config.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import expensifyConfig from 'eslint-config-expensify';
44
import jsdoc from 'eslint-plugin-jsdoc';
55
import lodash from 'eslint-plugin-lodash';
66
import react from 'eslint-plugin-react';
7-
import reactCompiler from 'eslint-plugin-react-compiler';
87
import reactNativeA11Y from 'eslint-plugin-react-native-a11y';
98
import testingLibrary from 'eslint-plugin-testing-library';
109
import youDontNeedLodashUnderscore from 'eslint-plugin-you-dont-need-lodash-underscore';
@@ -180,7 +179,6 @@ const config = defineConfig([
180179
'react-native-a11y': reactNativeA11Y,
181180
react,
182181
'testing-library': testingLibrary,
183-
'react-compiler': reactCompiler,
184182
lodash,
185183
},
186184

@@ -322,7 +320,6 @@ const config = defineConfig([
322320
touchables: ['PressableWithoutFeedback', 'PressableWithFeedback'],
323321
},
324322
],
325-
'react-compiler/react-compiler': 'error',
326323

327324
// Disallow usage of certain functions and imports
328325
'no-restricted-syntax': [
@@ -606,6 +603,7 @@ const config = defineConfig([
606603
'web/gtm.js',
607604
'**/.expo/**/*',
608605
'**/.rock/**/*',
606+
'**/.yalc/**/*',
609607
'src/libs/SearchParser/searchParser.js',
610608
'src/libs/SearchParser/autocompleteParser.js',
611609
'help/_scripts/**/*',

package-lock.json

Lines changed: 43 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand",
4444
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
4545
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
46-
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=110 --cache --cache-location=node_modules/.cache/eslint --cache-strategy content --concurrency=auto",
46+
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=669 --cache --cache-location=node_modules/.cache/eslint --cache-strategy content --concurrency=auto",
4747
"lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh",
4848
"check-lazy-loading": "ts-node scripts/checkLazyLoading.ts",
4949
"lint-watch": "npx eslint-watch --watch --changed",
@@ -310,12 +310,11 @@
310310
"dotenv": "^16.0.3",
311311
"eslint": "^9.36.0",
312312
"eslint-config-airbnb-typescript": "^18.0.0",
313-
"eslint-config-expensify": "2.0.101",
313+
"eslint-config-expensify": "2.0.103",
314314
"eslint-config-prettier": "^9.1.0",
315315
"eslint-plugin-jest": "^29.0.1",
316316
"eslint-plugin-jsdoc": "^60.7.0",
317317
"eslint-plugin-lodash": "^7.4.0",
318-
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
319318
"eslint-plugin-react-native-a11y": "^3.3.0",
320319
"eslint-plugin-storybook": "^10.1.10",
321320
"eslint-plugin-testing-library": "^7.11.0",

scripts/react-compiler-compliance-check.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class ReactCompilerHealthcheck {
238238
* Analyzes git diffs to filter compiler results to only changed lines.
239239
*/
240240
class DiffAnalyzer {
241-
private static readonly ESLINT_LINT_RULES = ['react-compiler/react-compiler', 'react-hooks'] as const;
241+
private static readonly ESLINT_LINT_RULES = ['react-hooks'] as const;
242242

243243
/**
244244
* Filter compiler results to only include errors for lines that were changed in the git diff.

scripts/utils/EslintUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const EslintUtils = {
1313
*
1414
* @param content - The line content to check
1515
* @param isFileLevel - Whether to check for file-level disable comments (true) or line-level (false)
16-
* @param rules - Array of ESLint rule names to check for (e.g., ['react-compiler/react-compiler', 'react-hooks'])
16+
* @param rules - Array of ESLint rule names to check for (e.g., ['react-hooks'])
1717
* @returns True if the line contains a matching eslint-disable comment
1818
*/
1919
hasEslintDisableComment(content: string, isFileLevel: boolean, rules: string[]): boolean {

src/Expensify.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ function Expensify() {
313313
}
314314
linkingChangeListener.current.remove();
315315
};
316-
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps -- we don't want this effect to run again
316+
// eslint-disable-next-line react-hooks/exhaustive-deps -- we don't want this effect to run again
317317
}, [sessionMetadata?.status]);
318318

319319
// This is being done since we want to play sound even when iOS device is on silent mode, to align with other platforms.
@@ -328,7 +328,7 @@ function Expensify() {
328328
updateLastRoute('');
329329
Navigation.navigate(lastRoute as Route);
330330
// Disabling this rule because we only want it to run on the first render.
331-
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
331+
// eslint-disable-next-line react-hooks/exhaustive-deps
332332
}, [isNavigationReady]);
333333

334334
useEffect(() => {

src/components/ActionSheetAwareScrollView/useActionSheetAwareScrollViewRef.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function useActionSheetAwareScrollViewRef(ref: Ref<ActionSheetAwareScrollViewHan
1212
if (typeof ref === 'function') {
1313
ref(assignedRef);
1414
} else if (ref) {
15-
// eslint-disable-next-line no-param-reassign, react-compiler/react-compiler
15+
// eslint-disable-next-line no-param-reassign
1616
ref.current = assignedRef;
1717
}
1818

src/components/ActionSheetAwareScrollView/useActionSheetKeyboardSpacing.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ function useActionSheetKeyboardSpacing(scrollViewAnimatedRef: AnimatedRef<Reanim
8686
if (lastState === syncLocalWorkletState.get()) {
8787
return;
8888
}
89-
// eslint-disable-next-line react-compiler/react-compiler
9089
syncLocalWorkletState.set(lastState);
9190

9291
if (lastState === KeyboardState.OPEN) {

0 commit comments

Comments
 (0)