Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@4c/import-sort

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@4c/import-sort

An [import-sort](https://github.com/renke/import-sort#import-sort) style config and custom parser for Javascript and Typescript (using babel).

  • 4.3.5
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

`@4c/import-sort

An import-sort style config and custom parser for Javascript and Typescript (using babel).

Install

yarn add -D @4c/import-sort

Configuration

In a package.json:

{
  "importSort": {
    ".js": {
      "style": "@4c/import-sort",
      "parser": "@4c/import-sort/parser"
    },
    ".ts, .tsx": {
      "style": "@4c/import-sort",
      "parser": "@4c/import-sort/parser-ts"
    }
  }
}

Style

Imports are sorted into three groups: third party code, local code, styles and assets

import fs from 'fs'; // Node core modules first
import pick from 'lodash/pick'; // third party deps
import Env from '@4c/env'; // scoped

import Foo from '../Foo'; // local, in shared.
import Bar from './Bar';
import Baz from './Baz';

import styles from 'styles.scss'; // style imports

FAQs

Package last updated on 05 Aug 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc