Skip to content

Commit

Permalink
chore: setup workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Apr 17, 2024
1 parent 157a97c commit 06e02cb
Show file tree
Hide file tree
Showing 5 changed files with 932 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/external

temp
dist
lib
tests

*.js
8 changes: 8 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root: true

env:
browser: true
es2022: true

extends:
- '@cordisjs/eslint-config'
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build

on:
push:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
- name: Install
run: yarn --no-immutable
- name: Lint
run: yarn lint
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.1.1.cjs

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions packages/vue/src/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ function onInput(event: Event) {
text.value = (event.target as HTMLInputElement).value
}
function handleDataTransfer(event: Event, transfer: DataTransfer) {
function handleDataTransfer(event: Event, transfer: DataTransfer | null) {
if (!transfer) return
for (const item of transfer.items) {
if (item.kind !== 'file') continue
event.preventDefault()
const file = item.getAsFile()
if (!file) continue
event.preventDefault()
const [type] = file.type.split('/', 1)
if (!['image', 'audio', 'video'].includes(type)) {
console.warn('Unsupported file type:', file.type)
Expand Down

0 comments on commit 06e02cb

Please sign in to comment.