✨ MAJOR FEATURES: • Auto-zoom intelligence với smart bounds fitting • Enhanced 3D GPS markers với pulsing effects • Professional route display với 6-layer rendering • Status-based parking icons với availability indicators • Production-ready build optimizations 🗺️ AUTO-ZOOM FEATURES: • Smart bounds fitting cho GPS + selected parking • Adaptive padding (50px) cho visual balance • Max zoom control (level 16) để tránh quá gần • Dynamic centering khi không có selection 🎨 ENHANCED VISUALS: • 3D GPS marker với multi-layer pulse effects • Advanced parking icons với status colors • Selection highlighting với animation • Dimming system cho non-selected items 🛣️ ROUTE SYSTEM: • OpenRouteService API integration • Multi-layer route rendering (glow, shadow, main, animated) • Real-time distance & duration calculation • Visual route info trong popup 📱 PRODUCTION READY: • SSR safe với dynamic imports • Build errors resolved • Global deployment via Vercel • Optimized performance 🌍 DEPLOYMENT: • Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app • Bundle size: 22.8 kB optimized • Global CDN distribution • HTTPS enabled 💾 VERSION CONTROL: • MapView-v2.0.tsx backup created • MAPVIEW_VERSIONS.md documentation • Full version history tracking
2.6 KiB
import/no-relative-parent-imports
Use this rule to prevent imports to folders in relative parent paths.
This rule is useful for enforcing tree-like folder structures instead of complex graph-like folder structures. While this restriction might be a departure from Node's default resolution style, it can lead large, complex codebases to be easier to maintain. If you've ever had debates over "where to put files" this rule is for you.
To fix violations of this rule there are three general strategies. Given this example:
numbers
└── three.js
add.js
// ./add.js
export default function (numbers) {
return numbers.reduce((sum, n) => sum + n, 0);
}
// ./numbers/three.js
import add from '../add'; // violates import/no-relative-parent-imports
export default function three() {
return add([1, 2]);
}
You can,
-
Move the file to be in a sibling folder (or higher) of the dependency.
three.jscould be be in the same folder asadd.js:three.js add.jsor since
adddoesn't have any imports, it could be in it's own directory (namespace):math └── add.js three.js -
Pass the dependency as an argument at runtime (dependency injection)
// three.js export default function three(add) { return add([1, 2]); } // somewhere else when you use `three.js`: import add from './add'; import three from './numbers/three'; console.log(three(add)); -
Make the dependency a package so it's globally available to all files in your project:
import add from 'add'; // from https://www.npmjs.com/package/add export default function three() { return add([1,2]); }
These are (respectively) static, dynamic & global solutions to graph-like dependency resolution.
Examples
Given the following folder structure:
my-project
├── lib
│ ├── a.js
│ └── b.js
└── main.js
And the .eslintrc file:
{
...
"rules": {
"import/no-relative-parent-imports": "error"
}
}
The following patterns are considered problems:
/**
* in my-project/lib/a.js
*/
import bar from '../main'; // Import parent file using a relative path
The following patterns are NOT considered problems:
/**
* in my-project/main.js
*/
import foo from 'foo'; // Import package using module path
import a from './lib/a'; // Import child file using relative path
/**
* in my-project/lib/a.js
*/
import b from './b'; // Import sibling file using relative path