style(format): add prettier-plugin-sort-re-exports prettier plugin (#670)

* Apply plugin

* Run prettier
This commit is contained in:
Dayong Lee 2024-10-06 17:04:48 +09:00 committed by GitHub
parent 9edacf776f
commit df19ff14de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 155 additions and 134 deletions

View File

@ -45,6 +45,7 @@ export function keyBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromIte
return result;
}
```
</details>
### 1.3 Documentation

View File

@ -15,4 +15,12 @@ module.exports = {
importOrder: ['^vitest', '^es-toolkit', '<THIRD_PARTY_MODULES>', '^@(.*)$', '^[.]/', '^[.]{2,}/'],
importOrderSortSpecifiers: true,
importOrderCaseInsensitive: true,
overrides: [
{
files: 'src/**/index.ts',
options: {
plugins: [require.resolve('prettier-plugin-sort-re-exports')],
},
},
],
};

View File

@ -6,4 +6,4 @@
"clipanion": "npm:clipanion@^3.2.1",
"openai": "npm:openai@^4.58.1"
}
}
}

View File

@ -16,7 +16,7 @@ es-toolkitは、最先端のJavaScriptユーティリティライブラリであ
```tsx
// jsrでは '@es-toolkit/es-toolkit' からインポートします。
import { debounce, chunk } from 'es-toolkit';
import { chunk, debounce } from 'es-toolkit';
const debouncedLog = debounce(message => {
console.log(message);

View File

@ -16,7 +16,7 @@ es-toolkit 是一个先进的、高性能的 JavaScript 实用工具库,具有
```tsx
// import from '@es-toolkit/es-toolkit' in jsr.
import { debounce, chunk } from 'es-toolkit';
import { chunk, debounce } from 'es-toolkit';
const debouncedLog = debounce(message => {
console.log(message);

View File

@ -16,7 +16,7 @@ es-toolkit is a state-of-the-art, high-performance JavaScript utility library wi
```tsx
// import from '@es-toolkit/es-toolkit' in jsr.
import { debounce, chunk } from 'es-toolkit';
import { chunk, debounce } from 'es-toolkit';
const debouncedLog = debounce(message => {
console.log(message);

View File

@ -93,9 +93,7 @@
"some",
"sortBy"
],
"date": [
"now"
],
"date": ["now"],
"function": [
"after",
"ary",
@ -196,11 +194,7 @@
"sum",
"sumBy"
],
"number": [
"clamp",
"inRange",
"random"
],
"number": ["clamp", "inRange", "random"],
"object": [
"assign",
"assignIn",
@ -314,4 +308,4 @@
"toPath",
"uniqueId"
]
}
}

View File

@ -156,6 +156,7 @@
"globals": "^15.9.0",
"jscodeshift": "^17.0.0",
"prettier": "^3.2.5",
"prettier-plugin-sort-re-exports": "^0.0.1",
"rollup": "^4.19.0",
"rollup-plugin-dts": "^6.1.1",
"tar": "^6",
@ -168,6 +169,9 @@
"dependenciesMeta": {
"@trivago/prettier-plugin-sort-imports@4.3.0": {
"unplugged": true
},
"prettier-plugin-sort-re-exports@0.0.1": {
"unplugged": true
}
},
"sideEffects": false,

View File

@ -24,6 +24,7 @@
*/
export * from '../index.ts';
export { head as first } from '../array/head.ts';
export { castArray } from './array/castArray.ts';
export { chunk } from './array/chunk.ts';
export { concat } from './array/concat.ts';
@ -32,6 +33,7 @@ export { drop } from './array/drop.ts';
export { dropWhile } from './array/dropWhile.ts';
export { every } from './array/every.ts';
export { fill } from './array/fill.ts';
export { filter } from './array/filter.ts';
export { find } from './array/find.ts';
export { findIndex } from './array/findIndex.ts';
export { findLastIndex } from './array/findLastIndex.ts';
@ -42,111 +44,109 @@ export { includes } from './array/includes.ts';
export { indexOf } from './array/indexOf.ts';
export { join } from './array/join.ts';
export { orderBy } from './array/orderBy.ts';
export { sortBy } from './array/sortBy.ts';
export { size } from './array/size.ts';
export { some } from './array/some.ts';
export { sortBy } from './array/sortBy.ts';
export { take } from './array/take.ts';
export { zipObjectDeep } from './array/zipObjectDeep.ts';
export { filter } from './array/filter.ts';
export { head as first } from '../array/head.ts';
export { ary } from './function/ary.ts';
export { bind } from './function/bind.ts';
export { before } from './function/before.ts';
export { bindKey } from './function/bindKey.ts';
export { defer } from './function/defer.ts';
export { rest } from './function/rest.ts';
export { spread } from './function/spread.ts';
export { attempt } from './function/attempt.ts';
export { rearg } from './function/rearg.ts';
export { before } from './function/before.ts';
export { bind } from './function/bind.ts';
export { bindKey } from './function/bindKey.ts';
export { curry } from './function/curry.ts';
export { curryRight } from './function/curryRight.ts';
export { debounce } from './function/debounce.ts';
export { throttle } from './function/throttle.ts';
export { defer } from './function/defer.ts';
export { flip } from './function/flip.ts';
export { flow } from './function/flow.ts';
export { flowRight } from './function/flowRight.ts';
export { rearg } from './function/rearg.ts';
export { rest } from './function/rest.ts';
export { spread } from './function/spread.ts';
export { throttle } from './function/throttle.ts';
export { ceil } from './math/ceil.ts';
export { clamp } from './math/clamp.ts';
export { floor } from './math/floor.ts';
export { inRange } from './math/inRange.ts';
export { max } from './math/max.ts';
export { min } from './math/min.ts';
export { parseInt } from './math/parseInt.ts';
export { random } from './math/random.ts';
export { round } from './math/round.ts';
export { cloneDeep } from './object/cloneDeep.ts';
export { defaults } from './object/defaults.ts';
export { fromPairs } from './object/fromPairs.ts';
export { get } from './object/get.ts';
export { set } from './object/set.ts';
export { pick } from './object/pick.ts';
export { omit } from './object/omit.ts';
export { has } from './object/has.ts';
export { property } from './object/property.ts';
export { invertBy } from './object/invertBy.ts';
export { mapKeys } from './object/mapKeys.ts';
export { mapValues } from './object/mapValues.ts';
export { merge } from './object/merge.ts';
export { mergeWith } from './object/mergeWith.ts';
export { fromPairs } from './object/fromPairs.ts';
export { unset } from './object/unset.ts';
export { cloneDeep } from './object/cloneDeep.ts';
export { invertBy } from './object/invertBy.ts';
export { defaults } from './object/defaults.ts';
export { omit } from './object/omit.ts';
export { pick } from './object/pick.ts';
export { property } from './object/property.ts';
export { set } from './object/set.ts';
export { toDefaulted } from './object/toDefaulted.ts';
export { unset } from './object/unset.ts';
export { isPlainObject } from './predicate/isPlainObject.ts';
export { isArray } from './predicate/isArray.ts';
export { isArguments } from './predicate/isArguments.ts';
export { isArrayBuffer } from './predicate/isArrayBuffer.ts';
export { isArrayLike } from './predicate/isArrayLike.ts';
export { isSymbol } from './predicate/isSymbol.ts';
export { isObject } from './predicate/isObject.ts';
export { isObjectLike } from './predicate/isObjectLike.ts';
export { isBoolean } from './predicate/isBoolean.ts';
export { isError } from './predicate/isError.ts';
export { isFinite } from './predicate/isFinite.ts';
export { isTypedArray } from './predicate/isTypedArray.ts';
export { isMatch } from './predicate/isMatch.ts';
export { isMap } from './predicate/isMap.ts';
export { isSet } from './predicate/isSet.ts';
export { isRegExp } from './predicate/isRegExp.ts';
export { isString } from './predicate/isString.ts';
export { matches } from './predicate/matches.ts';
export { matchesProperty } from './predicate/matchesProperty.ts';
export { isWeakMap } from './predicate/isWeakMap.ts';
export { isWeakSet } from './predicate/isWeakSet.ts';
export { conforms } from './predicate/conforms.ts';
export { conformsTo } from './predicate/conformsTo.ts';
export { isInteger } from './predicate/isInteger.ts';
export { isSafeInteger } from './predicate/isSafeInteger.ts';
export { isNumber } from './predicate/isNumber.ts';
export { isNaN } from './predicate/isNaN.ts';
export { isArguments } from './predicate/isArguments.ts';
export { isArray } from './predicate/isArray.ts';
export { isArrayBuffer } from './predicate/isArrayBuffer.ts';
export { isArrayLike } from './predicate/isArrayLike.ts';
export { isArrayLikeObject } from './predicate/isArrayLikeObject.ts';
export { isNil } from './predicate/isNil.ts';
export { isBoolean } from './predicate/isBoolean.ts';
export { isEqualWith } from './predicate/isEqualWith.ts';
export { isError } from './predicate/isError.ts';
export { isFinite } from './predicate/isFinite.ts';
export { isInteger } from './predicate/isInteger.ts';
export { isMap } from './predicate/isMap.ts';
export { isMatch } from './predicate/isMatch.ts';
export { isNaN } from './predicate/isNaN.ts';
export { isNil } from './predicate/isNil.ts';
export { isNumber } from './predicate/isNumber.ts';
export { isObject } from './predicate/isObject.ts';
export { isObjectLike } from './predicate/isObjectLike.ts';
export { isPlainObject } from './predicate/isPlainObject.ts';
export { isRegExp } from './predicate/isRegExp.ts';
export { isSafeInteger } from './predicate/isSafeInteger.ts';
export { isSet } from './predicate/isSet.ts';
export { isString } from './predicate/isString.ts';
export { isSymbol } from './predicate/isSymbol.ts';
export { isTypedArray } from './predicate/isTypedArray.ts';
export { isWeakMap } from './predicate/isWeakMap.ts';
export { isWeakSet } from './predicate/isWeakSet.ts';
export { matches } from './predicate/matches.ts';
export { matchesProperty } from './predicate/matchesProperty.ts';
export { camelCase } from './string/camelCase.ts';
export { endsWith } from './string/endsWith.ts';
export { kebabCase } from './string/kebabCase.ts';
export { lowerCase } from './string/lowerCase.ts';
export { pad } from './string/pad.ts';
export { padEnd } from './string/padEnd.ts';
export { padStart } from './string/padStart.ts';
export { repeat } from './string/repeat.ts';
export { snakeCase } from './string/snakeCase.ts';
export { startCase } from './string/startCase.ts';
export { lowerCase } from './string/lowerCase.ts';
export { upperCase } from './string/upperCase.ts';
export { startsWith } from './string/startsWith.ts';
export { endsWith } from './string/endsWith.ts';
export { pad } from './string/pad.ts';
export { padStart } from './string/padStart.ts';
export { padEnd } from './string/padEnd.ts';
export { repeat } from './string/repeat.ts';
export { upperCase } from './string/upperCase.ts';
export { trim } from './string/trim.ts';
export { trimStart } from './string/trimStart.ts';
export { trimEnd } from './string/trimEnd.ts';
export { clamp } from './math/clamp.ts';
export { max } from './math/max.ts';
export { min } from './math/min.ts';
export { ceil } from './math/ceil.ts';
export { floor } from './math/floor.ts';
export { round } from './math/round.ts';
export { parseInt } from './math/parseInt.ts';
export { inRange } from './math/inRange.ts';
export { random } from './math/random.ts';
export { trimStart } from './string/trimStart.ts';
export { constant } from './util/constant.ts';
export { toPath } from './util/toPath.ts';
export { toString } from './util/toString.ts';
export { toNumber } from './util/toNumber.ts';
export { toInteger } from './util/toInteger.ts';
export { toFinite } from './util/toFinite.ts';
export { eq } from './util/eq.ts';
export { times } from './util/times.ts';
export { toFinite } from './util/toFinite.ts';
export { toInteger } from './util/toInteger.ts';
export { toNumber } from './util/toNumber.ts';
export { toPath } from './util/toPath.ts';
export { toString } from './util/toString.ts';

View File

@ -4,8 +4,8 @@ export { mean } from './mean.ts';
export { meanBy } from './meanBy.ts';
export { random } from './random.ts';
export { randomInt } from './randomInt.ts';
export { range } from './range.ts';
export { rangeRight } from './rangeRight.ts';
export { round } from './round.ts';
export { sum } from './sum.ts';
export { sumBy } from './sumBy.ts';
export { range } from './range.ts';
export { rangeRight } from './rangeRight.ts';

View File

@ -1,13 +1,13 @@
export { clone } from './clone.ts';
export { cloneDeep } from './cloneDeep.ts';
export { flattenObject } from './flattenObject.ts';
export { invert } from './invert.ts';
export { mapKeys } from './mapKeys.ts';
export { mapValues } from './mapValues.ts';
export { merge } from './merge.ts';
export { mergeWith } from './mergeWith.ts';
export { omit } from './omit.ts';
export { omitBy } from './omitBy.ts';
export { pick } from './pick.ts';
export { pickBy } from './pickBy.ts';
export { invert } from './invert.ts';
export { clone } from './clone.ts';
export { flattenObject } from './flattenObject.ts';
export { mapKeys } from './mapKeys.ts';
export { mapValues } from './mapValues.ts';
export { cloneDeep } from './cloneDeep.ts';
export { merge } from './merge.ts';
export { toMerged } from './toMerged.ts';
export { mergeWith } from './mergeWith.ts';

View File

@ -1,26 +1,26 @@
export { isArrayBuffer } from './isArrayBuffer.ts';
export { isBlob } from './isBlob.ts';
export { isBoolean } from './isBoolean.ts';
export { isDate } from './isDate.ts';
export { isEqual } from './isEqual.ts';
export { isEqualWith } from './isEqualWith.ts';
export { isError } from './isError.ts';
export { isFunction } from './isFunction.ts';
export { isJSONArray } from './isJSONArray.ts';
export { isJSONObject } from './isJSONObject.ts';
export { isJSONValue } from './isJSONValue.ts';
export { isLength } from './isLength.ts';
export { isMap } from './isMap.ts';
export { isNil } from './isNil.ts';
export { isNotNil } from './isNotNil.ts';
export { isNull } from './isNull.ts';
export { isUndefined } from './isUndefined.ts';
export { isLength } from './isLength.ts';
export { isPlainObject } from './isPlainObject.ts';
export { isFunction } from './isFunction.ts';
export { isTypedArray } from './isTypedArray.ts';
export { isPrimitive } from './isPrimitive.ts';
export { isRegExp } from './isRegExp.ts';
export { isBoolean } from './isBoolean.ts';
export { isSymbol } from './isSymbol.ts';
export { isString } from './isString.ts';
export { isJSONObject } from './isJSONObject.ts';
export { isJSONValue } from './isJSONValue.ts';
export { isJSONArray } from './isJSONArray.ts';
export { isSet } from './isSet.ts';
export { isString } from './isString.ts';
export { isSymbol } from './isSymbol.ts';
export { isTypedArray } from './isTypedArray.ts';
export { isUndefined } from './isUndefined.ts';
export { isWeakMap } from './isWeakMap.ts';
export { isWeakSet } from './isWeakSet.ts';

View File

@ -1,3 +1,3 @@
export { delay } from './delay.ts';
export { withTimeout } from './withTimeout.ts';
export { timeout } from './timeout.ts';
export { withTimeout } from './withTimeout.ts';

View File

@ -1,19 +1,19 @@
export { camelCase } from './camelCase.ts';
export { snakeCase } from './snakeCase.ts';
export { kebabCase } from './kebabCase.ts';
export { upperCase } from './upperCase.ts';
export { lowerCase } from './lowerCase.ts';
export { startCase } from './startCase.ts';
export { capitalize } from './capitalize.ts';
export { pascalCase } from './pascalCase.ts';
export { constantCase } from './constantCase.ts';
export { trim } from './trim.ts';
export { trimStart } from './trimStart.ts';
export { trimEnd } from './trimEnd.ts';
export { upperFirst } from './upperFirst.ts';
export { lowerFirst } from './lowerFirst.ts';
export { deburr } from './deburr.ts';
export { escape } from './escape.ts';
export { escapeRegExp } from './escapeRegExp.ts';
export { unescape } from './unescape.ts';
export { kebabCase } from './kebabCase.ts';
export { lowerCase } from './lowerCase.ts';
export { lowerFirst } from './lowerFirst.ts';
export { pad } from './pad.ts';
export { pascalCase } from './pascalCase.ts';
export { snakeCase } from './snakeCase.ts';
export { startCase } from './startCase.ts';
export { trim } from './trim.ts';
export { trimEnd } from './trimEnd.ts';
export { trimStart } from './trimStart.ts';
export { unescape } from './unescape.ts';
export { upperCase } from './upperCase.ts';
export { upperFirst } from './upperFirst.ts';

View File

@ -476,17 +476,17 @@ __metadata:
languageName: node
linkType: hard
"@babel/helper-string-parser@npm:^7.24.8":
version: 7.24.8
resolution: "@babel/helper-string-parser@npm:7.24.8"
checksum: 10c0/6361f72076c17fabf305e252bf6d580106429014b3ab3c1f5c4eb3e6d465536ea6b670cc0e9a637a77a9ad40454d3e41361a2909e70e305116a23d68ce094c08
"@babel/helper-string-parser@npm:^7.25.7":
version: 7.25.7
resolution: "@babel/helper-string-parser@npm:7.25.7"
checksum: 10c0/73ef2ceb81f8294678a0afe8ab0103729c0370cac2e830e0d5128b03be5f6a2635838af31d391d763e3c5a4460ed96f42fd7c9b552130670d525be665913bc4c
languageName: node
linkType: hard
"@babel/helper-validator-identifier@npm:^7.16.7, @babel/helper-validator-identifier@npm:^7.24.7":
version: 7.24.7
resolution: "@babel/helper-validator-identifier@npm:7.24.7"
checksum: 10c0/87ad608694c9477814093ed5b5c080c2e06d44cb1924ae8320474a74415241223cc2a725eea2640dd783ff1e3390e5f95eede978bc540e870053152e58f1d651
"@babel/helper-validator-identifier@npm:^7.16.7, @babel/helper-validator-identifier@npm:^7.24.7, @babel/helper-validator-identifier@npm:^7.25.7":
version: 7.25.7
resolution: "@babel/helper-validator-identifier@npm:7.25.7"
checksum: 10c0/07438e5bf01ab2882a15027fdf39ac3b0ba1b251774a5130917907014684e2f70fef8fd620137ca062c4c4eedc388508d2ea7a3a7d9936a32785f4fe116c68c0
languageName: node
linkType: hard
@ -519,14 +519,14 @@ __metadata:
languageName: node
linkType: hard
"@babel/parser@npm:^7.20.5, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.7, @babel/parser@npm:^7.25.0, @babel/parser@npm:^7.25.3, @babel/parser@npm:^7.25.4, @babel/parser@npm:^7.25.6":
version: 7.25.6
resolution: "@babel/parser@npm:7.25.6"
"@babel/parser@npm:^7.20.5, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.7, @babel/parser@npm:^7.25.0, @babel/parser@npm:^7.25.3, @babel/parser@npm:^7.25.4, @babel/parser@npm:^7.25.6, @babel/parser@npm:^7.25.7":
version: 7.25.7
resolution: "@babel/parser@npm:7.25.7"
dependencies:
"@babel/types": "npm:^7.25.6"
"@babel/types": "npm:^7.25.7"
bin:
parser: ./bin/babel-parser.js
checksum: 10c0/f88a0e895dbb096fd37c4527ea97d12b5fc013720602580a941ac3a339698872f0c911e318c292b184c36b5fbe23b612f05aff9d24071bc847c7b1c21552c41d
checksum: 10c0/b771469bb6b636c18a8d642b9df3c73913c3860a979591e1a29a98659efd38b81d3e393047b5251fe382d4c82c681c12da9ce91c98d69316d2604d155a214bcf
languageName: node
linkType: hard
@ -780,14 +780,14 @@ __metadata:
languageName: node
linkType: hard
"@babel/types@npm:^7.17.0, @babel/types@npm:^7.23.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.24.8, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.25.4, @babel/types@npm:^7.25.6":
version: 7.25.6
resolution: "@babel/types@npm:7.25.6"
"@babel/types@npm:^7.17.0, @babel/types@npm:^7.23.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.24.8, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.25.4, @babel/types@npm:^7.25.6, @babel/types@npm:^7.25.7":
version: 7.25.7
resolution: "@babel/types@npm:7.25.7"
dependencies:
"@babel/helper-string-parser": "npm:^7.24.8"
"@babel/helper-validator-identifier": "npm:^7.24.7"
"@babel/helper-string-parser": "npm:^7.25.7"
"@babel/helper-validator-identifier": "npm:^7.25.7"
to-fast-properties: "npm:^2.0.0"
checksum: 10c0/89d45fbee24e27a05dca2d08300a26b905bd384a480448823f6723c72d3a30327c517476389b7280ce8cb9a2c48ef8f47da7f9f6d326faf6f53fd6b68237bdc4
checksum: 10c0/e03e1e2e08600fa1e8eb90632ac9c253dd748176c8d670d85f85b0dc83a0573b26ae748a1cbcb81f401903a3d95f43c3f4f8d516a5ed779929db27de56289633
languageName: node
linkType: hard
@ -4545,6 +4545,7 @@ __metadata:
globals: "npm:^15.9.0"
jscodeshift: "npm:^17.0.0"
prettier: "npm:^3.2.5"
prettier-plugin-sort-re-exports: "npm:^0.0.1"
rollup: "npm:^4.19.0"
rollup-plugin-dts: "npm:^6.1.1"
tar: "npm:^6"
@ -4556,6 +4557,8 @@ __metadata:
dependenciesMeta:
"@trivago/prettier-plugin-sort-imports@4.3.0":
unplugged: true
prettier-plugin-sort-re-exports@0.0.1:
unplugged: true
languageName: unknown
linkType: soft
@ -7693,6 +7696,17 @@ __metadata:
languageName: node
linkType: hard
"prettier-plugin-sort-re-exports@npm:^0.0.1":
version: 0.0.1
resolution: "prettier-plugin-sort-re-exports@npm:0.0.1"
dependencies:
"@babel/parser": "npm:^7.25.7"
peerDependencies:
prettier: ^3
checksum: 10c0/993d828f205a7d500aad83d517ac854d748299c26ac229db6ec464849864fe46d46cf8c730d803f28b2f3f0c62f5821bbbab16a6acd4a4a9bf631d85af08b252
languageName: node
linkType: hard
"prettier@npm:^2.7.1":
version: 2.8.8
resolution: "prettier@npm:2.8.8"