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

import-sort-style-retino

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

import-sort-style-retino

Retino import-sort style

  • 7.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by500%
Maintainers
1
Weekly downloads
 
Created
Source

import-sort-style-retino

Retino style for import-sort.

Credits

This style is just a fork of import-sort-style-wes.

Sorting Example

// Modules that start with 'react'
import React from 'react';
import ReactDom from 'react-dom';
// Other Modules
import _, {...} from 'first-module';
import _, {...} from 'second-module';

// Modules inclued in RETINO_OUR_MODULES_NAMES in .env
import localModule from 'localModule';

// Siblings and parents
import things from '../grand-parent';
import name from '../parent';
import sibling from './sibling';

// Imports without members
import "style.css"

Usage

These instrutions use prettier, which is my preferred method of enforcing import sort order.

# Install prettier-plugin-import-sort
yarn add -D prettier-plugin-import-sort

# Install import-sort-style-retino
yarn add -D import-sort-style-retino

Then add on your root package.json:

{
  "importSort": {
    ".js, .jsx": {
      "parser": "babylon",
      "style": "retino"
    },
    ".ts, .tsx": {
      "parser": "typescript",
      "style": "retino"
    }
  }
}

Config

Use .import-sort-style-retino-config file. Used variables:

RETINO_OUR_MODULES_NAMES selects which modules should be threated as a local modules (and appear in the second group)

Development

I've used yarn, and tsdx, which provides scaffolding for TypeScript libraries.

# Install yarn, if you don't have it
curl -o- -L https://yarnpkg.com/install.sh | bash

# Install dependencies
yarn install

# Build upon changes (development mode)
yarn run dev

# Lint code
yarn run lint

# Test code
yarn run test

# Build code
yarn run build

License

MIT, https://wes.dev/LICENSE.txt

Keywords

FAQs

Package last updated on 07 May 2020

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