File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -888,12 +888,24 @@ Some options offer more advanced configuration using a function definition. Thes
888888For example, ` .ncurc .js ` :
889889
890890` ` ` js
891+ /** @type {import('npm-check-updates').RcOptions } */
891892module .exports = {
892893 upgrade: true ,
893894 filter : name => name .startsWith (' @myorg/' ),
894895}
895896` ` `
896897
898+ Alternatively, you can use the defineConfig helper which should provide intellisense without the need for jsdoc annotations:
899+
900+ ` ` ` js
901+ const { defineConfig } = require (' npm-check-updates' )
902+
903+ module .exports = defineConfig ({
904+ upgrade: true ,
905+ filter : name => name .startsWith (' @myorg/' ),
906+ })
907+ ` ` `
908+
897909### JSON Schema
898910
899911If you write ` .ncurc ` config files using json or yaml, you can add the JSON Schema to your IDE settings for completions.
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ import { PackageInfo } from './types/PackageInfo'
2323import { RunOptions } from './types/RunOptions'
2424import { VersionSpec } from './types/VersionSpec'
2525
26+ export { default as defineConfig } from './lib/defineConfig'
27+ export type { RcOptions } from './types/RcOptions'
28+
2629// allow prompt injection from environment variable for testing purposes
2730if ( process . env . INJECT_PROMPTS ) {
2831 prompts . inject ( JSON . parse ( process . env . INJECT_PROMPTS ) )
Original file line number Diff line number Diff line change 1+ import type { RcOptions } from '../types/RcOptions'
2+
3+ /**
4+ * TypeScript helper for .npmrc config file. Similar to vite and eslint's
5+ * defineConfig helper
6+ */
7+ function defineConfig ( config : RcOptions ) {
8+ return config
9+ }
10+
11+ export default defineConfig
You can’t perform that action at this time.
0 commit comments