nuxt-community / svg-module

Super simple svg loading module for Nuxt.js
MIT License
340 stars 35 forks source link

eslint-plugin-import error on '.svg?inline' in component #4

Closed laSinteZ closed 4 years ago

laSinteZ commented 5 years ago

Description

For some reason, eslint-plugin-import triggers with 10:18 error Unable to resolve path to module '~/assets/example.svg?inline' import/no-unresolved

but OK with <img src="~/assets/example.svg?data"> I understand that problem most probably is in the eslint-plugin-import but maybe we can solve it here :)

How to repeat

https://github.com/laSinteZ/nuxt-svg-bug/tree/bug/eslint-plugin-import

yarn
yarn lint
laSinteZ commented 5 years ago

(for all seeking for a temporary "fix") I temporarily disabled this rule for SVGs with

rules: {
  'import/no-unresolved': [
    'error',
    {
      'ignore': [ '\.svg' ]
    }
  ]
}

in .eslintrc.js

sam3d commented 5 years ago

@laSinteZ Thank you for this and for providing both a reproduction link and a temporary fix! I'm afraid I won't be able to get round to implementing a fix for this within the module for a little while.