ESLint doesn't recognize conditional import/export


I have a structure like this:
File: imports/utils/server/index.js

export * from './secretStuff'

File: imports/utils/index.js

export * from './publicStuff'

if (Meteor.isServer) {
  export * from './server'

The problem is that if I do this in another server-only file, e.g.:

import { publicFn, secretFn } from '/imports/utils

ESLint thinks that secretFn cannot be found in /imports/utils. Is there a config (or another convenient structure) I can use to fix this?

You should be able to fix this by telling eslint to allowImportExportEverywhere, and the parser should be able to read exported symbols correctly

parser: 'babel-eslint',
    parserOptions: {
        allowImportExportEverywhere: true,

If that doesn’t work try adding:
eslint-import-resolver-meteor through npm
and in .eslintrc:

settings: {
        'import/resolver': {
            meteor: {},

Unfortunately, it doesn’t work. Both options are in the eslintrc.

To clarify: eslint doesn’t complain about the export * from './server' line, even if it’s inside the if condition, but it doesn’t recognize/find the exported functions when I try to import them from another file. If I move the export out of the if condition, it works.