1 पॉइंट द्वारा nayounsang1 22 시간 전 | अभी कोई टिप्पणी नहीं है. | WhatsApp पर शेयर करें

हाल ही में internship के दौरान मैंने पहली बार किसी product के विशाल codebase का अनुभव किया। बदलाव का असर कहाँ तक जाएगा, इसका अंदाज़ा लगाना मुश्किल था, और “इस code को कहाँ से reference करना चाहिए” यह सवाल बार-बार सामने आया। मुझे लगा कि static analysis (ESLint) से import boundaries enforce करने पर architecture quality को ज्यादा स्थिर रूप से बनाए रखा जा सकता है।
मुझे पता था कि eslint-plugin-boundaries से भी मिलते-जुलते rules बनाए जा सकते हैं। हालांकि frontend में इसे लागू करने के लिए configuration जटिल हो जाती थी, और target allow हो तब भी import path के format को enforce करना मुश्किल था।

इसलिए मैंने eslint-plugin-import-boundary बनाया, जिसमें simple configuration के साथ JS(TS) projects का folder structure ही rule बन जाता है।

  • डिफ़ॉल्ट रूप से parent केवल direct child directory के public entry को ही import कर सकता है
  • public entry file format specify किया जा सकता है (default: index)
  • common files (folders) specify करके, उस scope के अंदर ही shared modules को अपने और subdirectory areas से import किया जा सकता है।

यह अभी शुरुआती stage में है, इसलिए feedback और reactions का स्वागत है। धन्यवाद!

अभी कोई टिप्पणी नहीं है.

अभी कोई टिप्पणी नहीं है.