Comments (5)
It's considered good practice (at least on the team that wrote this material) to specify the types of function parameters even if they could potentially be inferred. In our main codebase, we actually have a lint rule enforcing that function parameters have types. So I think the code should stay as-is.
from frontend-bootcamp.
Looked at this more and my last comment was slightly incorrect--we actually use a TypeScript compiler option noImplicitAny
so that the compiler will give an error when the type of a parameter isn't specified. That's what would give an error if we removed the type here.
What I meant by "lint" is that our team uses a tool called tslint to help enforce good coding practices in TypeScript code. If someone writes code that violates a lint rule, it will show an error when they build the code. There are similar lint tools for other languages.
from frontend-bootcamp.
Would you mind explaining what you mean in more detail?
from frontend-bootcamp.
i mean since you have this,
class TodoHeader extends React.Component<**TodoHeaderProps**, TodoHeaderState> {
, then this is okay this way,
constructor(props: `TodoHeaderProps ) {
from frontend-bootcamp.
It's considered good practice (at least on the team that wrote this material) to specify the types of function parameters even if they could potentially be inferred. In our main codebase, we actually have a lint rule enforcing that function parameters have types. So I think the code should stay as-is.
could you please tell me that lint rule
?
from frontend-bootcamp.
Related Issues (20)
- Codepen doesn't work correctly on first exercise HOT 4
- Just testing HOT 1
- Same concept using Vue.js/Vuex HOT 1
- Can't load CodePen iFrames on Chrome, Firefox, or Brave HOT 3
- Online community HOT 3
- Empty result in embedded CodePen for step1-04 HOT 1
- How to debug the *.tsx HOT 2
- Answers to confirm work? HOT 10
- Step2-03 exercise 'customize default button with a styles function'
- step1-05/demo/ Failed to Compile
- step1-02/demo: 404 error loading Fabric logo image.
- Update to use new Fluent UI packages HOT 1
- React Intro(step1-04) missing Lessons? HOT 1
- CodePen for live site 1-4 demo does not render JSX HOT 2
- Broken link HOT 1
- Unable to run npm install HOT 1
- Why only VS Code? HOT 6
- bug in step1-03,Extra brackets HOT 3
- Better orientation on readme. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frontend-bootcamp.