eslint-import-resolver-meteor

raw JSON →
0.4.0 verified Sat Apr 25 auth: no javascript maintenance

A resolver for eslint-plugin-import that provides Meteor-specific import resolution in ESLint. Version 0.4.0 is the latest stable release, last updated in 2018. It handles '/' root imports, enforces client/server folder import restrictions, and resolves 'meteor/' package imports with limitations. Unlike generic resolvers, it uses the project's .meteor folder to resolve paths and checks .meteor/versions and .meteor/packages for package existence. Provides configurable extensions, paths, and moduleDirectory. Works with eslint-plugin-import >=1.4.0.

error Unable to resolve path to module 'meteor/meteor'
cause The resolver cannot find the Meteor internal package; either package not added or .meteor/versions missing.
fix
Ensure you have run 'meteor add meteor' or check that .meteor/versions exists. The resolver may produce false positives.
error import/no-unresolved: Unable to resolve path to module '/imports/foo'
cause The '/' path resolution uses the .meteor parent directory; file not found relative to project root.
fix
Verify that the file exists at PROJECT_ROOT/imports/foo, where PROJECT_ROOT is the directory containing .meteor.
error ESLint configuration error: Cannot find module 'eslint-import-resolver-meteor'
cause Missing required peer dependency eslint-plugin-import or resolver package not installed.
fix
Run: npm install --save-dev eslint-plugin-import eslint-import-resolver-meteor
gotcha Meteor package imports (e.g., 'meteor/foo:bar') may not resolve correctly; resolver only checks package existence, not actual exports.
fix Use the resolver for basic linting, but be aware of false positives. For accurate resolution, consider using Meteor's built-in linting tools.
gotcha Extensions must be re-added explicitly when setting custom extensions; default is only '.js'.
fix Include '.js' in the extensions array if you want it alongside others.
deprecated Package has not been updated since 2018; may not work with newer ESLint versions (e.g., ESLint 9 flat config).
fix Consider using eslint-import-resolver-typescript or writing a custom resolver for modern ESLint.
gotcha Client/server folder restriction may report false positives if files are shared via symlinks or unconventional structures.
fix Disable the import/no-restricted-paths rule if false positives occur, or adjust folder structure.
gotcha Resolving '/' paths uses the parent directory of .meteor folder; if .meteor is not found, resolution fails.
fix Ensure the project has a .meteor folder in a parent directory, or set the root manually via settings.
npm install eslint-import-resolver-meteor
yarn add eslint-import-resolver-meteor
pnpm add eslint-import-resolver-meteor

Configures ESLint to use Meteor resolver with custom extensions, enabling import/no-unresolved rule.

// .eslintrc.js
module.exports = {
  settings: {
    'import/resolver': {
      meteor: {
        extensions: ['.js', '.jsx', '.mjs']
      }
    }
  },
  rules: {
    'import/no-unresolved': 'error'
  }
};