Skip to content

Commit

Permalink
chore: apply ESLint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrossmann committed Dec 11, 2023
1 parent f457f57 commit 62c1b1c
Show file tree
Hide file tree
Showing 22 changed files with 44 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"editor.tabSize": 2,
"editor.wordWrapColumn": 100,
Expand Down
8 changes: 4 additions & 4 deletions src/bin/generate.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable import/no-unused-modules */
import 'source-map-support/register'
import 'tsconfig-paths/register'
import * as fs from 'fs'
import * as fs from 'fs/promises'
import * as path from 'path'
import type { VSCTheme } from '@remedy/types'
import { type VSCTheme } from '@remedy/types'

const entrypoint = process.argv[2]
const outfile = process.argv[3]
Expand All @@ -13,11 +13,11 @@ if (!entrypoint || !outfile) {
}

import(path.resolve(process.cwd(), entrypoint))
.then(({ default: theme }: { default: VSCTheme }) => {
.then(async ({ default: theme }: { default: VSCTheme }) => {
const data = `${JSON.stringify(theme, null, 2)}\n`
const destination = path.resolve(process.cwd(), outfile)

fs.writeFileSync(destination, data)
await fs.writeFile(destination, data)
})
.catch((err: Error) => {
throw err
Expand Down
2 changes: 1 addition & 1 deletion src/bin/refresh-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'tsconfig-paths/register'
import * as fs from 'fs'
import * as path from 'path'
import * as pkg from '../../package.json'
import type { VSCTheme } from '@remedy/types'
import { type VSCTheme } from '@remedy/types'

const themefiles = process.argv.slice(2)
const metadata = themefiles.map(file => {
Expand Down
7 changes: 6 additions & 1 deletion src/generators/mktokens/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import * as color from 'color'
import * as tokens from './tokens'
import type { CodePalette, ColourPalette, SemanticRules, TMRule } from '@remedy/types'
import {
type CodePalette,
type ColourPalette,
type SemanticRules,
type TMRule,
} from '@remedy/types'
import { TMFontStyle } from '@remedy/types'

interface InputParams {
Expand Down
4 changes: 2 additions & 2 deletions src/generators/mktokens/tokens/cc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import { cc as cscope } from '@remedy/tools/tmscopes'
import type { TMRule } from '@remedy/types'
import { type TMRule } from '@remedy/types'

function cc({ code }: InputParams): TMRule[] {
const punctuation = {
Expand Down
2 changes: 1 addition & 1 deletion src/generators/mktokens/tokens/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import { TMFontStyle, type TMRule } from '@remedy/types'

function common({ code }: InputParams): TMRule[] {
Expand Down
4 changes: 2 additions & 2 deletions src/generators/mktokens/tokens/cpp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import { cpp as cppscope } from '@remedy/tools/tmscopes'
import type { TMRule } from '@remedy/types'
import { type TMRule } from '@remedy/types'

function cpp({ code }: InputParams): TMRule[] {
const language = {
Expand Down
4 changes: 2 additions & 2 deletions src/generators/mktokens/tokens/csharp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import { cs as csscope } from '@remedy/tools/tmscopes'
import type { TMRule } from '@remedy/types'
import { type TMRule } from '@remedy/types'

function csharp({ code }: InputParams): TMRule[] {
const classes = {
Expand Down
4 changes: 2 additions & 2 deletions src/generators/mktokens/tokens/css.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import { css as cssscope } from '@remedy/tools/tmscopes'
import type { TMRule } from '@remedy/types'
import { type TMRule } from '@remedy/types'

function css({ code, colours }: InputParams): TMRule[] {
const ids = {
Expand Down
4 changes: 2 additions & 2 deletions src/generators/mktokens/tokens/html.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import { html as htmlscope } from '@remedy/tools/tmscopes'
import type { TMRule } from '@remedy/types'
import { type TMRule } from '@remedy/types'

function html({ code, colours }: InputParams): TMRule[] {
const ids = {
Expand Down
4 changes: 2 additions & 2 deletions src/generators/mktokens/tokens/java.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import { java as javascope } from '@remedy/tools/tmscopes'
import type { TMRule } from '@remedy/types'
import { type TMRule } from '@remedy/types'

function java({ code }: InputParams): TMRule[] {
const variables = {
Expand Down
4 changes: 2 additions & 2 deletions src/generators/mktokens/tokens/javascript.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import { jsts as jstsscope } from '@remedy/tools/tmscopes'
import type { TMRule } from '@remedy/types'
import { type TMRule } from '@remedy/types'

function javascript({ code }: InputParams): TMRule[] {
const builtins = {
Expand Down
4 changes: 2 additions & 2 deletions src/generators/mktokens/tokens/keyvaluelike.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import {
dotenv as dotenvscope,
json as jsonscope,
terraform as terraformscope,
yaml as yamlscope,
} from '@remedy/tools/tmscopes'
import type { TMRule } from '@remedy/types'
import { type TMRule } from '@remedy/types'

function keyvaluelike({ code }: InputParams): TMRule[] {
const keys = {
Expand Down
2 changes: 1 addition & 1 deletion src/generators/mktokens/tokens/makefile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import { makefile as makefilescope } from '@remedy/tools/tmscopes'
import { TMFontStyle, type TMRule } from '@remedy/types'

Expand Down
2 changes: 1 addition & 1 deletion src/generators/mktokens/tokens/markdown.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import { markdown as markdownscope } from '@remedy/tools/tmscopes'
import { TMFontStyle, type TMRule } from '@remedy/types'

Expand Down
4 changes: 2 additions & 2 deletions src/generators/mktokens/tokens/pug.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import { pug as pugscope } from '@remedy/tools/tmscopes'
import type { TMRule } from '@remedy/types'
import { type TMRule } from '@remedy/types'

function pug({ code, colours }: InputParams): TMRule[] {
const language = {
Expand Down
4 changes: 2 additions & 2 deletions src/generators/mktokens/tokens/shell.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { InputParams } from './InputParams'
import { type InputParams } from './InputParams'
import { shell as shellscope } from '@remedy/tools/tmscopes'
import type { TMRule } from '@remedy/types'
import { type TMRule } from '@remedy/types'

function shell({ code }: InputParams): TMRule[] {
const variables = {
Expand Down
6 changes: 5 additions & 1 deletion src/generators/mkui.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { UIColourPalette, UIPalette, CodePalette } from '@remedy/types'
import {
type UIColourPalette,
type UIPalette,
type CodePalette,
} from '@remedy/types'

interface mkuiParams {
ui: UIPalette
Expand Down
2 changes: 1 addition & 1 deletion src/themes/bright/code.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { foreground, normal, bright } from './colours'
import type { CodePalette } from '@remedy/types'
import { type CodePalette } from '@remedy/types'

const plain = foreground.hex()
const comments = foreground.lighten(1.6).desaturate(0.5).hex()
Expand Down
2 changes: 1 addition & 1 deletion src/themes/dark/code.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { foreground, normal, bright } from './colours'
import type { CodePalette } from '@remedy/types'
import { type CodePalette } from '@remedy/types'

const plain = foreground.hex()
const comments = foreground.darken(0.5).desaturate(0.8).hex()
Expand Down
2 changes: 1 addition & 1 deletion src/types/VSCTheme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { UIColourPalette } from './UIColourPalette'
import { type UIColourPalette } from './UIColourPalette'

type HEXAColour = string

Expand Down
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-unused-modules
export * from './VSCTheme'
export * from './UIColourPalette'
export * from './CodePalette'
Expand Down

0 comments on commit 62c1b1c

Please sign in to comment.