![From Academia to Industry](https://cdn.sanity.io/images/cgdhsj6q/production/70501690bf807891573e259da9719cf24302c7e3-4288x2848.jpg?w=400&fit=max&auto=format)
Employee Spotlight
From Academia to Industry
Philipp Burckhardt recounts his journey from childhood computer fascinations, to building an e-learning platform at Carnegie Mellon University, and on to his current role at Socket.
prettier-plugin-import-sort
Advanced tools
Prettier plugin to pass javascript and typescript through import-sort
Readme
This is Prettier plugin to sort imports using import-sort for javascript and typescript files.
$ npm i -D prettier prettier-plugin-import-sort
You will also want to install an import sort style module of your choice, such as:
$ npm i -D import-sort-style-module
You will then need the configuration for import-sorts available, e.g. something like this in package.json
"importSort": {
".js, .jsx, .ts, .tsx": {
"style": "module"
}
}
If you are using typescript, you may also need to specify the typescript parser. This is somewhat dependant upon the typescript features used (decorators for instance), e.g.
"importSort": {
".js, .jsx, .ts, .tsx": {
"style": "module",
"parser": "typescript"
}
}
Note: importSort silently falls back to its default configuration if it finds a setup error. Make sure that the extension list is like the example above and not something like "*.js"
which is an error.
A large part of this code was copied from import-sort-cli.
FAQs
Prettier plugin to pass javascript and typescript through import-sort
The npm package prettier-plugin-import-sort receives a total of 33,832 weekly downloads. As such, prettier-plugin-import-sort popularity was classified as popular.
We found that prettier-plugin-import-sort demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Employee Spotlight
Philipp Burckhardt recounts his journey from childhood computer fascinations, to building an e-learning platform at Carnegie Mellon University, and on to his current role at Socket.
Security News
Git dependencies in open source packages can introduce significant risks, including lack of version control, stability issues, dependency drift, and difficulty in auditing, making them potential targets for supply chain attacks.
Security News
Node.js has added experimental support for TypeScript, a move that highlights the growing importance of TypeScript in modern development.