Code Monkey home page Code Monkey logo

relativepathrefactor's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

petterh

relativepathrefactor's Issues

Double quotes are used regardless of the configuration

Hello and thank you for your work!

One thing I've noticed is this: when Fix relative paths is applied, it wraps newly generated path into double quotes, regardless of the convention in use.

// Before
import Styles from './Back.css';

After hitting Fix relative paths:

// Error: [eslint] Strings must use singlequote. (quotes)
import Styles from "../js/components/Back.css"; 

The expected behavior would be to use the kind of quotes that were used before fixing the path.

Setup

Some paths skipped

Some import statements are incorrectly skipped when fixing relative paths.

Example 1: Before (back two directories):

import { connect } from 'react-redux';
import { memberA } from '../../shared/app/someUtil';
import { memberB, memberC } from '../../shared/account/someWorkflow';
import { memberD } from '../../shared/app/anotherWorkflow';

Example 1: After (back three directories):

import { connect } from 'react-redux';
import { memberA } from "../../../shared/app/localeUtil"; // updated
import { memberB, memberC } from '../../shared/account/someWorkflow'; // skipped
import { memberD } from '../../shared/app/anotherWorkflow'; // skipped

Example 2: Before (back two directories):

import { Link } from 'react-router';
import { memberA, memberB } from '../../shared/util/images';
import Image from '../../shared/component/Image';
import * as classnames from 'classnames';

Example 2: After (back three directories):

import { Link } from 'react-router';
import { memberA, memberB } from '../../shared/util/images'; // skipped
import Image from "../../../shared/component/Image"; // updated
import * as classnames from 'classnames';

This problem occurs throughout several of my project's files. It seems to occur for both single member and multiple member imports.

Interestingly it seems to struggle with imports with multiple members within a single line, but succeeds if they're split e.g.

import { memberA, memberB } from '../../shared/util/images'; // skipped
import {
	memberC,
	memberD,
	memberE,
} from '../../../shared/account/someUtil'; // updated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.