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

@supernotes/import-sort-style

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@supernotes/import-sort-style

Supernotes' custom style for import-sort (cares about react, relativity, components, etc)

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

import-sort-style-supernotes

An import-sort style that is tailored to how Supernotes likes to sort imports for its React apps. The major difference between this sort style and others based around React is that import-sort-style-supernotes will sort first-party component modules last in order (immediately after non-component modules).

// absolute modules w/ side effects – unsorted because order can be important
import "a";
import "c";
import "b";

// relative modules w/ side effects – unsorted because order can be important
import "./a";
import "./c";
import "./b";

// react and react-ecosystem modules (react, prop-types, redux, etc) – sorted by name
import React from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";

// node.js modules – sorted by name
import {readFile, writeFile} from "fs";
import * as path from "path";

// third-party modules – sorted by name
import aa from "aa";
import {bba, bbb, bbc} from "bb";
import cc from "cc";

// first-party modules with absolute paths that *are not* components – sorted by name
import aaa from 'aaa/xxx';
import bbb from 'bbb/foo/bar';

// first-party modules with absolute paths *are* components – sorted by name
import aaa from 'components/xxx';
import bbb from 'bbb/foo/bar';

// first-party modules sorted by "relative depth" and then by name
import aaa from "../../aaa";
import bbb from "../../bbb";
import aaaa from "../aaaa";
import bbbb from "../bbbb";
import aaaaa from "./aaaaa";
import bbbbb from "./bbbbb";

// first-party styles modules sorted by "relative depth" and then by name
import styles from "./Component.css";

FAQs

Package last updated on 07 Jul 2022

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