Browse Source

chore: lint

liyasthomas 3 years ago
parent
commit
ffd1acdfae

+ 5 - 5
packages/codemirror-lang-graphql/rollup.config.js

@@ -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()],
 }

+ 23 - 15
packages/codemirror-lang-graphql/src/index.js

@@ -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() {

+ 2 - 2
packages/codemirror-lang-graphql/tsconfig.json

@@ -6,7 +6,7 @@
     "newLine": "lf",
     "declaration": true,
     "moduleResolution": "node",
-    "allowJs": true,
+    "allowJs": true
   },
   "include": ["src/*"]
-}
+}

+ 10 - 10
packages/hoppscotch-data/rollup.config.js

@@ -1,13 +1,13 @@
-import dts from 'rollup-plugin-dts'
-import esbuild from 'rollup-plugin-esbuild'
-import multi from '@rollup/plugin-multi-entry'
+import dts from "rollup-plugin-dts"
+import esbuild from "rollup-plugin-esbuild"
+import multi from "@rollup/plugin-multi-entry"
 
-const name = require('./package.json').main.replace(/\.js$/, '')
+const name = require("./package.json").main.replace(/\.js$/, "")
 
-const bundle = config => ({
+const bundle = (config) => ({
   ...config,
-  input: 'src/**/*.ts',
-  external: id => !/^[./]/.test(id),
+  input: "src/**/*.ts",
+  external: (id) => !/^[./]/.test(id),
 })
 
 export default [
@@ -16,12 +16,12 @@ export default [
     output: [
       {
         file: `${name}.js`,
-        format: 'cjs',
+        format: "cjs",
         sourcemap: true,
       },
       {
         file: `${name}.mjs`,
-        format: 'es',
+        format: "es",
         sourcemap: true,
       },
     ],
@@ -30,7 +30,7 @@ export default [
     plugins: [dts()],
     output: {
       file: `${name}.d.ts`,
-      format: 'es',
+      format: "es",
     },
   }),
 ]

+ 1 - 1
packages/hoppscotch-data/src/graphql/index.ts

@@ -38,4 +38,4 @@ export function makeGQLRequest(x: Omit<HoppGQLRequest, "v">) {
     v: 1,
     ...x,
   }
-}
+}

+ 1 - 1
packages/hoppscotch-data/src/index.ts

@@ -1,2 +1,2 @@
 export * from "./rest"
-export * from "./graphql"
+export * from "./graphql"

+ 1 - 1
packages/hoppscotch-data/src/rest/content-types.ts

@@ -10,4 +10,4 @@ export const knownContentTypes = {
   "text/plain": "plain",
 }
 
-export type ValidContentTypes = keyof typeof knownContentTypes
+export type ValidContentTypes = keyof typeof knownContentTypes

+ 1 - 1
packages/hoppscotch-data/tsconfig.json

@@ -9,4 +9,4 @@
     "strictNullChecks": true,
     "resolveJsonModule": true
   }
-}
+}

+ 4 - 6
packages/hoppscotch-data/tsup.config.ts

@@ -1,8 +1,8 @@
-import { Options } from 'tsup'
+import { Options } from "tsup"
 
 const options: Options = {
   format: [
-    'cjs',
+    "cjs",
     // loading Babel in ESM is tricky, since Babel itself it CJS only
     // we decided to drop ESM support until Babel supports native ESM
     // 'esm',
@@ -10,9 +10,7 @@ const options: Options = {
   clean: true,
   splitting: true,
   dts: true,
-  entryPoints: [
-    'src/**/*.ts',
-  ],
+  entryPoints: ["src/**/*.ts"],
 }
 
-export default options
+export default options

+ 2 - 6
packages/hoppscotch-js-sandbox/tsconfig.json

@@ -10,11 +10,7 @@
       "~/*": ["./src/*"],
       "@/*": ["./src/*"]
     },
-    "types": [
-      "@types/node",
-      "@types/jest",
-      "@relmify/jest-fp-ts"
-    ],
+    "types": ["@types/node", "@types/jest", "@relmify/jest-fp-ts"],
     "outDir": "./lib/",
     "rootDir": "./src/",
     "declaration": true,
@@ -23,4 +19,4 @@
   },
   "include": ["./src", "./src/global.d.ts"],
   "exclude": ["node_modules", "./src/__tests__", "./src/demo.ts"]
-}
+}