पाठ 22 / 25
Real-world प्रोजेक्ट उदाहरण
Actual project setups में ESLint और Prettier देखें।
Reference implementations
React projects, Node.js backends, TypeScript monorepos—प्रत्येक के unique linting needs हैं। अपने context के लिए adapt करने के लिए उदाहरणों को review करें।
React project setup
एक modern React project के लिए complete ESLint और Prettier setup।
// .eslintrc.json for React project
{
"env": { "browser": true, "es2021": true },
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier"],
"plugins": ["react", "react-hooks"],
"rules": {
"react/react-in-jsx-scope": "off",
"react-hooks/rules-of-hooks": "error",
"no-unused-vars": "warn"
}
}
// .prettierrc
{
"singleQuote": true,
"trailingComma": "es5",
"semi": true
}
Output:
React project ready for linting and formatting
Copy न करें, adapt करें
उदाहरणों को starting points के रूप में उपयोग करें, लेकिन अपनी project की specific needs के लिए उन्हें customize करें। आपकी टीम के standards templates को follow करने से अधिक मायने रखते हैं।
त्वरित जाँच
त्वरित जाँच: क्या आपको example configs को as-is उपयोग करना चाहिए?
- नहीं, अपनी project की needs के लिए उन्हें customize करें।
- हाँ, हमेशा उदाहरणों को exactly copy करें।
- यह मायने नहीं रखता।
Answer
नहीं, अपनी project की needs के लिए उन्हें customize करें। — उदाहरण starting points हैं। आपकी टीम के standards और project-specific needs configuration choices को drive करने चाहिए।