Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

play nice with import/order #119

Closed
AdrienLemaire opened this issue Dec 6, 2018 · 3 comments
Closed

play nice with import/order #119

AdrienLemaire opened this issue Dec 6, 2018 · 3 comments

Comments

@AdrienLemaire
Copy link

Related to import-js/eslint-plugin-import#795 (comment).

Would it be difficult to support the import/order rule so that it understand all ~/ imports as part of the same group (I suppose the internal one) ?

When I try the option {"newlines-between": "always"}, all groups are nicely grouped and separated by an empty line, except for all the ~/something import, which aren't grouped and all separated by an empty line.
This results in something like following:

import React, {Component, Fragment} from "react";
import PropTypes from "prop-types";
import {Element} from "react-scroll";
import {Link} from "react-router-dom";
import {connect} from "react-redux";

import {withLogs, withMotion} from "~/lib/decorators";

import {imageUrlProp} from "~/lib/customProps";

import {getHostDetailsAction} from "~/actions";

import {getContactUrl} from "~/urls";

import Cta from "./Cta";
import BasicInfo from "./BasicInfo";

I would really appreciate if we could turn this as:

import React, {Component, Fragment} from "react";
import PropTypes from "prop-types";
import {Element} from "react-scroll";
import {Link} from "react-router-dom";
import {connect} from "react-redux";

import {withLogs, withMotion} from "~/lib/decorators";
import {imageUrlProp} from "~/lib/customProps";
import {getHostDetailsAction} from "~/actions";
import {getContactUrl} from "~/urls";

import Cta from "./Cta";
import BasicInfo from "./BasicInfo";
@lucasveigaf
Copy link

Seems like a lot of people would like something like this. Perhaps we could use a regex to define a new group?

@brigand
Copy link
Collaborator

brigand commented Dec 26, 2018

Is there something we can do here? I'm not sure what the actionable part of this issue is.

@brigand
Copy link
Collaborator

brigand commented May 23, 2019

Closing as this seems to be a feature request for a separate project, or a good idea for a new library.

@brigand brigand closed this as completed May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants