0

I can't find any information on this case on the web, maybe someone would know how to do it. I receive an warning message like 'FournisseursDb' is defined but never used no-unused-vars when I import this file.

enter image description here

It is not used but I need it to display my datas.

I saw on another project that the problem was being bypassed by this way (with a @ before the folder):

enter image description here

And the import is replaced by:

enter image description here

I have tried but it doesn't work, when I change my import, I receive an error like Module not found: Can't resolve '@fake-db' in '/Users/dev-delko/dev/delko/ledok-ui/src' , I don't understand why. I have to add a library or something like this ? Thanks in advance.

1 Answers1

1

You can disable the eslint warning by adding the following line at the start of your file. But I still don't understand why do you need it if it's not getting used.

/* eslint-disable no-unused-vars */
Shivratna Kumar
  • 1,311
  • 1
  • 8
  • 18
  • Thank you @ShivratnaKumar but what is the purpose of this @ in front of files and in imports ? this `FournisseursDb.js` file is a database simulation with mock from the `axios-mock-adapter` library. If I delete this import, I simply do not receive my datas.. The application needs it to work but does not use the file directly. –  Nov 22 '19 at 14:28
  • It's just a way to import scoped modules. You can read more about it here - https://stackoverflow.com/questions/36293481/use-of-symbol-in-node-module-names – Shivratna Kumar Nov 22 '19 at 14:50