Skip to content

Commit

Permalink
setup setup project linting and building
Browse files Browse the repository at this point in the history
  • Loading branch information
lilioid committed Sep 1, 2022
1 parent af90fb0 commit 8c38e52
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root: true
extends:
- "eslint:recommended"
- "plugin:@typescript-eslint/eslint-recommended"
- "plugin:@typescript-eslint/recommended"
- "prettier"
parser: "@typescript-eslint/parser"
plugins:
- "@typescript-eslint"
parserOptions:
ecmaVersion: "latest"
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: main
on: [push]

jobs:
check-pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/setup-node@v3
with:
node-version: 18
- run: python -m pip install pre-commit
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: pre-commit run --show-diff-on-failure --color=always --all-files
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.7.1"
hooks:
- id: prettier

- repo: https://github.com/pre-commit/mirrors-eslint
rev: "v8.23.0"
hooks:
- id: eslint
3 changes: 3 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
printWidth: 110
tabWidth: 4
singleQuote: false
34 changes: 34 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "vite-plugin-runtime-config",
"version": "1.0.0-dev1",
"description": "A vite plugin for runtime configuration",
"main": "dist/index.js",
"files": [
"dist",
"src"
],
"scripts": {
"lint": "npm run lint:eslint && npm run lint:prettier",
"lint:eslint": "eslint src/",
"lint:prettier": "prettier --check src/",
"format": "prettier --write src/",
"build": "tsc --build"
},
"author": {
"name": "Viva con Agua",
"email": "[email protected]",
"url": "https://github.com/Viva-con-Agua/"
},
"maintainers": [
"Finn-Thorben Sell <[email protected]>"
],
"license": "MIT",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"eslint": "^8.23.0",
"eslint-config-prettier": "^8.5.0",
"prettier": "^2.7.1",
"typescript": "^4.8.2"
}
}
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export function VitePluginRuntimeConfig() {
throw new Error("Not Implemented");
}
export default VitePluginRuntimeConfig;
11 changes: 11 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"include": ["src/"],
"compilerOptions": {
"baseUrl": ".",
"outDir": "dist/",
"declaration": true,
"paths": {
"@/*": ["./src/*"]
}
}
}

0 comments on commit 8c38e52

Please sign in to comment.