Comments (6)
No longer needed, thanks for your work!
from prettier.
Here is one possible way to address our concern without needing to many changes or dev burden, if it is acceptable to you.
So we can use the named export ReadonlySqlPlugin
in our plugin to extract all the supported choices of language
and database
.
diff --git a/packages/sql/src/index.ts b/packages/sql/src/index.ts
index 81ceb70..84511b4 100644
--- a/packages/sql/src/index.ts
+++ b/packages/sql/src/index.ts
@@ -5,6 +5,7 @@ import type { AST, Option } from 'node-sql-parser'
import nodeSqlParser from 'node-sql-parser'
import type { Options, ParserOptions, Plugin } from 'prettier'
import { format, type FormatOptions } from 'sql-formatter'
+import type { ReadonlyDeep } from 'type-fest'
import { languages } from './languages.js'
@@ -32,7 +33,7 @@ export type SqlOptions = ParserOptions<AST> & SqlBaseOptions
export type SqlFormatOptions = Options & SqlBaseOptions
-const SqlPlugin: Plugin<AST | string> = {
+export const ReadonlySqlPlugin = {
languages,
parsers: {
sql: {
@@ -413,6 +414,6 @@ const SqlPlugin: Plugin<AST | string> = {
],
},
},
-}
+} as const satisfies ReadonlyDeep<Plugin<AST | string>>
-export default SqlPlugin
+export default ReadonlySqlPlugin as unknown as Plugin<AST | string>
from prettier.
I'll take a look soon.
from prettier.
I think this should reopen?
Or you should access them via SqlPlugin.options
:
prettier/packages/sql/src/index.ts
Line 114 in 91bdd9f
prettier/packages/sql/src/index.ts
Line 363 in 91bdd9f
from prettier.
I think I can just use several common names as the default identifiers: https://github.com/Sec-ant/prettier-plugin-embed/blob/2c2efc50ba500189f809317dfc44bfee505411d8/src/embedded/sql/options.ts#L69
And those export types are not actually used anywhere. I should update that part of the code.
from prettier.
And those export types are not actually used anywhere. I should update that part of the code.
Good to know.
from prettier.
Related Issues (20)
- [prettier-plugin-sh] Fails in Dockerfile using "RUN if" HOT 4
- [prettier-plugin-sql] Can I use prettier-plugin-sql with prettier standalone API? HOT 1
- [prettier-plugin-sql] enable SQLite HOT 1
- prettier-sql: How to configure it? HOT 1
- `[error] Couldn't resolve parser "sh".` when upgrading to Prettier 3.1.0 HOT 14
- [prettier-plugin-sql] prefix option names to prevent name collisions HOT 6
- prettier-plugin-sql: Update to sql-formatter@14? HOT 2
- [prettier-plugin-toml] unable to format `toml` programmatically in an es module HOT 6
- prettier-plugin-sql: Allow `dialect` as alternative to `language` HOT 6
- Possibility of updating the license again? HOT 2
- prettier-plugin-sql: Upgrade to sql-formatter@15 HOT 1
- Error with cjs version of prettier-plugin-sql `Cannot read properties of undefined (reading 'parse')` HOT 7
- Idea: `eslint` as a plugin for `prettier` HOT 1
- prettier-plugin-sh fails to format standard VisualStudio.gitignore file HOT 1
- [prettier-plugin-sh] Incorrectly splits RUN command HOT 5
- prettier-plugin-sh: support .nvmrc files? HOT 7
- [prettier-plugin-sh]: automatic parser detection for `.husky/*` files. HOT 1
- [warn] embeddedSqlIdentifiers is deprecated. HOT 1
- Is there an SQL Server version of prettier-plugin-sql plugin? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier.