• Packages
  • Themes
  • Documentation
  • Blog
  • Discuss
Sign in

javascript-refactor

JavaScript refactoring support for Atom
  • #refactor
  • #rename
  • #move
  • #javascript
  • #ide
jurassix
0.7.1 12,357
12
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

atom-javascript-refactor package

Build Status Coverage Status Dependency Status devDependency Status

Atom JavaScript ES6 Module and CommonJS refactoring support

atom-javascript-refactor simplifies ES6 Module and CommonJS refactoring, by allowing you to rename or move any file within your project and have all references updated automatically.

atom-javascript-refactor allows you to rename a file, and all referencing Modules will be updated with new path.

For example, given the following file:

src/animals.js

import cat from './meow';

Let's rename the file src/meow.js to src/kitten.js.

src/animals.js is transformed to

import cat from './kitten';

atom-javascript-refactor also updates all locally referenced Modules inside of the moved file.

For example, given the following files:

src/meow.js

import { RAINBOW } from '../constants';

src/animals.js

import cat from './meow';

Let's move the file src/meow.js to src/city-kitty/meow.js.

src/city-kitty/meow.js is transformed to

import { RAINBOW } from '../../constants';

src/animals.js is transformed to

import cat from './city-kitty/meow';

Usage

Using the TreeView, Right click on any .js file or directory to expose the Rename (with refactor support) option. Selecting this option will open a modal that will allow you to update the file name or path. Pressing Enter Key will apply the file rename/move and then run a codemod on the root folder.

Note: there currently is no support for Drag and Drop.

Install

apm i javascript-refactor

Develop

> cd atom-javascript-refactor
> npm i
> apm link

Contribute

  • Please open an issue before submitting a PR
  • All PR's should be accompanied wth tests :rocket:

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by