chore: add eslint, prettier and a CI pipeline
This commit is contained in:
parent
5c2b5fe673
commit
1543f0ac79
7 changed files with 1106 additions and 1 deletions
38
.drone.yml
Normal file
38
.drone.yml
Normal file
|
@ -0,0 +1,38 @@
|
|||
kind: pipeline
|
||||
type: docker
|
||||
name: Build
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: arm64
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
image: node-pnpm:16-alpine
|
||||
commands:
|
||||
- pnpm install --frozen-lockfile
|
||||
- name: Check formatting
|
||||
image: node-pnpm:16-alpine
|
||||
commands:
|
||||
- pnpm format:check
|
||||
- name: Lint code
|
||||
image: node-pnpm:16-alpine
|
||||
commands:
|
||||
- pnpm lint
|
||||
- name: Build site
|
||||
image: node-pnpm:16-alpine
|
||||
commands:
|
||||
- pnpm build
|
||||
- name: Deploy site
|
||||
image: alpine
|
||||
commands:
|
||||
- apk add curl ca-certificates zip
|
||||
- cd dist && zip -r ../deploy.zip * && cd ..
|
||||
- 'curl --fail --upload-file deploy.zip -H "Authorization: token $GITEA_TOKEN" https://git.ashhhleyyy.dev/api/packages/ash/generic/secsan/$DRONE_COMMIT_SHA/secsan.zip'
|
||||
environment:
|
||||
GITEA_TOKEN:
|
||||
from_secret: GITEA_TOKEN
|
||||
|
||||
trigger:
|
||||
event: [push]
|
||||
branch: [main]
|
34
.eslintignore
Normal file
34
.eslintignore
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# lockfile
|
||||
pnpm-lock.yaml
|
||||
|
||||
# CI
|
||||
.pnpm-store
|
||||
.drone.yml
|
||||
|
||||
# Config
|
||||
.eslintrc.cjs
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
26
.eslintrc.cjs
Normal file
26
.eslintrc.cjs
Normal file
|
@ -0,0 +1,26 @@
|
|||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
es2021: true,
|
||||
},
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'preact',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['@typescript-eslint'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
},
|
||||
settings: {
|
||||
jest: { version: 29 }
|
||||
}
|
||||
};
|
31
.prettierignore
Normal file
31
.prettierignore
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# lockfile
|
||||
pnpm-lock.yaml
|
||||
|
||||
# CI
|
||||
.pnpm-store
|
||||
.drone.yml
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
8
.prettierrc
Normal file
8
.prettierrc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"jsxSingleQuote": true,
|
||||
"semi": true,
|
||||
"tabWidth": 4,
|
||||
"useTabs": false,
|
||||
"trailingComma": "es5",
|
||||
"singleQuote": true
|
||||
}
|
10
package.json
10
package.json
|
@ -7,7 +7,10 @@
|
|||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview",
|
||||
"test": "vitest"
|
||||
"test": "vitest",
|
||||
"format": "prettier --write .",
|
||||
"format:check": "prettier --check .",
|
||||
"lint": "eslint . --max-warnings 0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@preact/signals": "^1.1.2",
|
||||
|
@ -16,6 +19,11 @@
|
|||
"devDependencies": {
|
||||
"@preact/preset-vite": "^2.4.0",
|
||||
"@types/node": "^18.11.9",
|
||||
"@typescript-eslint/eslint-plugin": "^5.42.1",
|
||||
"@typescript-eslint/parser": "^5.42.1",
|
||||
"eslint": "^8.27.0",
|
||||
"eslint-config-preact": "^1.3.0",
|
||||
"prettier": "^2.7.1",
|
||||
"typescript": "^4.6.4",
|
||||
"vite": "^3.2.3",
|
||||
"vite-plugin-pwa": "^0.13.3",
|
||||
|
|
960
pnpm-lock.yaml
960
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue