Skip to content

Commit d579ddd

Browse files
authored
Merge PR #389: Throw error when unsupported aliasAs config used
2 parents d91f36e + c12ca8a commit d579ddd

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/sqlFormatter.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ function validateConfig(cfg: FormatOptions): FormatOptions {
8989
if ('newlineBeforeCloseParen' in cfg) {
9090
throw new ConfigError('newlineBeforeCloseParen config is no more supported.');
9191
}
92+
if ('aliasAs' in cfg) {
93+
throw new ConfigError('aliasAs config is no more supported.');
94+
}
9295

9396
if (cfg.expressionWidth <= 0) {
9497
throw new ConfigError(

test/sqlFormatter.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,10 @@ describe('sqlFormatter', () => {
4242
format('SELECT *', { newlineBeforeCloseParen: true } as any);
4343
}).toThrow('newlineBeforeCloseParen config is no more supported.');
4444
});
45+
46+
it('throws error when aliasAs config option used', () => {
47+
expect(() => {
48+
format('SELECT *', { aliasAs: 'always' } as any);
49+
}).toThrow('aliasAs config is no more supported.');
50+
});
4551
});

0 commit comments

Comments
 (0)