@yunarch/config-web 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{FlatConfigComposer as Q}from"eslint-flat-config-utils";import C from"globals";import{default as v}from"@eslint/js";import{default as d}from"@vitest/eslint-plugin";import{default as j}from"eslint-config-prettier";import{default as b}from"eslint-plugin-import-x";import{default as f}from"eslint-plugin-jsdoc";import{default as k}from"eslint-plugin-oxlint";import{default as S}from"eslint-plugin-perfectionist";import{default as w}from"eslint-plugin-unicorn";import{default as I}from"eslint-plugin-unused-imports";import{default as m}from"typescript-eslint";var J=["**/node_modules/","**/dist/","**/out/","**/output","**/.output","**/build/","**/*.min.*","**/package-lock.json","**/yarn.lock","**/.yarn/","**/.yarnrc.yml","**/.pnp.*","**/.pnp","**/.pnp.js","**/.pnp.cjs","**/bun.lock","**/bun.lockb","**/pnpm-lock.yaml","**/.vite-inspect","**/.vitepress/cache","**/vite.config.*.timestamp-*","**/*.log","**/npm-debug.log*","**/yarn-debug.log*","**/yarn-error.log*","**/coverage/","**/.nyc_output/","**/__snapshots__","**/.vscode/","**/.idea/","**/.cache","**/.nuxt","**/.next","**/.svelte-kit","**/.vercel","**/.changeset","**/.turbo/","**/.DS_Store","**/Thumbs.db","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/mockServiceWorker.js","**/CHANGELOG*","**/LICENSE*"];function _(e={},r,t){let o=e.linterOptions??{};return[{name:"yunarch/base/ignores",ignores:[...J,...r??[]]},{name:"yunarch/base/setup",languageOptions:{ecmaVersion:2022,globals:{...C.browser,...C.es2021,...C.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{...o,reportUnusedDisableDirectives:t?!1:o.reportUnusedDisableDirectives??!0}},{name:"yunarch/base/rules",plugins:{"unused-imports":I},rules:{...v.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"block-scoped-var":"error",camelcase:["error",{allow:["^UNSAFE_"],ignoreDestructuring:!1,properties:"never"}],curly:["error","multi-line","consistent"],"default-case-last":"error",eqeqeq:"error","func-names":["error","as-needed"],"grouped-accessor-pairs":"error","max-lines":["warn",300],"max-params":["warn",4],"new-cap":["error",{capIsNew:!1}],"no-alert":"error","no-array-constructor":"error","no-bitwise":"error","no-caller":"error","no-console":"error","no-constant-binary-expression":"error","no-constructor-return":"error","no-else-return":"warn","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-implicit-coercion":["error",{allow:["!!","+"]}],"no-implied-eval":"error","no-iterator":"error","no-label-var":"error","no-labels":"error","no-lone-blocks":"error","no-lonely-if":"warn","no-multi-assign":"error","no-nested-ternary":"error","no-new":"error","no-new-func":"error","no-new-wrappers":"error","no-octal-escape":"error","no-param-reassign":"error","no-promise-executor-return":"error","no-proto":"error","no-return-assign":"error","no-script-url":"error","no-self-compare":"error","no-sequences":"error","no-template-curly-in-string":"error","no-undef-init":"warn","no-unneeded-ternary":"error","no-unreachable-loop":"error","no-unused-expressions":"error","no-unused-vars":["error",{args:"none",caughtErrors:"none",ignoreRestSiblings:!0,vars:"all"}],"no-useless-call":"error","no-useless-computed-key":"warn","no-useless-concat":"error","no-useless-rename":"warn","no-useless-return":"warn","no-var":"error","no-void":["error",{allowAsStatement:!0}],"object-shorthand":"warn","prefer-const":"warn","prefer-named-capture-group":"error","prefer-numeric-literals":"error","prefer-object-has-own":"error","prefer-object-spread":"warn","prefer-promise-reject-errors":["error",{allowEmptyReject:!0}],"prefer-regex-literals":"error","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"warn","symbol-description":"error","unused-imports/no-unused-imports":"error","unused-imports/no-unused-vars":["error",{args:"after-used",argsIgnorePattern:"^_",ignoreRestSiblings:!0,vars:"all",varsIgnorePattern:"^_"}],yoda:"warn"}}]}var y="**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}",p="{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}",F="**/*.d.{ts,cts,mts}",c="**/*.{ts,cts,mts}",u="**/*.{tsx,ctsx,mtsx}",x="**/*.astro/*.ts",h="**/*.md",E=[`**/__tests__/**/*.${p}`,`**/*.spec.${p}`,`**/*.test.${p}`,`**/*.bench.${p}`,`**/*.benchmark.${p}`];function G(e){let{oxlint:r}=e;return[{name:"yunarch/disables/cli",files:[`**/scripts/${y}`,`**/tasks/${y}`,`**/bin/${y}`,`**/bin.${p}`,`**/cli/${y}`,`**/cli.${p}`],rules:{"@typescript-eslint/no-floating-promises":"off","no-console":"off","unicorn/no-process-exit":"off"}},{name:"yunarch/disables/dts",files:[F],rules:{"@typescript-eslint/consistent-indexed-object-style":"off","import/no-duplicates":"off","no-restricted-syntax":"off","unused-imports/no-unused-vars":"off"}},{name:"yunarch/disables/config-files",files:[`**/*.config.${p}`,`**/*.config.*.${p}`],rules:{"no-console":"off","@typescript-eslint/explicit-function-return-type":"off"}},{name:"yunarch/disables/prettier",rules:{...j.rules}},...r?.oxlintConfigPath?k.buildFromOxlintConfigFile(r.oxlintConfigPath):[]]}import{createTypeScriptImportResolver as K}from"eslint-import-resolver-typescript";import{createNodeResolver as M}from"eslint-plugin-import-x";function P(){return[{name:"yunarch/import/rules",plugins:{import:b},rules:{...b.flatConfigs.recommended.rules,"import/first":"error","import/newline-after-import":["error",{count:1}],"import/no-absolute-path":"error","import/no-amd":"error","import/no-cycle":["error",{ignoreExternal:!1,maxDepth:3}],"import/no-duplicates":["error",{"prefer-inline":!0}],"import/no-dynamic-require":"error","import/no-mutable-exports":"error","import/no-relative-packages":"error","import/no-self-import":"error","import/no-useless-path-segments":"error"},settings:{"import-x/resolver-next":[M()]}},{name:"yunarch/import/typescript/rules",files:[c,u],rules:{...b.flatConfigs.typescript.rules},settings:{"import-x/resolver-next":[K()]}}]}function R(){return[{name:"yunarch/jsdoc/rules",plugins:{jsdoc:f},rules:{...f.configs["flat/recommended-error"].rules,"jsdoc/check-param-names":["error",{checkDestructured:!1}],"jsdoc/lines-before-block":["error",{lines:0}],"jsdoc/require-hyphen-before-param-description":["error","always"],"jsdoc/require-param":["error",{checkDestructured:!1,enableRestElementFixer:!1}],"jsdoc/require-throws":"error","jsdoc/tag-lines":["error","any",{startLines:1}]}},{name:"yunarch/jsdoc/typescript/rules",files:[c,u],rules:{...f.configs["flat/recommended-typescript-error"].rules,...f.configs["flat/contents-typescript-error"].rules,...f.configs["flat/logical-typescript-error"].rules,...f.configs["flat/stylistic-typescript-error"].rules,"jsdoc/require-hyphen-before-param-description":["error","always"],"jsdoc/require-param":["error",{checkDestructured:!1,enableRestElementFixer:!1}],"jsdoc/require-throws":"error"}}]}function A(){return[{name:"yunarch/perfectionist/rules",plugins:{perfectionist:S},rules:{"perfectionist/sort-exports":["error",{order:"asc",type:"natural"}],"perfectionist/sort-imports":["error",{groups:["builtin","external","internal",["parent","sibling","index"],"side-effect","object","unknown"],newlinesBetween:"never",order:"asc",type:"natural"}],"perfectionist/sort-named-exports":["error",{order:"asc",type:"natural"}],"perfectionist/sort-named-imports":["error",{groupKind:"values-first",order:"asc",type:"natural"}],"import/order":"off","import-x/order":"off","sort-imports":"off"}}]}async function l(e){let r=await e;return typeof r=="object"&&r&&"default"in r?r.default:r}async function L(e){let[r,t,o]=await Promise.all([l(import("@eslint-react/eslint-plugin")),l(import("eslint-plugin-react-hooks")),l(import("eslint-plugin-react-refresh"))]),s=r.configs.all.plugins;return[{name:"yunarch/react/setup",plugins:{"@eslint-react":s["@eslint-react"],"@eslint-react/dom":s["@eslint-react/dom"],"@eslint-react/hooks-extra":s["@eslint-react/hooks-extra"],"@eslint-react/naming-convention":s["@eslint-react/naming-convention"],"@eslint-react/web-api":s["@eslint-react/web-api"],"react-hooks":t,"react-refresh":o}},{name:"yunarch/react/rules",files:[y],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}},sourceType:"module"},rules:{...r.configs.recommended.rules,...t.configs.recommended.rules,...o.configs.recommended.rules}},...e.isTypescriptEnabled?[{name:"yunarch/react/typescript/rules",files:[c,u],ignores:[`${h}/**`,x],languageOptions:{parserOptions:{projectService:!0}},rules:{...r.configs["recommended-typescript"].rules,...e.isTypeAware?{...r.configs["recommended-type-checked"].rules}:{}}}]:[]]}async function B(e){let r=e===!0||e.enableQuery,t=e===!0||e.enableRouter,o=[];if(r){let s=await l(import("@tanstack/eslint-plugin-query"));o.push({name:"yunarch/tanstack/query/rules",plugins:{"@tanstack/query":s},rules:{...s.configs["flat/recommended"].at(0)?.rules}})}if(t){let s=await l(import("@tanstack/eslint-plugin-router"));o.push({name:"yunarch/tanstack/router/rules",plugins:{"@tanstack/router":s},rules:{...s.configs["flat/recommended"].at(0)?.rules}})}return o}function D(e){let{enableTypeTesting:r}=e;return[{name:"yunarch/test/setup",plugins:{vitest:d},...r?{settings:{vitest:{typecheck:!0}},languageOptions:{globals:{...d.environments.env.globals}}}:{}},{name:"yunarch/test/rules",files:[...E],rules:{...d.configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"it",withinDescribe:"it"}],"vitest/prefer-hooks-in-order":"error","vitest/prefer-lowercase-title":"error"}}]}function N(e,r,t){return{name:e,files:r,...t.ignores?{ignores:t.ignores}:{},languageOptions:{parser:m.parser,parserOptions:{extraFileExtensions:t.extraFileExtensions?.map(o=>`.${o}`),sourceType:"module",...t.tsconfigPath?{projectService:{allowDefaultProject:["./*.js"],defaultProject:t.tsconfigPath},tsconfigRootDir:process.cwd()}:{},...t.parserOptions}}}}function $(e,r=[]){let t=[c,u],o=e.filesTypeAware??[c,u],s=e.ignoresTypeAware??[`${h}/**`,x];return[{name:"yunarch/typescript/setup",plugins:{"@typescript-eslint":m.plugin}},N("yunarch/typescript/parser",t,{ignores:void 0,extraFileExtensions:r,parserOptions:e.parserOptions}),...e.tsconfigPath?[N("yunarch/typescript/parser/type-aware",o,{ignores:s,extraFileExtensions:r,parserOptions:e.parserOptions,tsconfigPath:e.tsconfigPath})]:[],{name:"yunarch/typescript/rules",files:t,rules:{...m.configs.eslintRecommended.rules,...m.configs.strict.at(-1)?.rules,...m.configs.stylistic.at(-1)?.rules,"@typescript-eslint/ban-ts-comment":["error",{"ts-expect-error":"allow-with-description"}],"@typescript-eslint/consistent-type-definitions":"off","@typescript-eslint/consistent-type-imports":["error",{disallowTypeAnnotations:!1,fixStyle:"inline-type-imports",prefer:"type-imports"}],"@typescript-eslint/default-param-last":"error","@typescript-eslint/explicit-function-return-type":"off","@typescript-eslint/method-signature-style":["error","property"],"@typescript-eslint/naming-convention":["error",{format:["PascalCase"],selector:["typeLike"]},{format:["UPPER_CASE"],selector:["enumMember"]},{custom:{match:!1,regex:"^I[A-Z]|^(Interface|Props|State)$"},format:["PascalCase"],selector:"interface"}],"@typescript-eslint/no-dupe-class-members":"error","@typescript-eslint/no-empty-object-type":["error",{allowInterfaces:"always"}],"@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-loop-func":"error","@typescript-eslint/no-redeclare":["error",{builtinGlobals:!1}],"@typescript-eslint/no-shadow":"error","@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-use-before-define":["error",{classes:!1,functions:!1,variables:!0}],"@typescript-eslint/no-useless-empty-export":"warn","@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0,allowBoolean:!0}],"@typescript-eslint/unified-signatures":["error",{ignoreDifferentlyNamedParameters:!0,ignoreOverloadsWithDifferentJSDoc:!0}]}},...e.tsconfigPath&&!e.disableTypeAware?[{name:"yunarch/typescript/rules/type-aware",files:o,ignores:s,rules:{...m.configs.strictTypeCheckedOnly.at(-1)?.rules,...m.configs.stylisticTypeCheckedOnly.at(-1)?.rules,"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/require-array-sort-compare":["error",{ignoreStringArrays:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0,allowBoolean:!0}],"@typescript-eslint/switch-exhaustiveness-check":"warn"}}]:[]]}function q(){return[{name:"yunarch/unicorn/rules",plugins:{unicorn:w},rules:{...w.configs.recommended.rules,"unicorn/filename-case":["error",{cases:{camelCase:!0,kebabCase:!0,pascalCase:!0}}],"unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/prefer-number-properties":["error",{checkInfinity:!0,checkNaN:!0}],"unicorn/prefer-top-level-await":"warn","unicorn/prevent-abbreviations":"off"}}]}function H(e={},...r){let{gitignore:t=!0,ignores:o,extraFileExtensions:s,import:U=!0,jsdoc:X=!0,unicorn:V=!0,oxlint:O}=e,W=!!O,a=[];t&&(typeof t=="boolean"?a.push(l(import("eslint-config-flat-gitignore")).then(T=>[T({name:"yunarch/gitignore",strict:!1})])):a.push(l(import("eslint-config-flat-gitignore")).then(T=>[T({name:"yunarch/gitignore",...t})]))),a.push(_(e.base,o,W)),e.typescript&&a.push($(e.typescript===!0?{}:e.typescript,s)),U&&a.push(P()),X&&a.push(R()),V&&a.push(q()),e.test&&a.push(D(e.test===!0?{}:e.test)),e.tanstack&&a.push(B(e.tanstack)),e.react&&a.push(L({isTypescriptEnabled:!!e.typescript,isTypeAware:typeof e.typescript=="object"&&!!e.typescript.tsconfigPath&&!e.typescript.disableTypeAware})),a.push(A(),G({oxlint:O}));let g=new Q;return g=g.append(...a,...r),g=g.renamePlugins({"import-x":"import"}),g}export{H as config};
@@ -0,0 +1 @@
1
+ {"ignorePatterns":["**/node_modules/","**/dist/","**/out/","**/output","**/.output","**/build/","**/*.min.*","**/package-lock.json","**/yarn.lock","**/.yarn/","**/.yarnrc.yml","**/.pnp.*","**/.pnp","**/.pnp.js","**/.pnp.cjs","**/bun.lock","**/bun.lockb","**/pnpm-lock.yaml","**/.vite-inspect","**/.vitepress/cache","**/vite.config.*.timestamp-*","**/*.log","**/npm-debug.log*","**/yarn-debug.log*","**/yarn-error.log*","**/coverage/","**/.nyc_output/","**/__snapshots__","**/.vscode/","**/.idea/","**/.cache","**/.nuxt","**/.next","**/.svelte-kit","**/.vercel","**/.changeset","**/.turbo/","**/.DS_Store","**/Thumbs.db","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/mockServiceWorker.js","**/CHANGELOG*","**/LICENSE*"],"plugins":["eslint","typescript","import","jsdoc","unicorn","vitest","react"],"rules":{"for-direction":"error","no-async-promise-executor":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":"error","no-const-assign":"error","no-constant-binary-expression":"error","no-constant-condition":"error","no-control-regex":"error","no-debugger":"error","no-delete-var":"error","no-dupe-class-members":"error","no-dupe-else-if":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-empty":"error","no-empty-character-class":"error","no-empty-pattern":"error","no-empty-static-block":"error","no-ex-assign":"error","no-extra-boolean-cast":"error","no-fallthrough":"error","no-func-assign":"error","no-global-assign":"error","no-import-assign":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-loss-of-precision":"error","no-new-native-nonconstructor":"error","no-nonoctal-decimal-escape":"error","no-obj-calls":"error","no-prototype-builtins":"error","no-redeclare":"error","no-regex-spaces":"error","no-self-assign":"error","no-setter-return":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-this-before-super":"error","no-unexpected-multiline":0,"no-unsafe-finally":"error","no-unsafe-negation":"error","no-unsafe-optional-chaining":"error","no-unused-labels":"error","no-unused-private-class-members":"error","no-unused-vars":["error",{"args":"none","caughtErrors":"none","ignoreRestSiblings":true,"vars":"all"}],"no-useless-backreference":"error","no-useless-catch":"error","no-useless-escape":"error","no-with":"error","require-yield":"error","use-isnan":"error","valid-typeof":"error","array-callback-return":["error",{"allowImplicit":true}],"block-scoped-var":"error","curly":0,"default-case-last":"error","eqeqeq":"error","func-names":["error","as-needed"],"grouped-accessor-pairs":"error","max-lines":["warn",300],"max-params":["warn",4],"new-cap":["error",{"capIsNew":false}],"no-alert":"error","no-array-constructor":"error","no-bitwise":"error","no-caller":"error","no-console":"error","no-constructor-return":"error","no-else-return":"warn","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-iterator":"error","no-label-var":"error","no-labels":"error","no-lone-blocks":"error","no-lonely-if":"warn","no-multi-assign":"error","no-nested-ternary":"off","no-new":"error","no-new-func":"error","no-new-wrappers":"error","no-proto":"error","no-return-assign":"error","no-script-url":"error","no-self-compare":"error","no-template-curly-in-string":"error","no-unneeded-ternary":"error","no-unused-expressions":"error","no-useless-call":"error","no-useless-concat":"error","no-useless-rename":"warn","no-var":"error","no-void":["error",{"allowAsStatement":true}],"prefer-numeric-literals":"error","prefer-object-has-own":"error","prefer-object-spread":"warn","prefer-promise-reject-errors":["error",{"allowEmptyReject":true}],"prefer-rest-params":"error","prefer-spread":"error","symbol-description":"error","yoda":"warn","import/namespace":"error","import/default":"error","import/no-named-as-default":"warn","import/no-named-as-default-member":"warn","import/no-duplicates":["error",{"prefer-inline":true}],"import/first":"error","import/no-absolute-path":"error","import/no-amd":"error","import/no-cycle":["error",{"ignoreExternal":false,"maxDepth":3}],"import/no-dynamic-require":"error","import/no-mutable-exports":"error","import/no-self-import":"error","jsdoc/check-access":"error","jsdoc/check-property-names":"error","jsdoc/check-tag-names":"error","jsdoc/empty-tags":"error","jsdoc/implements-on-classes":"error","jsdoc/no-defaults":"error","jsdoc/require-param":["error",{"checkDestructured":false,"enableRestElementFixer":false}],"jsdoc/require-param-description":"error","jsdoc/require-param-name":"error","jsdoc/require-param-type":"error","jsdoc/require-property":"error","jsdoc/require-property-description":"error","jsdoc/require-property-name":"error","jsdoc/require-property-type":"error","jsdoc/require-returns":"error","jsdoc/require-returns-description":"error","jsdoc/require-returns-type":"error","jsdoc/require-yields":"error","no-negated-condition":"off","unicorn/catch-error-name":"error","unicorn/consistent-assert":"error","unicorn/consistent-date-clone":"error","unicorn/consistent-empty-array-spread":"error","unicorn/consistent-existence-index-check":"error","unicorn/consistent-function-scoping":"error","unicorn/empty-brace-spaces":"off","unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/explicit-length-check":"error","unicorn/filename-case":["error",{"cases":{"camelCase":true,"kebabCase":true,"pascalCase":true}}],"unicorn/new-for-builtins":"error","unicorn/no-abusive-eslint-disable":"error","unicorn/no-accessor-recursion":"error","unicorn/no-anonymous-default-export":"error","unicorn/no-array-for-each":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-array-reduce":"off","unicorn/no-await-expression-member":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-console-spaces":"error","unicorn/no-document-cookie":"error","unicorn/no-empty-file":"error","unicorn/no-hex-escape":"error","unicorn/no-instanceof-builtins":"error","unicorn/no-invalid-fetch-options":"error","unicorn/no-invalid-remove-event-listener":"error","unicorn/no-lonely-if":"error","unicorn/no-magic-array-flat-depth":"error","unicorn/no-negated-condition":"error","unicorn/no-negation-in-equality-check":"error","unicorn/no-nested-ternary":"off","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/no-null":"off","unicorn/no-object-as-default-parameter":"error","unicorn/no-process-exit":"error","unicorn/no-single-promise-in-promise-methods":"error","unicorn/no-static-only-class":"error","unicorn/no-thenable":"error","unicorn/no-this-assignment":"error","unicorn/no-typeof-undefined":"error","unicorn/no-unnecessary-array-flat-depth":"error","unicorn/no-unnecessary-await":"error","unicorn/no-unnecessary-slice-end":"error","unicorn/no-unreadable-array-destructuring":"error","unicorn/no-unreadable-iife":"error","unicorn/no-useless-fallback-in-spread":"error","unicorn/no-useless-length-check":"error","unicorn/no-useless-promise-resolve-reject":"error","unicorn/no-useless-spread":"error","unicorn/no-useless-switch-case":"error","unicorn/no-useless-undefined":"error","unicorn/no-zero-fractions":"error","unicorn/number-literal-case":"off","unicorn/numeric-separators-style":"error","unicorn/prefer-add-event-listener":"error","unicorn/prefer-array-find":"error","unicorn/prefer-array-flat":"error","unicorn/prefer-array-flat-map":"error","unicorn/prefer-array-index-of":"error","unicorn/prefer-array-some":"error","unicorn/prefer-blob-reading-methods":"error","unicorn/prefer-code-point":"error","unicorn/prefer-date-now":"error","unicorn/prefer-dom-node-append":"error","unicorn/prefer-dom-node-dataset":"error","unicorn/prefer-dom-node-remove":"error","unicorn/prefer-dom-node-text-content":"error","unicorn/prefer-event-target":"error","unicorn/prefer-global-this":"error","unicorn/prefer-includes":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-math-trunc":"error","unicorn/prefer-modern-dom-apis":"error","unicorn/prefer-modern-math-apis":"error","unicorn/prefer-native-coercion-functions":"error","unicorn/prefer-negative-index":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":["error",{"checkInfinity":true,"checkNaN":true}],"unicorn/prefer-object-from-entries":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-prototype-methods":"error","unicorn/prefer-query-selector":"error","unicorn/prefer-reflect-apply":"error","unicorn/prefer-regexp-test":"error","unicorn/prefer-set-has":"error","unicorn/prefer-set-size":"error","unicorn/prefer-spread":"error","unicorn/prefer-string-raw":"error","unicorn/prefer-string-replace-all":"error","unicorn/prefer-string-slice":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-structured-clone":"error","unicorn/prefer-type-error":"error","unicorn/require-array-join-separator":"error","unicorn/require-number-to-fixed-digits-argument":"error","unicorn/require-post-message-target-origin":"off","unicorn/switch-case-braces":"error","unicorn/text-encoding-identifier-case":"error","unicorn/throw-new-error":"error","sort-imports":"off"},"overrides":[{"files":["**/*.{ts,cts,mts}","**/*.{tsx,ctsx,mtsx}"],"rules":{"no-class-assign":"off","no-const-assign":"off","no-dupe-class-members":"off","no-dupe-keys":"off","no-func-assign":"off","no-import-assign":"off","no-new-native-nonconstructor":"off","no-obj-calls":"off","no-redeclare":"off","no-setter-return":"off","no-this-before-super":"off","no-unsafe-negation":"off","no-var":"error","no-with":"off","prefer-rest-params":"error","prefer-spread":"error","@typescript-eslint/ban-ts-comment":["error",{"ts-expect-error":"allow-with-description"}],"no-array-constructor":"off","@typescript-eslint/no-array-constructor":"error","@typescript-eslint/no-duplicate-enum-values":"error","@typescript-eslint/no-dynamic-delete":"error","@typescript-eslint/no-empty-object-type":["error",{"allowInterfaces":"always"}],"@typescript-eslint/no-explicit-any":"error","@typescript-eslint/no-extra-non-null-assertion":"error","@typescript-eslint/no-extraneous-class":"error","@typescript-eslint/no-misused-new":"error","@typescript-eslint/no-namespace":"error","@typescript-eslint/no-non-null-asserted-nullish-coalescing":"error","@typescript-eslint/no-non-null-asserted-optional-chain":"error","@typescript-eslint/no-non-null-assertion":"error","@typescript-eslint/no-require-imports":"error","@typescript-eslint/no-this-alias":"error","@typescript-eslint/no-unnecessary-type-constraint":"error","@typescript-eslint/no-unsafe-declaration-merging":"error","@typescript-eslint/no-unsafe-function-type":"error","no-unused-expressions":"off","@typescript-eslint/no-unused-expressions":"error","no-unused-vars":"off","@typescript-eslint/no-unused-vars":"off","no-useless-constructor":"off","@typescript-eslint/no-useless-constructor":"error","@typescript-eslint/no-wrapper-object-types":"error","@typescript-eslint/prefer-as-const":"error","@typescript-eslint/prefer-literal-enum-member":"error","@typescript-eslint/prefer-namespace-keyword":"error","@typescript-eslint/triple-slash-reference":"error","@typescript-eslint/adjacent-overload-signatures":"error","@typescript-eslint/array-type":"error","@typescript-eslint/ban-tslint-comment":"error","@typescript-eslint/consistent-generic-constructors":"error","@typescript-eslint/consistent-indexed-object-style":"error","@typescript-eslint/consistent-type-definitions":"off","@typescript-eslint/no-confusing-non-null-assertion":"error","no-empty-function":"off","@typescript-eslint/no-empty-function":"error","@typescript-eslint/no-inferrable-types":"error","@typescript-eslint/prefer-for-of":"error","@typescript-eslint/prefer-function-type":"error","@typescript-eslint/consistent-type-imports":["error",{"disallowTypeAnnotations":false,"fixStyle":"inline-type-imports","prefer":"type-imports"}],"@typescript-eslint/default-param-last":"error","@typescript-eslint/explicit-function-return-type":"off","@typescript-eslint/no-dupe-class-members":"error","@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-redeclare":["error",{"builtinGlobals":false}],"@typescript-eslint/no-useless-empty-export":"warn"}},{"files":["**/*.{ts,cts,mts}","**/*.{tsx,ctsx,mtsx}"],"rules":{"no-throw-literal":"off","prefer-promise-reject-errors":"off","require-await":"off"}},{"files":["**/*.{ts,cts,mts}","**/*.{tsx,ctsx,mtsx}"],"rules":{"jsdoc/check-access":"error","jsdoc/check-property-names":"error","jsdoc/check-tag-names":"error","jsdoc/empty-tags":"error","jsdoc/implements-on-classes":"error","jsdoc/no-defaults":"error","jsdoc/require-param":["error",{"checkDestructured":false,"enableRestElementFixer":false}],"jsdoc/require-param-description":"error","jsdoc/require-param-name":"error","jsdoc/require-param-type":"off","jsdoc/require-property":"error","jsdoc/require-property-description":"error","jsdoc/require-property-name":"error","jsdoc/require-property-type":"off","jsdoc/require-returns":"error","jsdoc/require-returns-description":"error","jsdoc/require-returns-type":"off","jsdoc/require-yields":"error"}},{"files":["**/__tests__/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.spec.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.test.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.bench.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.benchmark.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}"],"rules":{"vitest/expect-expect":"error","vitest/no-identical-title":"error","vitest/no-commented-out-tests":"error","vitest/valid-expect":"error","vitest/valid-describe-callback":"error","vitest/require-local-test-context-for-concurrent-snapshots":"error","vitest/no-import-node-test":"error","vitest/consistent-test-it":["error",{"fn":"it","withinDescribe":"it"}],"vitest/prefer-hooks-in-order":"error","vitest/prefer-lowercase-title":"error"}},{"files":["**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}"],"rules":{"react/jsx-no-duplicate-props":"warn","react/no-array-index-key":"warn","react/no-direct-mutation-state":"error","react/no-string-refs":"error","react-hooks/rules-of-hooks":"error","react-hooks/exhaustive-deps":"warn"}},{"files":["**/*.{ts,cts,mts}","**/*.{tsx,ctsx,mtsx}"],"rules":{"react/jsx-no-duplicate-props":"off","react/no-array-index-key":"warn","react/no-direct-mutation-state":"error","react/no-string-refs":"error"}},{"files":["**/scripts/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/tasks/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/bin/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/bin.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/cli/**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/cli.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}"],"rules":{"no-console":"off","unicorn/no-process-exit":"off"}},{"files":["**/*.d.{ts,cts,mts}"],"rules":{"@typescript-eslint/consistent-indexed-object-style":"off","import/no-duplicates":"off"}},{"files":["**/*.config.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}","**/*.config.*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}"],"rules":{"no-console":"off","@typescript-eslint/explicit-function-return-type":"off"}}]}
@@ -1,34 +1,79 @@
1
- type Prettify<T> = {
2
- [K in keyof T]: T[K];
1
+ /**
2
+ * Utility type that takes an object type and makes the hover overlay more readable.
3
+ *
4
+ * @see https://www.totaltypescript.com/concepts/the-prettify-helper
5
+ */
6
+ export type Prettify<T> = {
7
+ [K in keyof T]: T[K];
3
8
  } & {};
9
+
10
+ // Utility types for entries in various data structures
4
11
  type ObjectEntry<Base> = [keyof Base, Base[keyof Base]];
5
12
  type ArrayEntry<Base extends readonly unknown[]> = [number, Base[number]];
6
13
  type SetEntry<Base> = Base extends Set<infer V> ? [V, V] : never;
7
14
  type MapEntry<Base> = Base extends Map<infer K, infer V> ? [K, V] : never;
8
- type Entry<BaseType> = BaseType extends Map<unknown, unknown> ? MapEntry<BaseType> : BaseType extends Set<unknown> ? SetEntry<BaseType> : BaseType extends readonly unknown[] ? ArrayEntry<BaseType> : BaseType extends object ? ObjectEntry<BaseType> : never;
15
+ type Entry<BaseType> = BaseType extends Map<unknown, unknown>
16
+ ? MapEntry<BaseType>
17
+ : BaseType extends Set<unknown>
18
+ ? SetEntry<BaseType>
19
+ : BaseType extends readonly unknown[]
20
+ ? ArrayEntry<BaseType>
21
+ : BaseType extends object
22
+ ? ObjectEntry<BaseType>
23
+ : never;
24
+
9
25
  /**
10
- * Utility function to have a type-safety alternative to Object.entries.
26
+ * Utility type to make `Object.entries` type-safe.
11
27
  *
12
- * @param obj - The object to create entries from.
13
- * @returns Object entries with typed keys and values.
28
+ * @example
29
+ * ```ts
30
+ * const typedObjectEntries: ObjectEntries = Object.entries;
31
+ * ```
14
32
  */
15
- declare function typedObjectEntries<T extends object>(obj: T): Entry<T>[];
16
- type IsUnion<T, U extends T = T> = T extends unknown ? [U] extends [T] ? false : true : false;
33
+ export type ObjectEntries = <T extends object>(obj: T) => Entry<T>[];
34
+
35
+ // Utilities for handling unions and intersections in TypeScript
36
+ type IsUnion<T, U extends T = T> = T extends unknown
37
+ ? [U] extends [T]
38
+ ? false
39
+ : true
40
+ : false;
17
41
  type IfUnion<T, Yes, No> = true extends IsUnion<T> ? Yes : No;
18
- type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
19
- type InferKeyOptionalityFromTupleType<T extends readonly [PropertyKey, unknown]> = UnionToIntersection<T extends [unknown, unknown] ? {
20
- [K in T[0]]?: unknown;
21
- } : IfUnion<T[0], {
22
- [K in T[0]]?: unknown;
23
- }, {
24
- [K in T[0]]: unknown;
25
- }>>;
42
+ type UnionToIntersection<U> = (
43
+ U extends unknown
44
+ ? (k: U) => void
45
+ : never
46
+ ) extends (k: infer I) => void
47
+ ? I
48
+ : never;
49
+ type InferKeyOptionalityFromTupleType<
50
+ T extends readonly [PropertyKey, unknown],
51
+ > = UnionToIntersection<
52
+ T extends [unknown, unknown]
53
+ ? { [K in T[0]]?: unknown }
54
+ : IfUnion<T[0], { [K in T[0]]?: unknown }, { [K in T[0]]: unknown }>
55
+ >;
56
+
26
57
  /**
27
- * Utility function to have a type-safe alternative to Object.fromEntries.
58
+ * Utility type to make `Object.fromEntries` type-safe.
28
59
  *
29
- * @param entries - The entries to create an object from.
30
- * @returns An object with typed keys and values based on the provided entries.
60
+ * @example
61
+ * ```ts
62
+ * const typedObjectFromEntries: ObjectFromEntries = Object.fromEntries;
63
+ * ```
31
64
  */
32
- declare function typedObjectFromEntries<T extends readonly [...(readonly (readonly [PropertyKey, unknown])[])]>(entries: T): T extends [...T[number][]] ? { [K in T[number][0]]?: (readonly [K, T[number][1]] & T[number])[1]; } : { [K in keyof InferKeyOptionalityFromTupleType<T[number]>]: (readonly [K, T[number][1]] & T[number])[1]; };
33
-
34
- export { type Prettify, typedObjectEntries, typedObjectFromEntries };
65
+ export type ObjectFromEntries = <
66
+ T extends readonly [...(readonly (readonly [PropertyKey, unknown])[])],
67
+ >(
68
+ entries: T
69
+ ) => T extends [...T[number][]]
70
+ ? {
71
+ [K in T[number][0]]?: (readonly [K, T[number][1]] & T[number])[1];
72
+ }
73
+ : {
74
+ [K in keyof InferKeyOptionalityFromTupleType<T[number]>]: (readonly [
75
+ K,
76
+ T[number][1],
77
+ ] &
78
+ T[number])[1];
79
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "name": "@yunarch/config-web",
5
5
  "description": "Shared configurations for web projects.",
6
6
  "license": "MIT",
@@ -29,52 +29,58 @@
29
29
  "node": ">=22"
30
30
  },
31
31
  "sideEffects": false,
32
- "files": ["README.md", "LICENSE.md", "dist"],
32
+ "files": [
33
+ "README.md",
34
+ "LICENSE.md",
35
+ "dist"
36
+ ],
33
37
  "bin": {
34
- "bun-run-all": "./dist/cli/bun-run-all/index.js",
35
- "openapi-sync": "./dist/cli/openapi-sync/index.js",
36
- "turbo-select": "./dist/cli/turbo-select/index.js"
38
+ "bun-run-all": "./dist/cli/bun-run-all/bun-run-all.cli.js",
39
+ "openapi-sync": "./dist/cli/openapi-sync/openapi-sync.cli.js",
40
+ "openapi-sync-lint-msw-handlers": "./dist/cli/openapi-sync/openapi-sync-lint-msw-handlers.cli.js",
41
+ "turbo-select": "./dist/cli/turbo-select/turbo-select.cli.js"
37
42
  },
38
43
  "exports": {
39
44
  ".": "./dist/index.js",
40
- "./prettier": "./dist/formatters/prettier.config.js",
45
+ "./prettier": "./dist/prettier.config.js",
41
46
  "./eslint": {
42
- "types": "./dist/linters/eslint.config.d.ts",
43
- "default": "./dist/linters/eslint.config.js"
47
+ "types": "./dist/eslint.config.d.ts",
48
+ "default": "./dist/eslint.config.js"
44
49
  },
45
- "./oxlint": "./dist/linters/oxlint.config.json",
46
- "./biome-formatter": "./dist/formatters/biome.config.json",
50
+ "./oxlint": "./dist/oxlint.config.json",
51
+ "./biome": "./dist/biome.config.json",
47
52
  "./tsconfig-base": "./dist/ts/tsconfig-base.json",
48
- "./reset.d.ts": "./dist/ts/reset.d.ts",
49
- "./ts-utils": {
50
- "types": "./dist/ts/utils.d.ts",
51
- "default": "./dist/ts/utils.js"
52
- }
53
+ "./ts-reset.d.ts": "./dist/ts/reset.d.ts",
54
+ "./ts-utils.d.ts": "./dist/ts/utils.d.ts"
53
55
  },
54
56
  "type": "module",
55
57
  "scripts": {
56
58
  "postinstall": "husky && bun run gen",
57
- "bun-run-all": "bun ./src/cli/bun-run-all/index.ts",
58
- "gen": "bun bun-run-all gen:eslint-typegen gen:oxlint-compatgen",
59
+ "bun-run-all": "bun run ./src/cli/bun-run-all/bun-run-all.cli.ts",
60
+ "gen": "bun run bun-run-all gen:cli-docs gen:eslint-typegen gen:oxlint-compatgen gen:biome-compatgen",
61
+ "gen:cli-docs": "bun run ./scripts/cli-docsgen.ts",
59
62
  "gen:eslint-typegen": "bun run ./scripts/eslint-typegen.ts",
60
- "gen:oxlint-compatgen": "bun run ./scripts/oxlint-compatgen.ts && biome format --write ./src/linters/oxlint.config.jsonc",
61
- "lint": "bun bun-run-all lint:code lint:ts -t",
63
+ "gen:oxlint-compatgen": "bun run ./scripts/oxlint-compatgen.ts && biome format --write ./src/oxlint.config.jsonc",
64
+ "gen:biome-compatgen": "bun run ./scripts/biome-compatgen.ts && biome format --write ./src/biome.config.jsonc",
65
+ "lint": "bun run bun-run-all lint:code lint:ts -t",
62
66
  "lint:code": "oxlint && eslint .",
63
67
  "lint:ts": "tsc --noEmit",
64
68
  "lint:inspect": "bunx @eslint/config-inspector --config eslint.config.ts",
65
69
  "format": "biome format && prettier \"**/*.{html,md,yaml,yml}\" --check",
66
70
  "format:all": "biome format --write && prettier \"**/*.{html,md,yaml,yml}\" --write",
71
+ "format:mocks": "biome format --write ./tests/__mocks__",
67
72
  "clean": "rimraf dist coverage .turbo",
68
73
  "build": "bun run gen && tsup",
69
- "test": "vitest --typecheck run",
70
- "test:watch": "vitest --typecheck watch",
71
- "release": "bun run lint && bun run test && bun publish --dry-run && bunx bumpp && bun run build && bun publish"
74
+ "tests": "vitest --typecheck run",
75
+ "tests:watch": "vitest --typecheck watch",
76
+ "release": "bun run lint && bun run tests && bun publish --dry-run && bunx bumpp && bun run build && bun publish"
72
77
  },
73
78
  "peerDependencies": {
74
- "@biomejs/biome": ">= 1 || < 2",
79
+ "@biomejs/biome": ">= 2 || < 3",
75
80
  "prettier": ">= 3 || < 4",
76
81
  "eslint": ">=9.5.0 || < 10",
77
- "oxlint": ">=0.16.2 || < 1"
82
+ "oxlint": ">=0.16.2 || < 2",
83
+ "msw": ">=2 || < 3"
78
84
  },
79
85
  "peerDependenciesMeta": {
80
86
  "@biomejs/biome": {
@@ -88,54 +94,58 @@
88
94
  },
89
95
  "oxlint": {
90
96
  "optional": true
97
+ },
98
+ "msw": {
99
+ "optional": true
91
100
  }
92
101
  },
93
102
  "dependencies": {
94
103
  "commander": "14.0.0",
95
104
  "ora": "8.2.0",
96
- "@inquirer/confirm": "5.1.12",
97
- "@inquirer/select": "4.2.3",
105
+ "@inquirer/confirm": "5.1.14",
106
+ "@inquirer/select": "4.3.1",
98
107
  "@total-typescript/ts-reset": "0.6.1",
99
- "globals": "16.2.0",
100
- "eslint-flat-config-utils": "2.1.0",
108
+ "globals": "16.3.0",
109
+ "eslint-flat-config-utils": "2.1.1",
101
110
  "eslint-config-flat-gitignore": "2.1.0",
102
- "eslint-import-resolver-typescript": "4.4.3",
103
- "@eslint/js": "9.28.0",
104
- "typescript-eslint": "8.34.0",
105
- "eslint-plugin-unicorn": "59.0.1",
106
- "eslint-plugin-perfectionist": "4.14.0",
107
- "eslint-plugin-import-x": "4.15.1",
111
+ "eslint-import-resolver-typescript": "4.4.4",
112
+ "@eslint/js": "9.32.0",
113
+ "typescript-eslint": "8.38.0",
114
+ "eslint-plugin-unicorn": "60.0.0",
115
+ "eslint-plugin-perfectionist": "4.15.0",
116
+ "eslint-plugin-import-x": "4.16.1",
108
117
  "eslint-plugin-unused-imports": "4.1.4",
109
- "eslint-plugin-jsdoc": "50.7.1",
110
- "eslint-config-prettier": "10.1.5",
111
- "eslint-plugin-oxlint": "0.18.1",
112
- "@eslint-react/eslint-plugin": "1.51.3",
118
+ "eslint-plugin-jsdoc": "52.0.2",
119
+ "eslint-config-prettier": "10.1.8",
120
+ "eslint-plugin-oxlint": "1.9.0",
121
+ "@eslint-react/eslint-plugin": "1.52.3",
113
122
  "eslint-plugin-react-hooks": "5.2.0",
114
123
  "eslint-plugin-react-refresh": "0.4.20",
115
- "@tanstack/eslint-plugin-query": "5.78.0",
116
- "@tanstack/eslint-plugin-router": "1.120.17",
117
- "@vitest/eslint-plugin": "1.2.1"
124
+ "@tanstack/eslint-plugin-query": "5.83.1",
125
+ "@tanstack/eslint-plugin-router": "1.129.7",
126
+ "@vitest/eslint-plugin": "1.3.4"
118
127
  },
119
128
  "devDependencies": {
120
129
  "@commitlint/cli": "19.8.1",
121
130
  "@commitlint/config-conventional": "19.8.1",
122
- "prettier": "3.5.3",
123
- "@biomejs/biome": "1.9.4",
124
- "eslint": "9.28.0",
125
- "eslint-typegen": "2.2.0",
126
- "oxlint": "0.18.1",
131
+ "prettier": "3.6.2",
132
+ "@biomejs/biome": "2.1.3",
133
+ "eslint": "9.32.0",
134
+ "eslint-typegen": "2.3.0",
135
+ "oxlint": "1.9.0",
127
136
  "husky": "9.1.7",
128
- "lint-staged": "16.1.0",
137
+ "lint-staged": "16.1.2",
129
138
  "rimraf": "6.0.1",
130
139
  "tsup": "8.5.0",
131
- "typescript": "5.8.3",
132
- "vitest": "3.2.3",
140
+ "typescript": "5.9.2",
141
+ "vitest": "3.2.4",
133
142
  "jsonc-parser": "3.3.1",
134
- "@types/node": "24.0.0",
135
- "@types/bun": "1.2.15"
143
+ "msw": "2.10.4",
144
+ "@types/node": "24.1.0",
145
+ "@types/bun": "1.2.19"
136
146
  },
147
+ "packageManager": "bun@1.2.19",
137
148
  "publishConfig": {
138
149
  "access": "public"
139
- },
140
- "packageManager": "bun@1.2.15"
150
+ }
141
151
  }
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env bun
2
- import{c as p}from"../chunk-PWSW557X.js";import{styleText as h}from"util";import{styleText as l}from"util";var d=["blue","green","yellow","grey","white","cyan"],m=o=>`${(Number(Bun.nanoseconds()-o)/1e6/1e3).toFixed(2)}s`;function b({start:o,tasks:e,failedTasks:n}){let c=e-n,a=m(o),t=n>0?l("red",`${n} failed`):"",i=c>0?l("green",`${c} successful`):"";console.log(""),console.log(l(["white","bold"],"Tasks: "),`${t}${t&&i?"|":""}${i}`,l("gray",`-- ${e} total`)),console.log(l(["white","bold"],"Time: "),l("gray",`${a}
3
- `))}function g({index:o,script:e,continueOnError:n,reportTime:c}){let a=d[o%d.length],t=Bun.nanoseconds(),i=Bun.spawn(["bun","run",e],{stdout:"pipe",stderr:"pipe",env:{...Bun.env,FORCE_COLOR:"1"},onExit(r,s){s===1&&!n&&process.exit(1)}});return i.stdout.pipeTo(new WritableStream({write(r){let s=new TextDecoder().decode(r).split(`
4
- `);for(let u of s)console.log(l([a,"bold"],`${e}:`),u)}})),i.stderr.pipeTo(new WritableStream({write(r){let s=new TextDecoder().decode(r).split(`
5
- `);for(let u of s)console.log(l([a,"bold"],`${e}:`),u)}})),i.exited.then(r=>{r===0&&c&&console.log(l([a,"bold"],`${e}:`),l(["gray"],"Finished in"),l(["white","bold"],m(t)))}),i}async function f(o,e){let{continueOnError:n,reportTime:c}=e,a=Bun.nanoseconds(),t=o.map((s,u)=>g({index:u,script:s,continueOnError:n,reportTime:c})),r=(await Promise.allSettled(t.map(s=>s.exited))).filter(s=>s.status==="rejected"||s.value!==0).length;return b({start:a,tasks:o.length,failedTasks:r}),r>0?1:0}async function x(o,e){let{continueOnError:n,reportTime:c}=e,a=Bun.nanoseconds(),t=0;for(let[i,r]of o.entries())await g({index:i,script:r,continueOnError:n,reportTime:c}).exited!==0&&t++;return b({start:a,tasks:o.length,failedTasks:t}),t>0?1:0}p().name("bun-run-all").description("Run given package scripts in parallel or sequential by using bun.").argument("<scripts...>","A list of package scripts' names.").option("-c, --continue-on-error","Continue executing other/subsequent tasks even if a task threw an error").option("-p, --parallel","Run a group of tasks in parallel.").option("-s, --sequential","Run a group of tasks sequentially.").option("-t, --time","Report execution time for each task.").action(async(o,e)=>{try{console.log(h("magenta",`
6
- \u{1F680} bun-run-all
7
- `));let n=e.sequential??!1,c=e.parallel??!n,a=e.continueOnError??!1,t=e.time??!1;if(c===n&&(console.error("You cannot use both --parallel and --sequential options at the same time."),process.exit(1)),n){let r=await x(o,{continueOnError:a,reportTime:t});process.exit(r)}let i=await f(o,{continueOnError:a,reportTime:t});process.exit(i)}catch(n){console.error(n),process.exit(1)}}).parseAsync(process.argv);
@@ -1 +0,0 @@
1
- import{exec as a}from"child_process";import{promisify as m,styleText as e,types as c}from"util";import{Command as p}from"commander";import u from"ora";var l=m(a);async function w(o){let{command:t,name:i}=o,s=u(i);s.spinner="aesthetic",s.start();try{let r=typeof t=="string"?await l(t):c.isPromise(t)?await t:await t();return s.succeed(),await new Promise(n=>{setTimeout(n,0)}),typeof r=="object"&&r&&"stdout"in r?r.stdout:r}catch(r){let n=r;throw s.fail(e("red",n.stderr??n.message??"")),r}}function P(){let o=new p;return o.configureHelp({styleTitle:t=>e("bold",t),styleCommandText:t=>e("cyan",t),styleCommandDescription:t=>e("magenta",t),styleDescriptionText:t=>e("italic",t),styleOptionText:t=>e("green",t),styleArgumentText:t=>e("yellow",t),styleSubcommandText:t=>e("blue",t)}).configureOutput({outputError:(t,i)=>{i(e("red",t))}}),o}export{l as a,w as b,P as c};
@@ -1,135 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as l,b as o,c as y}from"../chunk-PWSW557X.js";import{writeFile as O}from"fs/promises";import{styleText as f}from"util";import S from"@inquirer/confirm";async function g(e,t){await o({name:"Generating models",command:`npx openapi-typescript-codegen --input ${e} --output ${t} --client fetch`})}import{writeFile as R}from"fs/promises";var w=`
3
- import {
4
- http as mswHttp,
5
- type DefaultBodyType,
6
- type HttpHandler,
7
- type HttpResponseResolver,
8
- type PathParams,
9
- type RequestHandlerOptions,
10
- } from 'msw';
11
- import type { paths } from './schema';
12
-
13
- // Type definitions
14
- type HttpMethod =
15
- | 'get'
16
- | 'put'
17
- | 'post'
18
- | 'delete'
19
- | 'options'
20
- | 'head'
21
- | 'patch'
22
- | 'trace';
23
-
24
- /**
25
- * Type guard to get the http methods available for a given path.
26
- */
27
- type Methods<Path extends keyof paths> = {
28
- [M in keyof paths[Path]]: M extends HttpMethod
29
- ? paths[Path][M] extends undefined
30
- ? never
31
- : M
32
- : never;
33
- }[keyof paths[Path]];
34
-
35
- /**
36
- * Type guard to get the content type 'application/json' or 'multipart/form-data' of a type.
37
- */
38
- type ExtractContent<T> = T extends { content?: infer C }
39
- ? undefined extends C
40
- ? DefaultBodyType
41
- : 'application/json' extends keyof C
42
- ? C['application/json']
43
- : 'multipart/form-data' extends keyof C
44
- ? C['multipart/form-data']
45
- : DefaultBodyType
46
- : DefaultBodyType;
47
-
48
- /**
49
- * Type guard to get the parameters of a path.
50
- */
51
- export type OpenapiPathParams<
52
- P extends keyof paths,
53
- M extends keyof paths[P],
54
- > = 'parameters' extends keyof paths[P][M]
55
- ? 'path' extends keyof paths[P][M]['parameters']
56
- ? PathParams<keyof paths[P][M]['parameters']['path']>
57
- : PathParams
58
- : PathParams;
59
-
60
- /**
61
- * Type guard to get the request body of a path.
62
- */
63
- export type OpenapiPathRequestBody<
64
- P extends keyof paths,
65
- M extends keyof paths[P],
66
- > = paths[P][M] extends { requestBody?: infer RB }
67
- ? undefined extends RB
68
- ? DefaultBodyType
69
- : ExtractContent<RB>
70
- : DefaultBodyType;
71
-
72
- /**
73
- * Type guard to get the response body of a path.
74
- */
75
- export type OpenapiPathResponseBody<
76
- P extends keyof paths,
77
- M extends keyof paths[P],
78
- > = paths[P][M] extends { responses?: infer R }
79
- ? undefined extends R
80
- ? DefaultBodyType
81
- : 200 extends keyof R
82
- ? ExtractContent<R[200]>
83
- : 201 extends keyof R
84
- ? ExtractContent<R[201]>
85
- : DefaultBodyType
86
- : DefaultBodyType;
87
-
88
- /**
89
- * Wrapper around MSW http function so we can have "typesafe" handlers against an openapi schema.
90
- *
91
- * @param path - The path to use from the openapi definition.
92
- * @param method - The method to use on the handler.
93
- * @param resolver - The MSW resolver function.
94
- * @param options - The MSW http request handler options.
95
- * @returns a typesafe wrapper for MSW http function.
96
- *
97
- * @throws Error if the method is not supported.
98
- */
99
- export function http<P extends keyof paths, M extends Methods<P>>(
100
- path: P,
101
- method: M,
102
- resolver: HttpResponseResolver<
103
- OpenapiPathParams<P, M>,
104
- OpenapiPathRequestBody<P, M>,
105
- OpenapiPathResponseBody<P, M>
106
- >,
107
- options?: RequestHandlerOptions
108
- ): HttpHandler {
109
- const uri = \`*\${path.toString().replaceAll(/{(?<temp1>[^}]+)}/g, ':$1')}\`;
110
- const handlers = {
111
- head: mswHttp.head(uri, resolver, options),
112
- get: mswHttp.get(uri, resolver, options),
113
- post: mswHttp.post(uri, resolver, options),
114
- put: mswHttp.put(uri, resolver, options),
115
- delete: mswHttp.delete(uri, resolver, options),
116
- patch: mswHttp.patch(uri, resolver, options),
117
- options: mswHttp.options(uri, resolver, options),
118
- } as const;
119
- if (typeof method !== 'string' || !Object.hasOwn(handlers, method)) {
120
- throw new Error('Unsupported Http Method');
121
- }
122
- return handlers[method as keyof typeof handlers];
123
- }
124
- `;async function x(e){await o({name:"Generating openapi MSW utils",command:async()=>{await R(`${e}/openapi-msw-http.ts`,w)}})}import{readFile as H,writeFile as B}from"fs/promises";async function P(e,t){await o({name:"Generating schema types",command:async()=>{await l(`npx openapi-typescript ${e} -o ${t}`);let n=await H(t,"utf8");await B(t,`/* eslint-disable -- Autogenerated file */
125
- ${n}`)}})}import{existsSync as u}from"fs";import{mkdir as E,readFile as T}from"fs/promises";import m from"path";async function M(e){if(m.extname(e)!=="")throw new Error("Output must be a directory.");let t=process.cwd(),n=m.resolve(e),a=n.startsWith(t)?n:m.resolve(t,m.relative(m.parse(e).root,e));return u(a)||await o({name:"Generating output directory",command:async()=>{await E(a,{recursive:!0})}}),a}async function k(e,t){let[n,s]=await Promise.all([o({name:"Reading input openapi schema",command:async()=>{if(!e.endsWith(".json"))throw new Error(`Input file must be a JSON file: ${e}`);if(e.startsWith("http"))try{let{stdout:a}=await l(`curl -s ${e} --fail`);return a}catch{throw new Error(`Failed to fetch remote OpenAPI file: ${e}`)}if(!u(e))throw new Error(`Input file does not exist: ${e}`);return await T(e,"utf8")}}),o({name:"Reading output openapi schema",command:async()=>{if(!t.endsWith(".json"))throw new Error(`Output file must be a JSON file: ${t}`);return u(t)?await T(t,"utf8"):!1}})]);return[JSON.stringify(JSON.parse(n)),s?JSON.stringify(JSON.parse(s)):!1]}y().name("openapi-sync").description("A CLI tool to convert OpenAPI 3.0/3.1 schemas to TypeScript types and create type-safe fetching based on a openapi file and keep them in sync.").requiredOption("-i, --input <path>","The input (local or remote) openapi schema (JSON).").requiredOption("-o, --output <folder>","The output folder to save the generated models and openapi schema and type definitions.").option("-f, --force-gen","Force generation of typescript schemas and fetching code even if the input and output schemas are identical.").option("--include-msw-utils","Include MSW mocking utilities based on the generated typescript types.").option("--post-script <script>","A package.json script to run after the code generation.").action(async({input:e,output:t,forceGen:n,includeMswUtils:s,postScript:a})=>{try{console.log(f("magenta",`
126
- \u{1F680} openapi-sync
127
- `));let r=await M(t),p=`${r}/openapi.json`,v=`${r}/schema.d.ts`,[h,i]=await k(e,p);i&&h===i&&!n?(console.log(f("blue",`
128
- No updates required.
129
- `)),process.exit(0)):i?i&&h!==i&&(console.log(f("yellow",`
130
- \u26A0\uFE0F Local and remote schemas does not match!
131
- `)),await S({message:"Do you want to use the remote schema? (y/n)?"})?await o({name:"Replacing local schema with input schema",command:O(p,h)}):(console.log(f("yellow",`
132
- \u26A0\uFE0F Sync remote schemas skipped.
133
- `)),n||process.exit(0))):await o({name:"Creating local schema",command:O(p,h)}),await Promise.all([P(p,v),g(p,r)]),s&&await x(r),a&&await o({name:"Running post script",command:`node --run ${a}`}),console.log(f("green",`
134
- \u2705 openapi-sync process completed!
135
- `))}catch(r){console.error(r),process.exit(1)}}).parseAsync(process.argv);
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{c as r}from"../chunk-PWSW557X.js";import{execSync as p}from"child_process";import{styleText as u}from"util";import{execSync as l}from"child_process";import a from"@inquirer/select";async function i(){let t=l("npx turbo ls",{encoding:"utf8",stdio:"pipe"}).split(`
3
- `).slice(1).map(e=>e.trim()).filter(Boolean).map(e=>e.split(" ")[0]);return await a({message:"Select a package to run the script:",choices:t.map(e=>({name:e,value:e}))})}async function c(){return await a({message:"Select a mode to load different env files:",choices:[{name:"development",value:"development"},{name:"staging",value:"staging"},{name:"production",value:"production"}]})}r().name("turbo-select").description(`A CLI tool to filter and select a single package from the Turborepo package list and run a script command.
4
- Additionally, allow to prompt environment mode (development, staging, production), for example, when using Vite.`).requiredOption("--run <script>","The package script command to execute (e.g., --run=dev).").option("--select-env","An environment mode (development, staging, production) If using for example vite.").action(async({run:n,selectEnv:t})=>{try{console.log(u("magenta",`
5
- \u{1F680} Turbo-Select
6
- `));let e=await i(),o=t?await c():void 0;p(`turbo run ${n} --ui stream ${e?`--filter=${e}`:""} ${o?`-- --mode ${o}`:""}`,{encoding:"utf8",stdio:"inherit"})}catch(e){console.error(e),process.exit(1)}}).parseAsync(process.argv);
@@ -1 +0,0 @@
1
- {"formatter":{"enabled":true,"ignore":["**/node_modules/","**/dist/","**/out/","**/output","**/.output","**/build/","**/*.min.*","**/.yarn/","**/.yarnrc.yml","**/package-lock.json","**/yarn.lock","**/bun.lock","**/bun.lockb","**/pnpm-lock.yaml","**/.vite-inspect","**/.vitepress/cache","**/vite.config.*.timestamp-*","**/*.log","**/npm-debug.log*","**/yarn-debug.log*","**/yarn-error.log*",".pnp.*","**/.pnp","**/.pnp.js","**/.pnp.cjs","**/coverage/","**/.nyc_output/","**/__snapshots__","**/.vscode/","**/.idea/","**/.cache","**/.nuxt","**/.next","**/.svelte-kit","**/.vercel","**/.changeset","**/.turbo/","**/.DS_Store","**/Thumbs.db","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/mockServiceWorker.js","**/CHANGELOG*","**/LICENSE*"],"useEditorconfig":true,"formatWithErrors":false,"indentStyle":"space","indentWidth":2,"lineEnding":"lf","lineWidth":80,"attributePosition":"auto","bracketSpacing":true},"javascript":{"formatter":{"jsxQuoteStyle":"double","quoteProperties":"asNeeded","trailingCommas":"es5","semicolons":"always","arrowParentheses":"always","bracketSameLine":false,"quoteStyle":"single","attributePosition":"auto","bracketSpacing":true}},"overrides":[{"include":["**/*.hbs"]},{"include":["**/package.json"],"formatter":{"indentStyle":"space"}},{"include":["**/*.mdx"]}],"linter":{"enabled":false},"organizeImports":{"enabled":false}}
@@ -1 +0,0 @@
1
- import{FlatConfigComposer as M}from"eslint-flat-config-utils";import C from"globals";import{default as v}from"@eslint/js";import{default as d}from"@vitest/eslint-plugin";import{default as j}from"eslint-config-prettier";import{default as b}from"eslint-plugin-import-x";import{default as f}from"eslint-plugin-jsdoc";import{default as k}from"eslint-plugin-oxlint";import{default as I}from"eslint-plugin-perfectionist";import{default as w}from"eslint-plugin-unicorn";import{default as S}from"eslint-plugin-unused-imports";import{default as m}from"typescript-eslint";function F(e={},r,t){let o=e.linterOptions??{};return[{name:"yunarch/base/ignores",ignores:["**/node_modules/","**/dist/","**/out/","**/output","**/.output","**/build/","**/*.min.*","**/.yarn/","**/.yarnrc.yml","**/package-lock.json","**/yarn.lock","**/bun.lock","**/bun.lockb","**/pnpm-lock.yaml","**/.vite-inspect","**/.vitepress/cache","**/vite.config.*.timestamp-*","**/*.log","**/npm-debug.log*","**/yarn-debug.log*","**/yarn-error.log*",".pnp.*","**/.pnp","**/.pnp.js","**/.pnp.cjs","**/coverage/","**/.nyc_output/","**/__snapshots__","**/.vscode/","**/.idea/","**/.cache","**/.nuxt","**/.next","**/.svelte-kit","**/.vercel","**/.changeset","**/.turbo/","**/.DS_Store","**/Thumbs.db","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/mockServiceWorker.js","**/CHANGELOG*.md","**/LICENSE*",...r??[]]},{name:"yunarch/base/setup",languageOptions:{ecmaVersion:2022,globals:{...C.browser,...C.es2021,...C.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{...o,reportUnusedDisableDirectives:t?!1:o.reportUnusedDisableDirectives??!0}},{name:"yunarch/base/rules",plugins:{"unused-imports":S},rules:{...v.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"block-scoped-var":"error",camelcase:["error",{allow:["^UNSAFE_"],ignoreDestructuring:!1,properties:"never"}],curly:["error","multi-line","consistent"],"default-case-last":"error",eqeqeq:"error","func-names":["error","as-needed"],"grouped-accessor-pairs":"error","max-lines":["warn",300],"max-params":["warn",4],"new-cap":["error",{capIsNew:!1}],"no-alert":"error","no-array-constructor":"error","no-bitwise":"error","no-caller":"error","no-console":"error","no-constant-binary-expression":"error","no-constructor-return":"error","no-else-return":"warn","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-implicit-coercion":["error",{allow:["!!","+"]}],"no-implied-eval":"error","no-iterator":"error","no-label-var":"error","no-labels":"error","no-lone-blocks":"error","no-lonely-if":"warn","no-multi-assign":"error","no-nested-ternary":"error","no-new":"error","no-new-func":"error","no-new-wrappers":"error","no-octal-escape":"error","no-param-reassign":"error","no-promise-executor-return":"error","no-proto":"error","no-return-assign":"error","no-script-url":"error","no-self-compare":"error","no-sequences":"error","no-template-curly-in-string":"error","no-undef-init":"warn","no-unneeded-ternary":"error","no-unreachable-loop":"error","no-unused-expressions":"error","no-unused-vars":["error",{args:"none",caughtErrors:"none",ignoreRestSiblings:!0,vars:"all"}],"no-useless-call":"error","no-useless-computed-key":"warn","no-useless-concat":"error","no-useless-rename":"warn","no-useless-return":"warn","no-var":"error","no-void":["error",{allowAsStatement:!0}],"object-shorthand":"warn","prefer-const":"warn","prefer-named-capture-group":"error","prefer-numeric-literals":"error","prefer-object-has-own":"error","prefer-object-spread":"warn","prefer-promise-reject-errors":["error",{allowEmptyReject:!0}],"prefer-regex-literals":"error","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"warn","symbol-description":"error","unused-imports/no-unused-imports":"error","unused-imports/no-unused-vars":["error",{args:"after-used",argsIgnorePattern:"^_",ignoreRestSiblings:!0,vars:"all",varsIgnorePattern:"^_"}],yoda:"warn"}}]}var y="**/*.{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}",p="{js,jsx,cjs,cjsx,mjs,mjsx,ts,tsx,cts,ctsx,mts,mtjsx}",_="**/*.d.{ts,cts,mts}",c="**/*.{ts,cts,mts}",u="**/*.{tsx,ctsx,mtsx}",x="**/*.astro/*.ts",h="**/*.md",P=[`**/__tests__/**/*.${p}`,`**/*.spec.${p}`,`**/*.test.${p}`,`**/*.bench.${p}`,`**/*.benchmark.${p}`];function E(e){let{oxlint:r}=e;return[{name:"yunarch/disables/cli",files:[`**/scripts/${y}`,`**/tasks/${y}`,`**/bin/${y}`,`**/bin.${p}`,`**/cli/${y}`,`**/cli.${p}`],rules:{"@typescript-eslint/no-floating-promises":"off","no-console":"off","unicorn/no-process-exit":"off"}},{name:"yunarch/disables/dts",files:[_],rules:{"@typescript-eslint/consistent-indexed-object-style":"off","import/no-duplicates":"off","no-restricted-syntax":"off","unused-imports/no-unused-vars":"off"}},{name:"yunarch/disables/config-files",files:[`**/*.config.${p}`,`**/*.config.*.${p}`],rules:{"no-console":"off","@typescript-eslint/explicit-function-return-type":"off"}},{name:"yunarch/disables/prettier",rules:{...j.rules}},...r?.oxlintConfigPath?k.buildFromOxlintConfigFile(r.oxlintConfigPath):[]]}import{createTypeScriptImportResolver as J}from"eslint-import-resolver-typescript";import{createNodeResolver as K}from"eslint-plugin-import-x";function G(){return[{name:"yunarch/import/rules",plugins:{import:b},rules:{...b.flatConfigs.recommended.rules,"import/first":"error","import/newline-after-import":["error",{count:1}],"import/no-absolute-path":"error","import/no-amd":"error","import/no-cycle":["error",{ignoreExternal:!1,maxDepth:3}],"import/no-duplicates":["error",{"prefer-inline":!0}],"import/no-dynamic-require":"error","import/no-mutable-exports":"error","import/no-relative-packages":"error","import/no-self-import":"error","import/no-useless-path-segments":"error"},settings:{"import-x/resolver-next":[K()]}},{name:"yunarch/import/typescript/rules",files:[c,u],rules:{...b.flatConfigs.typescript.rules},settings:{"import-x/resolver-next":[J()]}}]}function L(){return[{name:"yunarch/jsdoc/rules",plugins:{jsdoc:f},rules:{...f.configs["flat/recommended-error"].rules,"jsdoc/check-param-names":["error",{checkDestructured:!1}],"jsdoc/lines-before-block":["error",{lines:0}],"jsdoc/require-hyphen-before-param-description":["error","always"],"jsdoc/require-param":["error",{checkDestructured:!1,enableRestElementFixer:!1}],"jsdoc/require-throws":"error","jsdoc/tag-lines":["error","any",{startLines:1}]}},{name:"yunarch/jsdoc/typescript/rules",files:[c,u],rules:{...f.configs["flat/recommended-typescript-error"].rules,...f.configs["flat/contents-typescript-error"].rules,...f.configs["flat/logical-typescript-error"].rules,...f.configs["flat/stylistic-typescript-error"].rules,"jsdoc/require-hyphen-before-param-description":["error","always"],"jsdoc/require-param":["error",{checkDestructured:!1,enableRestElementFixer:!1}],"jsdoc/require-throws":"error"}}]}function R(){return[{name:"yunarch/perfectionist/rules",plugins:{perfectionist:I},rules:{"perfectionist/sort-exports":["error",{order:"asc",type:"natural"}],"perfectionist/sort-imports":["error",{groups:["builtin","external","internal",["parent","sibling","index"],"side-effect","object","unknown"],newlinesBetween:"never",order:"asc",type:"natural"}],"perfectionist/sort-named-exports":["error",{order:"asc",type:"natural"}],"perfectionist/sort-named-imports":["error",{groupKind:"values-first",order:"asc",type:"natural"}],"import/order":"off","import-x/order":"off","sort-imports":"off"}}]}async function l(e){let r=await e;return typeof r=="object"&&r&&"default"in r?r.default:r}async function A(e){let[r,t,o]=await Promise.all([l(import("@eslint-react/eslint-plugin")),l(import("eslint-plugin-react-hooks")),l(import("eslint-plugin-react-refresh"))]),s=r.configs.all.plugins;return[{name:"yunarch/react/setup",plugins:{"@eslint-react":s["@eslint-react"],"@eslint-react/dom":s["@eslint-react/dom"],"@eslint-react/hooks-extra":s["@eslint-react/hooks-extra"],"@eslint-react/naming-convention":s["@eslint-react/naming-convention"],"@eslint-react/web-api":s["@eslint-react/web-api"],"react-hooks":t,"react-refresh":o}},{name:"yunarch/react/rules",files:[y],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}},sourceType:"module"},rules:{...r.configs.recommended.rules,...t.configs.recommended.rules,...o.configs.recommended.rules}},...e.isTypescriptEnabled?[{name:"yunarch/react/typescript/rules",files:[c,u],ignores:[`${h}/**`,x],languageOptions:{parserOptions:{projectService:!0}},rules:{...r.configs["recommended-typescript"].rules,...e.isTypeAware?{...r.configs["recommended-type-checked"].rules}:{}}}]:[]]}async function B(e){let r=e===!0||e.enableQuery,t=e===!0||e.enableRouter,o=[];if(r){let s=await l(import("@tanstack/eslint-plugin-query"));o.push({name:"yunarch/tanstack/query/rules",plugins:{"@tanstack/query":s},rules:{...s.configs["flat/recommended"].at(0)?.rules}})}if(t){let s=await l(import("@tanstack/eslint-plugin-router"));o.push({name:"yunarch/tanstack/router/rules",plugins:{"@tanstack/router":s},rules:{...s.configs["flat/recommended"].at(0)?.rules}})}return o}function D(e){let{enableTypeTesting:r}=e;return[{name:"yunarch/test/setup",plugins:{vitest:d},...r?{settings:{vitest:{typecheck:!0}},languageOptions:{globals:{...d.environments.env.globals}}}:{}},{name:"yunarch/test/rules",files:[...P],rules:{...d.configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"it",withinDescribe:"it"}],"vitest/prefer-hooks-in-order":"error","vitest/prefer-lowercase-title":"error"}}]}function N(e,r,t){return{name:e,files:r,...t.ignores?{ignores:t.ignores}:{},languageOptions:{parser:m.parser,parserOptions:{extraFileExtensions:t.extraFileExtensions?.map(o=>`.${o}`),sourceType:"module",...t.tsconfigPath?{projectService:{allowDefaultProject:["./*.js"],defaultProject:t.tsconfigPath},tsconfigRootDir:process.cwd()}:{},...t.parserOptions}}}}function $(e,r=[]){let t=[c,u],o=e.filesTypeAware??[c,u],s=e.ignoresTypeAware??[`${h}/**`,x];return[{name:"yunarch/typescript/setup",plugins:{"@typescript-eslint":m.plugin}},N("yunarch/typescript/parser",t,{ignores:void 0,extraFileExtensions:r,parserOptions:e.parserOptions}),...e.tsconfigPath?[N("yunarch/typescript/parser/type-aware",o,{ignores:s,extraFileExtensions:r,parserOptions:e.parserOptions,tsconfigPath:e.tsconfigPath})]:[],{name:"yunarch/typescript/rules",files:t,rules:{...m.configs.eslintRecommended.rules,...m.configs.strict.at(-1)?.rules,...m.configs.stylistic.at(-1)?.rules,"@typescript-eslint/ban-ts-comment":["error",{"ts-expect-error":"allow-with-description"}],"@typescript-eslint/consistent-type-definitions":"off","@typescript-eslint/consistent-type-imports":["error",{disallowTypeAnnotations:!1,fixStyle:"inline-type-imports",prefer:"type-imports"}],"@typescript-eslint/default-param-last":"error","@typescript-eslint/explicit-function-return-type":"off","@typescript-eslint/method-signature-style":["error","property"],"@typescript-eslint/naming-convention":["error",{format:["PascalCase"],selector:["typeLike"]},{format:["UPPER_CASE"],selector:["enumMember"]},{custom:{match:!1,regex:"^I[A-Z]|^(Interface|Props|State)$"},format:["PascalCase"],selector:"interface"}],"@typescript-eslint/no-dupe-class-members":"error","@typescript-eslint/no-empty-object-type":["error",{allowInterfaces:"always"}],"@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-loop-func":"error","@typescript-eslint/no-redeclare":["error",{builtinGlobals:!1}],"@typescript-eslint/no-shadow":"error","@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-use-before-define":["error",{classes:!1,functions:!1,variables:!0}],"@typescript-eslint/no-useless-empty-export":"warn","@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0,allowBoolean:!0}],"@typescript-eslint/unified-signatures":["error",{ignoreDifferentlyNamedParameters:!0,ignoreOverloadsWithDifferentJSDoc:!0}]}},...e.tsconfigPath&&!e.disableTypeAware?[{name:"yunarch/typescript/rules/type-aware",files:o,ignores:s,rules:{...m.configs.strictTypeCheckedOnly.at(-1)?.rules,...m.configs.stylisticTypeCheckedOnly.at(-1)?.rules,"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/require-array-sort-compare":["error",{ignoreStringArrays:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0,allowBoolean:!0}],"@typescript-eslint/switch-exhaustiveness-check":"warn"}}]:[]]}function q(){return[{name:"yunarch/unicorn/rules",plugins:{unicorn:w},rules:{...w.configs.recommended.rules,"unicorn/filename-case":["error",{cases:{camelCase:!0,kebabCase:!0,pascalCase:!0}}],"unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/prefer-number-properties":["error",{checkInfinity:!0,checkNaN:!0}],"unicorn/prefer-top-level-await":"warn","unicorn/prevent-abbreviations":"off"}}]}function Q(e={},...r){let{gitignore:t=!0,ignores:o,extraFileExtensions:s,import:U=!0,jsdoc:X=!0,unicorn:V=!0,oxlint:O}=e,W=!!O,a=[];t&&(typeof t=="boolean"?a.push(l(import("eslint-config-flat-gitignore")).then(T=>[T({name:"yunarch/gitignore",strict:!1})])):a.push(l(import("eslint-config-flat-gitignore")).then(T=>[T({name:"yunarch/gitignore",...t})]))),a.push(F(e.base,o,W)),e.typescript&&a.push($(e.typescript===!0?{}:e.typescript,s)),U&&a.push(G()),X&&a.push(L()),V&&a.push(q()),e.test&&a.push(D(e.test===!0?{}:e.test)),e.tanstack&&a.push(B(e.tanstack)),e.react&&a.push(A({isTypescriptEnabled:!!e.typescript,isTypeAware:typeof e.typescript=="object"&&!!e.typescript.tsconfigPath&&!e.typescript.disableTypeAware})),a.push(R(),E({oxlint:O}));let g=new M;return g=g.append(...a,...r),g=g.renamePlugins({"import-x":"import"}),g}export{Q as config};