Giter Club home page Giter Club logo

codemod-imports-sort's Issues

Moves comment line

Nice tool! One issue: I use flow, so there's a /* @flow */ comment in the 1st line of source files.

Before:

/* @flow */
import calcDropTargetClass from "../common/calcDropTargetClass";
import classNames from "classnames";
import dropSourceInTarget from "../StandardShow/dropSourceInTarget";
import { DropTarget } from "react-dnd";
import React from "react";
import SearchTypes from "../../constants/SearchTypes";

After:

import classNames from "classnames";
import React from "react";
import { DropTarget } from "react-dnd";
import SearchTypes from "../../constants/SearchTypes";
/* @flow */
import calcDropTargetClass from "../common/calcDropTargetClass";
import dropSourceInTarget from "../StandardShow/dropSourceInTarget";

Looks like it's keeping comments above their following import, but moving the comment messes things up. Maybe special-case and keep /* flow */ at top?

Error: Cannot find module '../utils/requirePackage'

โžœ  project git:(sort-imports) codemod-imports-sort --version
module.js:471
    throw err;
    ^

Error: Cannot find module '../utils/requirePackage'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.callback (/Users/fspiridonov/.nvm/versions/node/v6.10.0/lib/node_modules/codemod-imports-sort/bin/codemod-imports-sort:82:32)
    at Object.ArgParser.setOption (/Users/fspiridonov/.nvm/versions/node/v6.10.0/lib/node_modules/codemod-imports-sort/node_modules/nomnom/nomnom.js:447:26)
    at /Users/fspiridonov/.nvm/versions/node/v6.10.0/lib/node_modules/codemod-imports-sort/node_modules/nomnom/nomnom.js:274:14
    at Array.reduce (native)
    at Object.parse (/Users/fspiridonov/.nvm/versions/node/v6.10.0/lib/node_modules/codemod-imports-sort/node_modules/nomnom/nomnom.js:223:10)
    at Object.<anonymous> (/Users/fspiridonov/.nvm/versions/node/v6.10.0/lib/node_modules/codemod-imports-sort/bin/codemod-imports-sort:93:4)

In here: https://github.com/bfncs/codemod-imports-sort/blob/master/bin/codemod-imports-sort#L82

Should it be

const requirePackage = require('jscodeshift/utils/requirePackage');

?

Errors on running

Hi,
First, when I installed it I had this error on running

ERROR Transform file /home/julien/Sites/theRepo/dist/index.js does not exist

I created the missing file, and when rerun ;

ERR app/components/Nav/components/LeftMenuList/LeftMenuList.js Transformation error
TypeError: transform is not a function
All done. 
Results: 
1 errors
0 unmodified
0 skipped
0 ok

Could you help me please on this issue ?

Thank you !

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.