-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
globalScope.__defineGeneric
is not a function
#49
Comments
Thanks for raising this issue. At first glance it seems to be because But because with flow you should use
|
Have raised an issue with hermes team. Lets see if they come back with anything useful before I cont my investigation. Otherwise I'll need to understand what that function did in the beginning to find a suitable replacement function |
^ Merged a fix. Please give a go with v3.0.3 and let me know if it works 🙏 |
Thank you for a very fast response and fix!
Edit: in fact, I ran module.exports = {
parser: 'hermes-eslint',
parserOptions: {
ecmaVersion: 9,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
babelOptions: {
configFile: path.resolve(__dirname, './babel.config.js'),
},
},
extends: ['plugin:ft-flow/recommended'],
plugins: [
'ft-flow',
],
env: {
browser: true,
jquery: true,
node: true,
jest: true,
es6: true,
},
root: true,
globals: {
globalThis: 'readonly',
},
rules: {
'ft-flow/define-flow-type': 1, // (1)
'ft-flow/use-flow-type': 1, // (2)
'no-unused-vars': ['error', { argsIgnorePattern: '^_', ignoreRestSiblings: true }],
},
settings: {
'import/resolver': {
node: {
paths: ['.'],
extensions: ['.js', '.ts', '.jsx', '.tsx'],
},
'babel-module': {
cwd: 'babelrc',
root: ['./src/'],
alias: babelAliases,
},
},
'import/external-module-folders': [path.resolve(__dirname, './node_modules/')],
'import/internal-regex': '^@+foxford',
react: {
version: '17',
},
flowtype: {
onlyFilesWithFlowAnnotation: true,
},
},
ignorePatterns: ['.eslintrc.js', '/docs', '/build', '/flow-typed', '**/node_modules/**', '*/*.sass'],
} commenting out lines (1) and (2) makes `no-unused-vars' work, while keeping them leads to an error above |
:/ hmm I'll need to reproduce it in tests to find a solution. The change I made was to
For some more info
|
|
Great I was able to reproduce this, turns out we never had a test against |
@e1cb4ac37s can you try |
FWIW |
Thanks for validating @short-dsb. I'll work on getting my tests working and publish an official release this weekend... Unless someone finds more problems 😨 |
Works for me now. Awesome job, Brian! Thank you! |
Thanks, @Brianzchen! Really appreciate it. 🙂 |
globalScope.__defineGeneric
is not a funtionHello. What problem do I try to solve: we try to migrate our out-of-date flow to the latest version, and on the way installed
ft-flow
to lint it. We haveno-undef
rule, and need to override it for flow internal types, i.e.$Values<...>
,$Keys<...>
, ..., because they conflict with eslint'sno-undef
now.I'm trying to add
ft-flow
to.eslintrs.js
, which kinda works until I start adding rules beyond recommended extension. My config (relevant parts, I guess):The line of code where I get the error (I guess,
$Values<...>
breaks it)There is similar issue in your legacy (right?) project, but no solutions provided whatsoever. What can I do? Or maybe this is a bug? Thank you in advance.
The text was updated successfully, but these errors were encountered: