chore: lint
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import typescript from "rollup-plugin-ts"
|
||||
import {lezer} from "@lezer/generator/rollup"
|
||||
import { lezer } from "@lezer/generator/rollup"
|
||||
|
||||
export default {
|
||||
input: "src/index.js",
|
||||
external: id => id != "tslib" && !/^(\.?\/|\w:)/.test(id),
|
||||
external: (id) => id != "tslib" && !/^(\.?\/|\w:)/.test(id),
|
||||
output: [
|
||||
{file: "dist/index.cjs", format: "cjs"},
|
||||
{dir: "./dist", format: "es"}
|
||||
{ file: "dist/index.cjs", format: "cjs" },
|
||||
{ dir: "./dist", format: "es" },
|
||||
],
|
||||
plugins: [lezer(), typescript()]
|
||||
plugins: [lezer(), typescript()],
|
||||
}
|
||||
|
||||
@@ -1,22 +1,30 @@
|
||||
import {parser} from "./syntax.grammar"
|
||||
import {LRLanguage, LanguageSupport, indentNodeProp, foldNodeProp, foldInside, delimitedIndent} from "@codemirror/language"
|
||||
import {styleTags, tags as t} from "@codemirror/highlight"
|
||||
import { parser } from "./syntax.grammar"
|
||||
import {
|
||||
LRLanguage,
|
||||
LanguageSupport,
|
||||
indentNodeProp,
|
||||
foldNodeProp,
|
||||
foldInside,
|
||||
delimitedIndent,
|
||||
} from "@codemirror/language"
|
||||
import { styleTags, tags as t } from "@codemirror/highlight"
|
||||
|
||||
export const GQLLanguage = LRLanguage.define({
|
||||
parser: parser.configure({
|
||||
props: [
|
||||
indentNodeProp.add({
|
||||
"SelectionSet FieldsDefinition ObjectValue SchemaDefinition RootTypeDef": delimitedIndent({ closing: "}", align: true }),
|
||||
"SelectionSet FieldsDefinition ObjectValue SchemaDefinition RootTypeDef":
|
||||
delimitedIndent({ closing: "}", align: true }),
|
||||
}),
|
||||
foldNodeProp.add({
|
||||
Application: foldInside,
|
||||
"SelectionSet FieldsDefinition ObjectValue RootOperationTypeDefinition RootTypeDef": (node) => {
|
||||
return {
|
||||
from: node.from,
|
||||
to: node.to
|
||||
}
|
||||
|
||||
}
|
||||
"SelectionSet FieldsDefinition ObjectValue RootOperationTypeDefinition RootTypeDef":
|
||||
(node) => {
|
||||
return {
|
||||
from: node.from,
|
||||
to: node.to,
|
||||
}
|
||||
},
|
||||
}),
|
||||
styleTags({
|
||||
Name: t.definition(t.variableName),
|
||||
@@ -29,13 +37,13 @@ export const GQLLanguage = LRLanguage.define({
|
||||
NullValue: t.null,
|
||||
ObjectValue: t.brace,
|
||||
Comment: t.lineComment,
|
||||
})
|
||||
]
|
||||
}),
|
||||
],
|
||||
}),
|
||||
languageData: {
|
||||
commentTokens: { line: "#" },
|
||||
closeBrackets: { brackets: ["(", "[", "{", '"', '"""'] }
|
||||
}
|
||||
closeBrackets: { brackets: ["(", "[", "{", '"', '"""'] },
|
||||
},
|
||||
})
|
||||
|
||||
export function GQL() {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"newLine": "lf",
|
||||
"declaration": true,
|
||||
"moduleResolution": "node",
|
||||
"allowJs": true,
|
||||
"allowJs": true
|
||||
},
|
||||
"include": ["src/*"]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user