Loading...
Loading...
Merge-friendly import formatting (one-per-line, alphabetical). Auto-loads when writing TypeScript/JavaScript imports to minimize merge conflicts in parallel development. Enforces consistent grouping and sorting.
npx skill4agent add jpoutrin/product-forge typescript-import-style// CORRECT - merge-friendly (each on separate line)
import {
alpha,
beta,
gamma,
} from 'some-module';
// WRONG - causes merge conflicts
import { alpha, beta, gamma } from 'some-module';printWidth: 80import fs from 'fs'import path from 'path'import React from 'react'import express from 'express'import { util } from '@/utils'import { Parent } from '../Parent'import { Sibling } from './Sibling'import { thing } from './index'import type { MyType } from './types'// Node.js built-ins
import fs from 'fs';
import path from 'path';
// External packages
import express from 'express';
import React from 'react';
// Internal aliases
import { config } from '@/config';
import { logger } from '@/utils';
// Parent imports
import { BaseService } from '../BaseService';
// Sibling imports (one per line when multiple)
import {
helperA,
helperB,
helperC,
} from './helpers';
import { utils } from './utils';
// Type imports (one per line when multiple)
import type { Config } from '@/types';
import type {
Request,
Response,
} from 'express';// CORRECT
export {
alpha,
beta,
gamma,
};
// WRONG
export { gamma, alpha, beta };printWidth: 80eslint --fix && prettier --write// .eslintrc.js or eslint.config.js
module.exports = {
plugins: ['simple-import-sort'],
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
};{
"printWidth": 80,
"singleQuote": true,
"trailingComma": "all"
}// CORRECT
export {
ComponentA,
ComponentB,
ComponentC,
} from './components';
export type {
TypeA,
TypeB,
} from './types';
// WRONG
export { ComponentA, ComponentB, ComponentC } from './components';// Alphabetical order by module path
const moduleA = await import('./moduleA');
const moduleB = await import('./moduleB');
const utils = await import('./utils');