5.0.0 • Published 9 months ago

cosmiconfig-typescript-loader v5.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

cosmiconfig-typescript-loader

⚙️🚀 TypeScript config file support for cosmiconfig

build codecov npm

Usage

Simply add TypeScriptLoader to the list of loaders for the .ts file type:

import { cosmiconfig } from "cosmiconfig";
import { TypeScriptLoader } from "cosmiconfig-typescript-loader";

const moduleName = "module";
const explorer = cosmiconfig("test", {
  searchPlaces: [
    "package.json",
    `.${moduleName}rc`,
    `.${moduleName}rc.json`,
    `.${moduleName}rc.yaml`,
    `.${moduleName}rc.yml`,
    `.${moduleName}rc.js`,
    `.${moduleName}rc.ts`,
    `.${moduleName}rc.cjs`,
    `${moduleName}.config.js`,
    `${moduleName}.config.ts`,
    `${moduleName}.config.cjs`,
  ],
  loaders: {
    ".ts": TypeScriptLoader(),
  },
});

const cfg = explorer.load("./");

Or more simply if you only support loading of a TypeScript based configuration file:

import { cosmiconfig } from "cosmiconfig";
import { TypeScriptLoader } from "cosmiconfig-typescript-loader";

const moduleName = "module";
const explorer = cosmiconfig("test", {
  loaders: {
    ".ts": TypeScriptLoader(),
  },
});

const cfg = explorer.load("./amazing.config.ts");

@endemolshinegroup/cosmiconfig-typescript-loader

This package serves as a drop in replacement for @endemolshinegroup/cosmiconfig-typescript-loader. At the time of publishing this, endemolshinegroup is not maintaining the original package. I can only assume this is to do with the fact that Endemol Shine Group was purchased and absorbed by another business. This discontinuation of development efforts towards the original package left any open issues and pull requests unresolved.

This new package resolves the following original issues:

  • #134: "Doesn't work with Cosmiconfig sync API"
  • #147: "doesn't provide typescript, requested by ts-node"
  • #155: "Misleading TypeScriptCompileError when user's tsconfig.json "module" is set to "es2015""
@commitlint/loadreact-native-shekhar-bridge-test@oiti/documentoscopy-react-nativequoc-testinflintdocu-notion-dashwaveluminos-ui-core@everything-registry/sub-chunk-1390jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgreact-native-jawwy_sampleproject-wajs-dvsmart_one_connectrn-counter-demorn-agora-ios-m@procoders/transmart-cli@praella/localisationist@sillsdev/docu-notionreact-native-responsive-helperreact-native-shared-gesturereact-native-rn-appreact-native-rn-icons-libraryreact-native-radio-bic-group-libreact-native-screen-idle-timerreact-native-sandycomponentreact-native-rtn-ips-poslin-testreact-native-recent-framework-updatereact-native-reanimated-sortable-listreact-native-tilt-blereact-native-simple-timelinereact-native-teads-sdk-modulereact-native-tejab41097-sample-libraryreact-native-teknoctrl-componentsreact-native-test-comlibraryreact-native-tone-frameworkreact-native-xprinter-thermal-blereact-native-volume-phisicalreact-native-uvc-camera-androidreact-native-withframework-checkreact-native-app-bubblereact-native-auth-service-clientreact-native-awesome-module-latestreact-native-awesome-module-tworeact-native-bleccs-componentsreact-native-bluetooth-device-detectreact-native-check-componentreact-native-dhp-printerreact-native-dimensions-layoutreact-native-components-designreact-native-custom-image-carouselreact-native-fedlight-dsmreact-native-klarify-uireact-native-lib-test-rn-1react-native-library-testing-422522react-native-loyalty-platformsreact-native-module-argereact-native-input-libraryreact-native-multiplier-componentreact-native-multiplier-demoreact-native-multiplier2react-native-multiplyreact-native-nativewindrefinejs-repoquickcapture_react_nativereat-native-multiplierkprreactnatively@react-native-ui-design/button@sephriot/react-native-persistable-uri@thinxviewx/core-rn@transmart-next/cli@transmart/cli@xylabs/ts-scripts-yarn3@tilework/mosaic-cracotimbo-cz-conventional-changelog@ppaquin/craco@soyjak/utils@taingo97/react-native-bluetooth-xprinter@taingo97/react-native-print-xprinterjawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwytest_lib_module_aarevanutilsefficiency-tool-clifix-lockfile-integrityframework_test_library_sixdeeframework_test_library_sixdee_newframework_test_library_sixdee_new_newfrdrk-js-semaphorefluent.adflow.reactnativesdkfluent.adflow.reactnativesdk-alphagenz-native-elementsgeniusdevs-configgraphql-codegen-cli-nuxt@exlint.io/inflint
5.0.0

9 months ago

4.4.0

9 months ago

4.3.0

1 year ago

4.2.0

1 year ago

4.1.0

2 years ago

4.1.1

2 years ago

2.0.2

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

4.0.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago