react icon indicating copy to clipboard operation
react copied to clipboard

[React Compiler] use `filename` instead of `context.filename` in ESLint plugin

Open kirillzyusko opened this issue 1 month ago • 0 comments

Summary

Use filename instead of context.filename in eslint compiler.

The problem is that in react-native + typescript project the context may not have filename:

image

And eslint will crash with:

TypeError: Error while loading rule 'react-compiler/react-compiler': Cannot read properties of undefined (reading 'endsWith')

But in fact we already derive filename variable earlier so we can simply reuse the variable (I guess).

How did you test this change?

  • add eslint plugin to RN project;
  • run eslint

kirillzyusko avatar May 16 '24 12:05 kirillzyusko