Files
Laca-City/frontend/node_modules/eslint-plugin-import/docs/rules/first.md
PhongPham c65cc97a33 🎯 MapView v2.0 - Global Deployment Ready
 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
2025-07-20 19:52:16 +07:00

2.2 KiB

import/first

🔧 This rule is automatically fixable by the --fix CLI option.

This rule reports any imports that come after non-import statements.

Rule Details

import foo from './foo'

// some module-level initializer
initWith(foo)

import bar from './bar' // <- reported

Providing absolute-first as an option will report any absolute imports (i.e. packages) that come after any relative imports:

import foo from 'foo'
import bar from './bar'

import * as _ from 'lodash' // <- reported

If you really want import type ordering, check out import/order.

Notably, imports are hoisted, which means the imported modules will be evaluated before any of the statements interspersed between them. Keeping all imports together at the top of the file may prevent surprises resulting from this part of the spec.

On directives

Directives are allowed as long as they occur strictly before any import declarations, as follows:

'use super-mega-strict'

import { suchFoo } from 'lame-fake-module-name'  // no report here

A directive in this case is assumed to be a single statement that contains only a literal string-valued expression.

'use strict' would be a good example, except that modules are always in strict mode so it would be surprising to see a 'use strict' sharing a file with imports and exports.

Given that, see #255 for the reasoning.

With Fixer

This rule contains a fixer to reorder in-body import to top, the following criteria applied:

  1. Never re-order relative to each other, even if absolute-first is set.
  2. If an import creates an identifier, and that identifier is referenced at module level before the import itself, that won't be re-ordered.

When Not To Use It

If you don't mind imports being sprinkled throughout, you may not want to enable this rule.

Further Reading