Skip to content

Commit c8f5c71

Browse files
authored
feat(attw): improve ignoreRules type to autocomplete known values (#892)
1 parent 9311e9a commit c8f5c71

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

dts.snapshot.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
"#exports": []
115115
},
116116
"types-!~{00b}~.d.mts": {
117-
"AttwOptions": "interface AttwOptions extends CheckPackageOptions {\n module?: typeof _$_arethetypeswrong_core0\n profile?: 'strict' | 'node16' | 'esm-only'\n level?: 'error' | 'warn'\n ignoreRules?: string[]\n}",
117+
"AttwOptions": "interface AttwOptions extends CheckPackageOptions {\n module?: typeof _$_arethetypeswrong_core0\n profile?: 'strict' | 'node16' | 'esm-only'\n level?: 'error' | 'warn'\n ignoreRules?: ('no-resolution' | 'untyped-resolution' | 'false-cjs' | 'false-esm' | 'cjs-resolves-to-esm' | 'fallback-condition' | 'cjs-only-exports-default' | 'named-exports' | 'false-export-default' | 'missing-export-equals' | 'unexpected-module-syntax' | 'internal-resolution-error' | (string & {}))[]\n}",
118118
"BuildContext": "interface BuildContext {\n options: ResolvedConfig\n hooks: Hookable<TsdownHooks>\n}",
119119
"ChunkAddon": "type ChunkAddon = ChunkAddonObject | ChunkAddonFunction | string",
120120
"ChunkAddonFunction": "type ChunkAddonFunction = (_: { format: Format; fileName: string }) => ChunkAddonObject | string | undefined",

src/features/pkg/attw.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,21 @@ export interface AttwOptions extends CheckPackageOptions {
7676
* ignoreRules: ['no-resolution', 'false-cjs']
7777
* ```
7878
*/
79-
ignoreRules?: string[]
79+
ignoreRules?: (
80+
| 'no-resolution'
81+
| 'untyped-resolution'
82+
| 'false-cjs'
83+
| 'false-esm'
84+
| 'cjs-resolves-to-esm'
85+
| 'fallback-condition'
86+
| 'cjs-only-exports-default'
87+
| 'named-exports'
88+
| 'false-export-default'
89+
| 'missing-export-equals'
90+
| 'unexpected-module-syntax'
91+
| 'internal-resolution-error'
92+
| (string & {})
93+
)[]
8094
}
8195

8296
/**

0 commit comments

Comments
 (0)