|
| 1 | +type ReplaceRule = { |
| 2 | + /** e.g. `readFile`, `^readFile` (global) or `fs.readFile` */ |
| 3 | + suggestion: string |
| 4 | + /** @experimental Additional filter */ |
| 5 | + package?: string |
| 6 | + // action |
| 7 | + remove?: boolean |
| 8 | + patch?: Partial<{ |
| 9 | + name: string |
| 10 | + kind: string |
| 11 | + /** Might be useless when `correntSorting.enable` is true */ |
| 12 | + sortText: string |
| 13 | + /** Generally not recommended */ |
| 14 | + // kindModifiers: string |
| 15 | + insertText: string |
| 16 | + }> |
| 17 | + /** Works only with `correntSorting.enable` set to true (default) */ |
| 18 | + movePos?: number |
| 19 | + // or |
| 20 | + insertAfter?: string |
| 21 | + /** Not recommended to use as it would override possible `?` insertion */ |
| 22 | + // replaceExisting?: string |
| 23 | +} |
| 24 | + |
| 25 | +// TODO support scripting |
| 26 | +export type Configuration = { |
| 27 | + /** |
| 28 | + * Removes `Symbol`, `caller`, `prototype` |
| 29 | + * @default true |
| 30 | + * */ |
| 31 | + 'removeUselessFunctionProps.enable': boolean |
| 32 | + /** |
| 33 | + * Useful for Number types. |
| 34 | + * Patch `toString()`: |
| 35 | + * 1. Move it above others to... |
| 36 | + * 2. Remove arg tabstop |
| 37 | + * @default true |
| 38 | + */ |
| 39 | + 'patchToString.enable': boolean |
| 40 | + /** |
| 41 | + * |
| 42 | + * @default true |
| 43 | + */ |
| 44 | + 'patchArrayMethods.enable': boolean |
| 45 | + /** |
| 46 | + * Highlight and lift non-function methods. Also applies for static class methods. Uses `bind`, `call`, `caller` detection. |
| 47 | + * @default true |
| 48 | + * */ |
| 49 | + 'highlightNonFunctionMethods.enable': boolean |
| 50 | + /** |
| 51 | + * Use originl sorting of suggestions (almost like in WebStorm) |
| 52 | + * @default true |
| 53 | + * */ |
| 54 | + 'correntSorting.enable': boolean |
| 55 | + // TODO |
| 56 | + /** |
| 57 | + * Mark QuickFixes & refactorings with 🔵 |
| 58 | + * @default true |
| 59 | + * */ |
| 60 | + 'markTsCodeActions.enable': boolean |
| 61 | + // TODO |
| 62 | + /** |
| 63 | + * Reveal import statement as definition instead of real definition |
| 64 | + * @default true |
| 65 | + * */ |
| 66 | + 'importUpDefinition.enable': boolean |
| 67 | + /** |
| 68 | + * @default true |
| 69 | + * */ |
| 70 | + 'postfixSupport.enable': boolean |
| 71 | + /** |
| 72 | + * @experimental |
| 73 | + * Only tag support |
| 74 | + * @default true |
| 75 | + * */ |
| 76 | + 'jsxPseudoEmmet.enable': boolean |
| 77 | + /** |
| 78 | + * Sorting matters |
| 79 | + * @default { div: true, span: true, input: "<input $1/>", p:true, form: true, footer: true, section: true, select: true } |
| 80 | + */ |
| 81 | + 'jsxPseudoEmmet.tags': { [tag: string]: true | string } |
| 82 | + // 'eventTypePatching.enable': boolean |
| 83 | + // 'globalTypedQuerySelector.enable': boolean, |
| 84 | + /** |
| 85 | + * For DX in JS projects only! |
| 86 | + * @default true |
| 87 | + */ |
| 88 | + // 'wrapDefaultExports.enable': boolean, |
| 89 | + // 'wrapDefaultExports.map': {[relativePathGlob: string]: [string, string]}, |
| 90 | + // 'specialGlobalTypes' |
| 91 | + // AS SEPARATE! |
| 92 | + // TODO |
| 93 | + /** Diagnostics (if not handled by eslint) & completions */ |
| 94 | + // 'dotImportsMap.enable': boolean, |
| 95 | + replaceSuggestions: ReplaceRule[] |
| 96 | +} |
0 commit comments