0.0.1-alpha.3
- 修改??运算符为|| 并添加到eslint忽略规则中
This commit is contained in:
parent
4b08e6e892
commit
586ac419e4
@ -16,3 +16,4 @@ rules:
|
|||||||
'@typescript-eslint/space-before-function-paren': off
|
'@typescript-eslint/space-before-function-paren': off
|
||||||
'@typescript-eslint/explicit-function-return-type': off
|
'@typescript-eslint/explicit-function-return-type': off
|
||||||
'@typescript-eslint/no-unsafe-argument': off
|
'@typescript-eslint/no-unsafe-argument': off
|
||||||
|
'@typescript-eslint/prefer-nullish-coalescing': off
|
||||||
|
12
src/index.ts
12
src/index.ts
@ -10,18 +10,18 @@ export class DtSqlParserSemAnalysePlugin {
|
|||||||
private readonly settings: PluginSettings = {}
|
private readonly settings: PluginSettings = {}
|
||||||
|
|
||||||
constructor (settings?: PluginSettings) {
|
constructor (settings?: PluginSettings) {
|
||||||
this.settings = settings ?? {}
|
this.settings = settings || {}
|
||||||
}
|
}
|
||||||
|
|
||||||
public parse (sql: string, caret?: InsertCaretPlaceholderConfig) {
|
public parse (sql: string, caret?: InsertCaretPlaceholderConfig) {
|
||||||
const sqlAfterInsertCaret = insertCaret(sql, caret)
|
const sqlAfterInsertCaret = insertCaret(sql, caret)
|
||||||
const sqlAfterPreprocess = preprocess(sqlAfterInsertCaret, this.settings.preprocessor ?? defaultPreprocessorList)
|
const sqlAfterPreprocess = preprocess(sqlAfterInsertCaret, this.settings.preprocessor || defaultPreprocessorList)
|
||||||
const sqlParseResult = parse(
|
const sqlParseResult = parse(
|
||||||
sqlAfterPreprocess,
|
sqlAfterPreprocess,
|
||||||
this.settings.parse?.parser ?? new PostgresSQL(),
|
this.settings.parse?.parser || new PostgresSQL(),
|
||||||
this.settings.parse?.stmts ?? defaultStmts,
|
this.settings.parse?.stmts || defaultStmts,
|
||||||
this.settings.parse?.entities ?? defaultEntities,
|
this.settings.parse?.entities || defaultEntities,
|
||||||
this.settings.parse?.rules ?? defaultRules
|
this.settings.parse?.rules || defaultRules
|
||||||
)
|
)
|
||||||
return sqlParseResult
|
return sqlParseResult
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user