Incorrect "There should be no empty line within import group"
See original GitHub issueI 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.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Formatting empty line between third party imports and other ...
I already found out how to sort the imports so that the third party imports are on top. I found my answer.
Read more >no-multiple-empty-lines - ESLint - Pluggable JavaScript Linter
This rule aims to reduce the scrolling required when reading through your code. It will warn when the maximum amount of empty lines...
Read more >Imports - checkstyle
imports will be sorted in the groups; groups are separated by single blank line. Notes: "com" package is not mentioned on configuration, because ......
Read more >Optimize Imports doesn't respect import groups : WEB-43661
The Optimize Imports action should respect the import groups, as delineated by blank lines. Merging/sorting should only occur within a group.
Read more >Rule: ordered-imports - Palantir Open Source
Requires that import statements be alphabetized and grouped. ... Import sources must be alphabetized within groups, i.e.: import * as foo from “a”; ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
What happens if you add a blank line between a side-effecting import/require and its neighboring normal import/require?
@Sergei8888 can you answer the question in https://github.com/import-js/eslint-plugin-import/issues/1062#issuecomment-903051219 ?