eslint-plugin-import: Incorrect "There should be no empty line within import group"

I get this message a lot, with no rhyme or reason as to why…

For this code:

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/interval';
import 'rxjs/add/observable/of';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/operator/throttle';

I get this warning: There should be no empty line within import group for line 1.

For this code:

import { getActiveProjectId } from 'uf/app/selectors';
import {
  makeGetAnalysisModuleInfoForProject,
  makeGetScenarioInfoForProject,
} from 'uf/projects/selectors';
import { addAppMessage } from 'uf/appservices/actions';
import { loadProject, updateProjectStatus } from 'uf/projects/actions';

I get the same warning on the `addAppMessage’ line.

For this code:

// Bootstrap babel and sourcemaps.
require('source-map-support/register');
const universalWebpack = require('universal-webpack');

const universalWebpackSettings = require('../webpack/universal-webpack-settings');
const webpackConfig = require('../webpack/webpack.config');

// This tells webpack to not re-apply babel to the server itself as a
// part of server startup.
const babelOptions = universalWebpack.babelRegisterOptions(
  universalWebpackSettings, webpackConfig);

I get the warning on the const webpackConfig = line.

I don’t know if the error message is just on the wrong line, but I can’t figure out how to correct my imports to make this pass.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 8
  • Comments: 21 (9 by maintainers)

Most upvoted comments

edit: Opened a bug report: #2876

What happens if you add a blank line between a side-effecting import/require and its neighboring normal import/require?