我正在构建一个带有Eslint设置的React应用程序。在我的应用程序中,我使用了GraphQL @apollo/客户端依赖项。
当我尝试做import { setContext } from '@apollo/client/link/context'的时候
我得到了一个eslint错误:
'@apollo/client/link/context' should be listed in the project's dependencies. Run 'npm i -S @apollo/client/link/context' to ad
结帐后,当我说react-native run-android时,我得到了下面的错误。
Metro Bundler has encountered an internal error, please check your terminal error output for more details
下面是我的项目中的package.json。
{
"name": "NCAPRNRedux",
"version": "0.0.1",
"private": true,
"scri
我已经启动了一个新的下一个项目,并根据docs的要求配置了jest和测试库。
由于语法错误,测试失败,由于某些原因,ts-jest无法解析stayles.container。
造成这种行为的原因是什么,我如何解决它?
下一次新安装时附带的默认索引页的一小部分:
import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'
export default function Home() {
re
我刚建立了一个带有类型记录的创建-反应-应用项目。我在npx eslint --init中添加了eslint。当我运行npx eslint src/或npx eslint src时,会得到一个错误:
Oops! Something went wrong! :(
ESLint: 8.18.0
No files matching the pattern "src" were found.
Please check for typing mistakes in the pattern.
但是,如果我使用以下命令:npx eslint src/*,那么它就能工作。这很好,但我看到的
我对React native和在Android上运行这个应用程序(由yarn运行)有问题。控制台告诉我的并不多:(
BUILD SUCCESSFUL in 42s
25 actionable tasks: 3 executed, 22 up-to-date
info Connecting to the development server...
warn Failed to connect to development server using "adb reverse": spawnSync adb ENOENT
info Starting the app...
'a
我正在准备我的第一次试镜。由于某些原因,它在其他计算机上工作,但我的除外。
Im使用VScode
一旦打开编辑器,就会收到以下消息:无法读取配置文件:/Users/user/Documents/repos/project/C:/mydirectory/.eslintrc.json Error: ENOENT: no such file or directory, open Source: ESLint (Extension)
.eslintrc.json在我的根目录上。
这是我的配置文件:
{
"parser": "babel-eslint",
我最近开始了一个已经成熟的项目,其中我正在集成Jest测试框架。该项目使用React与Webpack。在webpack的配置中,团队使用webpack.ProvidePlugin来提供React、lodash和类名(不是我想要做的,而是随便做什么)。
我遇到的问题是,文件顶部的大多数React类都包含像React.Component这样的东西,由于有了webpack的基本配置,它工作得很好。但是,当我运行相应的测试文件时,我只得到React is not defined,除非我显式地要求React。
有一个webpack.test.config文件需要基本的webpack配置,但我似乎无法获得
我正在用Jest测试一个React/Typescript组件,然后遇到这个错误:SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse。
我知道,当您尝试执行JSON.parse(undefined)时,会得到这个错误。我在试着弄清楚为什么在我的考试中会发生这种情况。
测试路由到呈现/new组件的NewPage路由,然后当错误到达该行const state = JSON.parse(JSON.stringify(location.state))时抛出错误(请参阅下面的组件)。
在Jest中,这似乎是要被嘲笑的,但不
我创建了示例react项目,并添加了用于测试我的组件的JEST、酶依赖项。但在运行测试套件时遇到以下错误:错误:无法从“App.js”中找到模块‘组件/添加’
However, Jest was able to find:
'components/Add.js'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['web.js', 'js'