serverless-guru / prettier-import-order Goto Github PK
View Code? Open in Web Editor NEWA prettier plugin to sort TS/JS import declarations by provided Regular Expression order.
License: Apache License 2.0
A prettier plugin to sort TS/JS import declarations by provided Regular Expression order.
License: Apache License 2.0
Love this fork. Would be awesome to allow specifying top or bottom for placement of type imports though. Ours are traditionally at the bottom of the file so having the option to customize placement would be great.
Is your feature request related to a problem?
I would like to be able to use JSDoc
type information at .prettierrc.js
for better IDE support (auto completion etc.).
Describe the solution you'd like
Could you please add TypeScript typings to the npm release? You already have a types.ts
file.
Example:
/**
* @type {import('@serverless-guru/prettier-plugin-import-order').PrettierOptions}
*/
module.exports = {
useTabs: false,
semi: true,
singleQuote: true,
trailingComma: 'none',
bracketSpacing: true,
arrowParens: 'always',
importOrder: [
'^dotenv(.*)$',
'<THIRD_PARTY_MODULES>',
'^@aws-sdk/(.*)$',
'^[./]'
],
importOrderSortIndividualImports: true,
importOrderMergeDuplicateImports: true,
importOrderSeparation: true,
importOrderSortSpecifiers: true
};
Describe alternatives you've considered
Currently I am using the official types of prettier
which are missing importOrder
and so on.
/**
* @type {import('prettier').Options}
*/
module.exports = {
useTabs: false,
semi: true,
singleQuote: true,
trailingComma: 'none',
bracketSpacing: true,
arrowParens: 'always',
importOrder: [
'^dotenv(.*)$',
'<THIRD_PARTY_MODULES>',
'^@aws-sdk/(.*)$',
'^[./]'
],
importOrderSortIndividualImports: true,
importOrderMergeDuplicateImports: true,
importOrderSeparation: true,
importOrderSortSpecifiers: true
};
Additional context
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.