feat(all): get eslint working in neovim #18
6
.eslintignore
Normal file
6
.eslintignore
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
node_modules
|
||||||
|
package-lock.json
|
||||||
|
bun.lockb
|
||||||
|
target
|
||||||
|
src-tauri
|
||||||
|
|
27
.eslintrc.cjs
Normal file
27
.eslintrc.cjs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
es2021: true,
|
||||||
|
},
|
||||||
|
extends: [
|
||||||
|
"eslint:recommended",
|
||||||
|
"standard-with-typescript",
|
||||||
|
"eslint-config-prettier",
|
||||||
|
],
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
env: {
|
||||||
|
node: true,
|
||||||
|
},
|
||||||
|
files: [".eslintrc.{js,cjs}"],
|
||||||
|
parserOptions: {
|
||||||
|
sourceType: "script",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: "latest",
|
||||||
|
sourceType: "module",
|
||||||
|
},
|
||||||
|
rules: {},
|
||||||
|
}
|
3921
package-lock.json
generated
3921
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -18,10 +18,13 @@
|
|||||||
"vite-plugin-kaioken": "^0.0.7"
|
"vite-plugin-kaioken": "^0.0.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jsdom": "^24.0.0",
|
|
||||||
"@tauri-apps/cli": "^1",
|
"@tauri-apps/cli": "^1",
|
||||||
|
"@typescript-eslint/parser": "^7.3.1",
|
||||||
"autoprefixer": "^10.4.18",
|
"autoprefixer": "^10.4.18",
|
||||||
"cz-conventional-changelog": "^3.3.0",
|
"cz-conventional-changelog": "^3.3.0",
|
||||||
|
"eslint": "^8.57.0",
|
||||||
|
"eslint-config-prettier": "^9.1.0",
|
||||||
|
"jsdom": "^24.0.0",
|
||||||
"postcss": "^8.4.35",
|
"postcss": "^8.4.35",
|
||||||
"tailwindcss": "^3.4.1",
|
"tailwindcss": "^3.4.1",
|
||||||
"typescript": "^5.0.2",
|
"typescript": "^5.0.2",
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
import { writeTextFile } from "@tauri-apps/api/fs"
|
import { writeTextFile } from '@tauri-apps/api/fs'
|
||||||
import { navigate, useModel } from "kaioken"
|
import { navigate, useModel } from 'kaioken'
|
||||||
import { Station, useStationsStore } from "../hooks/stationStores"
|
import { type Station, useStationsStore } from '../hooks/stationStores'
|
||||||
import { useStorageStore } from "../hooks/storageStores"
|
import { useStorageStore } from '../hooks/storageStores'
|
||||||
|
|
||||||
export default function Add() {
|
export default function Add(): JSX.Element {
|
||||||
const { value } = useStorageStore()
|
const { value } = useStorageStore()
|
||||||
const [titleRef, title,] = useModel<HTMLInputElement, string>('')
|
const [titleRef, title] = useModel<HTMLInputElement, string>('')
|
||||||
const [streamRef, streamUrl,] = useModel<HTMLInputElement, string>('')
|
const [streamRef, streamUrl] = useModel<HTMLInputElement, string>('')
|
||||||
const [avatarRef, avatarUrl,] = useModel<HTMLInputElement, string>('')
|
const [avatarRef, avatarUrl] = useModel<HTMLInputElement, string>('')
|
||||||
|
|
||||||
function _handleStationAdd() {
|
function _handleStationAdd(): void {
|
||||||
const data: Station = {
|
const data: Station = {
|
||||||
id: Math.random().toString(16).slice(2),
|
id: Math.random().toString(16).slice(2),
|
||||||
url: streamUrl,
|
url: streamUrl,
|
||||||
avatar: avatarUrl,
|
avatar: avatarUrl,
|
||||||
title: title
|
title
|
||||||
}
|
}
|
||||||
const store = useStationsStore.methods.add(data)
|
const store = useStationsStore.methods.add(data)
|
||||||
const valid = store && value
|
const valid = store?.length && value
|
||||||
valid && void writeTextFile(value, JSON.stringify(store))
|
!!valid && void writeTextFile(value, JSON.stringify(store))
|
||||||
navigate('/')
|
navigate('/')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,9 +30,9 @@ export default function Add() {
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<div className="flex flex-col gap-3 p-2">
|
<div className="flex flex-col gap-3 p-2">
|
||||||
<input ref={titleRef} className="rounded p-1" ariaLabel={"title"} placeholder="Title" />
|
<input ref={titleRef} className="rounded p-1" ariaLabel={'title'} placeholder="Title" />
|
||||||
<input ref={streamRef} className="rounded p-1" ariaLabel={"url"} placeholder="Stream URL" />
|
<input ref={streamRef} className="rounded p-1" ariaLabel={'url'} placeholder="Stream URL" />
|
||||||
<input ref={avatarRef} className="rounded p-1" ariaLabel={"avatar"} placeholder="Image URL" />
|
<input ref={avatarRef} className="rounded p-1" ariaLabel={'avatar'} placeholder="Image URL" />
|
||||||
<button onclick={_handleStationAdd} className="rounded bg-blue-400 p-1">Save</button>
|
<button onclick={_handleStationAdd} className="rounded bg-blue-400 p-1">Save</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,5 +20,6 @@
|
|||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"jsx": "preserve"
|
"jsx": "preserve"
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["src"],
|
||||||
|
"exclude": ["node_modules", "target", "src-tauri"]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user