Skip to content

Commit d237712

Browse files
committed
fixup types and exports in index.ts
it seems we don't need to export languages anymore, so I guess I'll just remove it!
1 parent 40dea58 commit d237712

File tree

1 file changed

+6
-30
lines changed

1 file changed

+6
-30
lines changed

src/index.ts

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {multilineArrayPrinter} from './printer/multiline-array-printer';
1919
export * from './options';
2020
export {pluginMarker} from './plugin-marker';
2121

22-
const parsers: Record<string, Parser<any>> = mapObjectValues(
22+
export const parsers: Record<string, Parser<any>> = mapObjectValues(
2323
{
2424
typescript: tsParsers.typescript,
2525
babel: babelParsers.babel,
@@ -28,7 +28,7 @@ const parsers: Record<string, Parser<any>> = mapObjectValues(
2828
json5: babelParsers.json5,
2929
},
3030
(languageName, parserEntry) => {
31-
return wrapParser(parserEntry as any, languageName);
31+
return wrapParser(parserEntry, languageName);
3232
},
3333
);
3434

@@ -37,7 +37,7 @@ const printers: Record<string, Printer<any>> = {
3737
'estree-json': multilineArrayPrinter,
3838
};
3939

40-
const options: Record<keyof MultilineArrayOptions, SupportOption> = getObjectTypedKeys(
40+
export const options: Record<keyof MultilineArrayOptions, SupportOption> = getObjectTypedKeys(
4141
defaultMultilineArrayOptions,
4242
).reduce(
4343
(accum, key) => {
@@ -49,46 +49,22 @@ const options: Record<keyof MultilineArrayOptions, SupportOption> = getObjectTyp
4949
| 'boolean'
5050
| 'int',
5151
category: 'multilineArray',
52-
since: '0.0.1',
5352
default: defaultValue as any,
5453
description: optionHelp[key],
55-
} as any;
54+
};
5655
accum[key] = supportOption;
5756
return accum;
5857
},
5958
{} as Record<keyof MultilineArrayOptions, SupportOption>,
6059
);
6160

62-
const defaultOptions: Partial<RequiredOptions> & Required<MultilineArrayOptions> =
61+
export const defaultOptions: Partial<RequiredOptions> & Required<MultilineArrayOptions> =
6362
defaultMultilineArrayOptions;
6463

65-
const languages = [
66-
{
67-
name: 'JavaScript',
68-
parsers: [
69-
'babel',
70-
'acorn',
71-
'espree',
72-
'meriyah',
73-
'babel-flow',
74-
'babel-ts',
75-
'flow',
76-
'typescript',
77-
],
78-
},
79-
{name: 'TypeScript', parsers: ['typescript', 'babel-ts']},
80-
{name: 'JSON.stringify', parsers: ['json-stringify']},
81-
{name: 'JSON', parsers: ['json']},
82-
{name: 'JSON with Comments', parsers: ['json']},
83-
{name: 'JSON5', parsers: ['json5']},
84-
];
85-
64+
/** Not actually exported: this is just for type checking purposes. */
8665
const plugin: Plugin = {
8766
options,
8867
printers,
8968
defaultOptions,
9069
parsers,
91-
languages,
9270
};
93-
94-
export {defaultOptions, options, parsers};

0 commit comments

Comments
 (0)