Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
React学习手册
by
Alex Banks
,
Eve Porcello
December 2017
Intermediate to advanced
329 pages
6h 9m
Chinese
China Electric Power Press Ltd.
Content preview from
React学习手册
226
|
第
10
章
命令
eslint
.
将会检查我们的整个目录。为此,用户很有可能需要
ESLint
忽略某些
JavaScript
文件。
.eslintignore
文件是用户可以添加需要
ESLint
忽略的文件或者目录名
称的地方:
dist/assets/
sample.js
.eslintignore
文件会告知
ESLint
忽略对新的
sample.js
文件的检查。这就和
dist/assets
文件
夹下的其他任意文件一样。
ESLint
将会分析客户端
bundle.js
文件,并且会在该文件中
报告大量警告信息。
让我们在
package.json
中添加一个脚本,以便可以运行代码检查命令:
"scripts": {
"lint": "./node_modules/.bin/eslint ."
}
现在随时都可以使用
npm
run
lint
命令调用
ESLint
进行代码格式检查工作了,它会分
析除了已经忽略的文件之外的所有项目文件。
测试
Redux
测试对于
Redux
至关重要,因为它只和数据打交道,它并不包含
UI
。
Redux
天生就是
可测试的,因为它的
Reducer
是纯函数,并且它可以方便地将
State
注入
Store
。编写一
个
Reducer
的测试,首先使得用户更容易理解该
Reducer
的工作机制。为
Store
和
Action
生成器编写测试代码,可以提高用户对客户端数据层能够按照预期运行的信心。
在本节中,我们将会为颜色管理器的
Redux
组件编写一些单元测试。
测试驱动开发
测试驱动开发(
Test-Driven Development ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
React快速上手开发
Stoyan Stefanov
流畅的Python
Luciano Ramalho
C++语言导学(原书第2版)
本贾尼 斯特劳斯特鲁普
C++程序设计:原理与实践(基础篇)(原书第2版)
本贾尼 斯特劳斯特鲁普
Publisher Resources
ISBN: 9787519814236