FortAwesome / vue-fontawesome

Font Awesome Vue component
https://fontawesome.com
MIT License
2.38k stars 132 forks source link

eslint: FontAwesomeIcon not found in '@fortawesome/vue-fontawesome' #418

Closed smares closed 2 months ago

smares commented 1 year ago

Describe the bug FontAwesomeIcon not found in '@fortawesome/vue-fontawesome' eslint error using @nuxtjs/eslint-config-typescript

Reproducible test case https://stackblitz.com/edit/nuxt-starter-m8udv3

Expected behavior No linting errors

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

vivekjoshy commented 1 year ago

Any updates?

theolavaux commented 1 year ago

I've noticed this issue too FontAwesomeIcon not found in '@fortawesome/vue-fontawesome' eslint[import/named]

AndreiHudovich commented 1 year ago

The issue still exists. I'm using @nuxtjs/eslint-config-typescript too.

My .eslintrc.json, nothing special:

{
  "extends": [
    "@nuxtjs/eslint-config-typescript",
    "prettier"
  ]
}

plugins/fontAwesome.ts:

import { library, config } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { faBars } from '@fortawesome/free-solid-svg-icons'

config.autoAddCss = false

library.add(faBars)

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.component('FontAwesomeIcon', FontAwesomeIcon)
})

ESLint error message:

FontAwesomeIcon not found in '@fortawesome/vue-fontawesome'  import/named
mitjans commented 1 year ago

Any update on this? I'm having the same problem

shigeyf commented 1 year ago

Please see the pull request. I think that the update above will be a resolution for this issue.

jasonlundien commented 1 year ago

@smares ----

Are you still seeing this issue ?

I looked at your stackblitz but I am not seeing the linting errors. Also, I created a new nuxt 3 project, used your package.json file and not seeing the linting errors either.

If are you still seeing could you share a repo or update the stackblitz... or just update me on what I am missing perhaps?

Please Note I am seeing a Hydration completed but contains mismatches. error in the console on my project, but that is a separate known issue.

jasonlundien commented 2 months ago

Closing this for the time being, I am not able to reproduce.

Also, the other issue referenced, Update index.d.ts to add export declaration. #462, has been fixed up now with the Release of 3.0.8, we are now exporting the following props in index.d.ts.

export { FontAwesomeIcon, FontAwesomeIconProps, FontAwesomeLayers, FontAwesomeLayersProps, FontAwesomeLayersText, FontAwesomeLayersTextProps }

Let us know if anything else pops up. Thank you, -jason