jakoblind / js-import Goto Github PK
View Code? Open in Web Editor NEWEmacs package to automatically import JavaScript files from the current project or dependencies.
Emacs package to automatically import JavaScript files from the current project or dependencies.
Have a file bar.js:
export const here = 1;
And foo.js:
here;
export class SomeClass {
_logfail (error) {
logger.error('Failed to import uploaded files', error);
}
_cancel () {
this._setImportingState(false);
clearUploaded(this._mapId)
.then(() => logger.debug(` for `))
.catch(error => logger.error('failed', error));
this._somethingElse();
}
}
Place the cursor on here;
and call C-u M-x js-import
. Select bar.js.
The import lands before this._somethingElse()
instead of at the top of the file;
If there's not a "dependencies" key on "package.json" json-import
breaks because it expects it to create a hash table. It should support projects without it.
It would be great to add support for "devDependencies" with a custom variable too.
Hi,
When I call
M-x js-import
I get
You are not in a project
Thank you!!
When there are imports as follows:
import {
IonButton,
IonContent,
} from '@ionic/react'
Importing IonGrid
for example produces the following result.
import {
IonButton,
IonContent,, IonGrid
} from '@ionic/react'
This causes an error. It would be useful if a trailing comma will be detected and no extra comma is added before the newly added import.
Currently if I have a filesystem layout like
src/foobar/
bar/bar.js
foo/foo.js
and I am in foo/foo.js, js-import adds imports relative to the current file, similar to this:
`import { foo } from '../bar/bar';
However we use:
`import { foo } from 'foobar/bar/bar';
I always fix that manually, but that’s annoying.
It would be great if I could define a project root (here src/
) — or even better if it could detect the root from a jsconfig.json or similar — and then have automatic imports from project-root.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.