Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

365
Views
ESLint: asignación insegura de un `cualquiera` y llamada insegura de un valor escrito `cualquiera`

Considere el siguiente código de prueba:

 import { isHtmlLinkDescriptor } from '@remix-run/react/links' import invariant from 'tiny-invariant' import { links } from '~/root' it('should return a rel=stylesheet', () => { const response = links() invariant(isHtmlLinkDescriptor(response[0])) expect(response[0].rel).toBe('stylesheet') })

y la implementación:

 import { LinksFunction } from 'remix' import tailwindProdUrl from '~/styles/tailwind.css' export const links: LinksFunction = () => { const href = process.env.NODE_ENV !== 'production' ? './tailwind.css' : tailwindProdUrl return [{ rel: 'stylesheet', href }] }

Donde LinksFunction se define aquí y aquí .

¿Por qué ESLint se queja de "Asignación insegura de any valor". y "Llamada no segura de any valor escrito". en la línea de abajo?

 const response = links()
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tiene una importación incorrecta en el segundo fragmento. Debería ser:

 import { LinksFunction } from '@remix-run/server-runtime';

o también, si está trabajando con TypeScript 3.8 o posterior:

 import type { LinksFunction } from '@remix-run/server-runtime';

El hecho de que LinksFunction solo se use como un tipo en el código que está mostrando significa que el compilador de TypeScript aún podría compilar sus módulos bajo ciertas circunstancias, a pesar de las definiciones de tipo que faltan.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!