Skip to content

Commit ddffb1f

Browse files
committed
refactor: Used named exports
1 parent 63b5b16 commit ddffb1f

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

src/main.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
import type { Plugin } from 'prettier';
2-
3-
import { languages } from './languages.js';
4-
import { options } from './options.js';
5-
import { parsers } from './parsers.js';
6-
import { printers } from './printers.js';
7-
import type { NodeType } from './utils/index.js';
8-
9-
const plugin: Plugin<NodeType> = {
10-
languages,
11-
parsers,
12-
printers,
13-
options,
14-
};
15-
16-
export default plugin;
1+
export { languages } from './languages.js';
2+
export { options } from './options.js';
3+
export { parsers } from './parsers.js';
4+
export { printers } from './printers.js';

tests/helpers/format.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import type { Plugin } from 'prettier';
22
import { format as prettierFormat } from 'prettier';
33

4-
import plugin from '../../src/main.js';
4+
import { languages, options, parsers, printers } from '../../src/main.js';
55
import type { PluginOptions } from '../../src/options.js';
66

7-
const DEFAULT_OPTIONS: Partial<PluginOptions> = {
8-
parser: 'ember-template-tag',
9-
plugins: [plugin as Plugin],
7+
const plugin: Plugin = {
8+
languages,
9+
options,
10+
parsers,
11+
printers,
1012
};
1113

1214
/**
@@ -20,7 +22,8 @@ export async function format(
2022
overrides: Partial<PluginOptions> = {},
2123
): Promise<string> {
2224
return await prettierFormat(code, {
23-
...DEFAULT_OPTIONS,
2425
...overrides,
26+
parser: 'ember-template-tag',
27+
plugins: [plugin],
2528
});
2629
}

0 commit comments

Comments
 (0)