Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ESLint: Warning in resolving Meteor pseudo-globals

Tags:

eslint

meteor

ESLint is giving a warning for:

import { Meteor } from 'meteor/meteor';

The warning is: Unable to resolve path to module 'meteor/meteor'. How I can turn it off? Or resolve it?

like image 525
vijayst Avatar asked Jun 11 '16 15:06

vijayst


2 Answers

You need to add a Meteor related special rule to your .eslintrc.json :

{
  "rules": {
    "import/no-unresolved": ["error", { "ignore": ["^meteor/", "^/"] }]
  }
}

This rule will add 2 exceptions to the import/no-unresolved :

  • meteor/ to allow importing Meteor packages from the meteor/ pseudo directory.
  • / to allow importing packages from the root of your Meteor project (eg. /imports/collections/Posts).
like image 172
saimeunt Avatar answered Oct 17 '22 04:10

saimeunt


I've been using eslint-import-resolver-meteor

settings: {
    'import/resolver': 'meteor'
},
like image 6
Anthony Astige Avatar answered Oct 17 '22 05:10

Anthony Astige