Skip to content
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

Ошибка линтера при проверке файла #442

Open
kirill-ivanovvv opened this issue Nov 22, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@kirill-ivanovvv
Copy link
Member

Описание бага

Воспроизведение

ошибка происходит при проверке линтером вот этого файла - https://github.com/torin-asakura/shdvor/blob/caa4876ddfa080a2bd2d0f17f04dd6d3ab0e38db/ui/intersection-observer/src/hooks/use-intersection-observer.hook.ts#L10

Ожидаемое поведение

  • ЛИБО файл проходит проверку
  • ЛИБО проверка пропускается, тк на файле висит /* eslint-disable */

Материалы

log
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
                                                                                                                                                                           
  context.getSource is not a function                                                                                                                                      
  Occurred while linting /home/operator/work/atls_shdvor/ui/intersection-observer/src/hooks/use-intersection-observer.hook.ts                                              Rule: "react-hooks/rules-of-hooks"                                                                                                                                       
                                                                                                                                                                           
    595 |                 } else if (codePathFunctionName) {                                                                                                               
    596 |                   // Custom message if we found an invalid function name.                                                                                        │
  > 597 |                   var _message2 = "React Hook \"" + context.getSource(hook) + "\" is called in " + ("function \"" + context.getSource(codePathFunctionName) +    
  "\" ") + 'that is neither a React function component nor a custom ' + 'React Hook function.' + ' React component names must start with an uppercase letter.' + ' React   │
│  Hook names must start with the word "use".';                                                                                                                             
        |                                                             ^                                                                                                    
    598 |                                                                                                                                                                  
    599 |                   context.report({                                                                                                                               
    600 |                     node: hook,                                                                                                                                  
                                                                                                                                                                           
  onCodePathEnd                                                                                                          eslint-plugin-react-hooks.development.js:597:61 (.yarn/__virtual__/eslint-plugin-react-hooks-virtual-bc1c96780e/2/.yarn/berry/cache/eslint-plugin-react-hooks-npm-4.6.2-05bc129286-10.zip/node_modules/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js)   
  ruleErrorHandler                                                                                                                                     linter.js:1084:48 (.yarn/__virtual__/eslint-virtual-ddfad26347/2/.yarn/berry/cache/eslint-npm-9.14.0-04ed57b338-10.zip/node_modules/eslint/lib/linter/linter.js)   
                                                                                                                                                   safe-emitter.js:45:58 (.yarn/__virtual__/eslint-virtual-ddfad26347/2/.yarn/berry/cache/eslint-npm-9.14.0-04ed57b338-10.zip/node_modules/eslint/lib/linter/safe-emitter.js)   
  Object.emit                                                                                                                                      safe-emitter.js:45:38 (.yarn/__virtual__/eslint-virtual-ddfad26347/2/.yarn/berry/cache/eslint-npm-9.14.0-04ed57b338-10.zip/node_modules/eslint/lib/linter/safe-emitter.js)   
  runRules                                                                                                                                             linter.js:1140:25 (.yarn/__virtual__/eslint-virtual-ddfad26347/2/.yarn/berry/cache/eslint-npm-9.14.0-04ed57b338-10.zip/node_modules/eslint/lib/linter/linter.js)   
  #flatVerifyWithoutProcessors                                                                                                                         linter.js:1911:31 (.yarn/__virtual__/eslint-virtual-ddfad26347/2/.yarn/berry/cache/eslint-npm-9.14.0-04ed57b338-10.zip/node_modules/eslint/lib/linter/linter.js)   
  Linter._verifyWithFlatConfigArrayAndWithoutProcess                                                                                                   linter.js:1992:49 (.yarn/__virtual__/eslint-virtual-ddfad26347/2/.yarn/berry/cache/eslint-npm-9.14.0-04ed57b338-10.zip/node_modules/eslint/lib/linter/linter.js)   
  ors                                                                                                                                                                      
  Linter._verifyWithFlatConfigArray                                                                                                                    linter.js:2081:21 (.yarn/__virtual__/eslint-virtual-ddfad26347/2/.yarn/berry/cache/eslint-npm-9.14.0-04ed57b338-10.zip/node_modules/eslint/lib/linter/linter.js)   
  Linter.verify                                                                                                                                        linter.js:1528:61 (.yarn/__virtual__/eslint-virtual-ddfad26347/2/.yarn/berry/cache/eslint-npm-9.14.0-04ed57b338-10.zip/node_modules/eslint/lib/linter/linter.js)   
                                                                                                                                                                           
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Данные окружения

  • archlinux 6.11.9-arch1-1
@kirill-ivanovvv kirill-ivanovvv added the bug Something isn't working label Nov 22, 2024
@kirill-ivanovvv kirill-ivanovvv changed the title Ошибка линера при проверке файла Ошибка линтера при проверке файла Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants