All Projects → bfncs → Codemod Imports Sort

bfncs / Codemod Imports Sort

Sort ES6 imports by type

Programming Languages

javascript
184084 projects - #8 most used programming language
esnext
17 projects

Labels

Projects that are alternatives of or similar to Codemod Imports Sort

importnb
notebook files as source
Stars: ✭ 47 (+62.07%)
Mutual labels:  import
Stack Overflow Import
Import arbitrary code from Stack Overflow as Python modules.
Stars: ✭ 3,480 (+11900%)
Mutual labels:  import
Blender Osm
One click download and import of OpenStreetMap and terrain for Blender! Global coverage! Source code is in the branch 'release'.
Stars: ✭ 588 (+1927.59%)
Mutual labels:  import
project-migration-tools
Project Migration tools to help you migrating to IAR Embedded Workbench more efficiently.
Stars: ✭ 36 (+24.14%)
Mutual labels:  import
Csvkeychain
Import/export between Apple Keychain.app and plain CSV file.
Stars: ✭ 281 (+868.97%)
Mutual labels:  import
Pass Import
A pass extension for importing data from most of the existing password manager.
Stars: ✭ 412 (+1320.69%)
Mutual labels:  import
mightyscape-1.X
A maintained extension collection for Inkscape 1.0+, working on Windows and Linux
Stars: ✭ 23 (-20.69%)
Mutual labels:  import
Row boat
Import CSVs into your ActiveRecord models
Stars: ✭ 12 (-58.62%)
Mutual labels:  import
Eslint Plugin Import
ESLint plugin with rules that help validate proper imports.
Stars: ✭ 3,722 (+12734.48%)
Mutual labels:  import
Lazy importer
library for importing functions from dlls in a hidden, reverse engineer unfriendly way
Stars: ✭ 544 (+1775.86%)
Mutual labels:  import
Shrimpit
Shrimpit 🍤 is a small CLI analysis tool for checking unused JavaScript, JSX & Vue templates ES6 exports in your project.
Stars: ✭ 255 (+779.31%)
Mutual labels:  import
Node Firestore Import Export
Firestore data import and export
Stars: ✭ 271 (+834.48%)
Mutual labels:  import
Style Resources Module
Nobody likes extra @import statements!
Stars: ✭ 485 (+1572.41%)
Mutual labels:  import
unimport
A linter, formatter for finding and removing unused import statements.
Stars: ✭ 119 (+310.34%)
Mutual labels:  import
Elasticsearch Dump
Import and export tools for elasticsearch
Stars: ✭ 5,977 (+20510.34%)
Mutual labels:  import
owl2neo4j
Convert OWL to labeled property graph and import into Neo4J
Stars: ✭ 42 (+44.83%)
Mutual labels:  import
Npoi.mapper
Use this tool to import or export data with Excel file. The tool is a convention based mapper between strong typed object and Excel data via NPOI.
Stars: ✭ 348 (+1100%)
Mutual labels:  import
Eslint Import Resolver Jest
🃏 Jest import resolution plugin for eslint-plugin-import
Stars: ✭ 29 (+0%)
Mutual labels:  import
Tslib
Runtime library for TypeScript helpers.
Stars: ✭ 762 (+2527.59%)
Mutual labels:  import
Simple Excel
Read and write simple Excel and CSV files
Stars: ✭ 502 (+1631.03%)
Mutual labels:  import

Build Status

CodeMod to sort ES6 imports by type

Use this codemod to sort ES6 imports by type in this order:

  • internal Node.js modules before
  • external module imports before
  • local imports from parent folders before
  • local imports from sibling folders.

Imports of the same type are sorted alphabetically.

Install

yarn global add codemod-imports-sort

Use

codemod-imports-sort path/to/file.js

Example

Before:

import './index.css';
import Beta from 'Beta';
import fs from 'fs';
import bar from '../bar';
import './';
import baz from './baz';
import Alpha from 'alpha';
import foo from '../../foo';
import App from './App';

After:

import fs from 'fs';
import Alpha from 'alpha';
import Beta from 'Beta';
import foo from '../../foo';
import bar from '../bar';
import './';
import App from './App';
import baz from './baz';
import './index.css';

Options

--sortConfig FILE.json

Optionally you can pass the path to a JSON file with a config to define the desired order of imports. The config should resemble the config for the import/order plugin of eslint. groups must be an array of string or [string]. The only allowed strings are: "builtin", "external", "scoped-external", "internal", "parent", "sibling", "index".

For example to define to sort index imports first, then internal and external modules in a alphabetically sorted group and then sibling, parent and builtin modules together in a group, use this configuration:

{
  "groups": [
    "index",
    ["internal", "external"],
    ["sibling", "parent", "builtin"]
  ]
}

Omitted types are implicitly grouped together as the last element

Built with jscodeshift.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].