Skip to content

Commit

Permalink
style: Linted previous codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacharyBear committed Apr 2, 2024
1 parent 03c417b commit 60b9665
Show file tree
Hide file tree
Showing 45 changed files with 29,590 additions and 9,631 deletions.
35 changes: 14 additions & 21 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
const config = {
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
type: 'module'
},
env: {
node: true,
browser: true,

// es6: true,
// mocha: true,
// jest: true,
// jasmine: true,
},
extends: ["eslint:recommended", "plugin:vue/vue3-recommended", "prettier"],
rules: {
// override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error'
'vue/multi-word-component-names': 'off'
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
type: 'module',
},
env: {
node: true,
browser: true,
},
extends: ['eslint:recommended', 'plugin:vue/vue3-recommended', 'prettier'],
rules: {
'vue/multi-word-component-names': 'off',
},
};

module.exports = config
module.exports = config;
107 changes: 53 additions & 54 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,59 @@

name: CI GitHub Pages
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
push:
branches: ['main']
pull_request:
branches: ['main']
permissions:
contents: read
pages: write
id-token: write
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: true
group: 'pages'
cancel-in-progress: true
jobs:
# lint:
# name: Linting 🔍
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [16.x, 18.x]
# steps:
# - name: Checkout 🛎️
# uses: actions/checkout@v4
# - name: Linting
# uses: actions/setup-node@v3
# with: ${{ matrix.node-version }}
# - run: npm install
# - run: npm run lint

build-and-deploy:
name: Build & Deploying
# needs: lint
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
strategy:
matrix:
node-version: [18.18.0]
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: 🚧 Build with Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm run build
# Avoid fresh page 404 result
- run: cp dist/index.html dist/404.html
- name: 🚀 Deploying
uses: actions/configure-pages@v3
- uses: actions/upload-pages-artifact@v2
with:
path: './dist'
- uses: actions/deploy-pages@v1
- run: echo '✅ Success deployed!'

# lint:
# name: Linting 🔍
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [16.x, 18.x]
# steps:
# - name: Checkout 🛎️
# uses: actions/checkout@v4
# - name: Linting
# uses: actions/setup-node@v3
# with: ${{ matrix.node-version }}
# - run: npm install
# - run: npm run lint

build-and-deploy:
name: Build & Deploying
# needs: lint
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
strategy:
matrix:
node-version: [18.18.0]
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: 🚧 Build with Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm run build
# Avoid fresh page 404 result
- run: cp dist/index.html dist/404.html
- name: 🚀 Deploying
uses: actions/configure-pages@v3
- uses: actions/upload-pages-artifact@v2
with:
path: './dist'
- uses: actions/deploy-pages@v1
- run: echo '✅ Success deployed!'
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Execute something before commit
npx lint-staged
10 changes: 10 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const path = require('path');

const testEslint = (filenames) =>
`eslint --ignore-path .gitignore ${filenames
.map((name) => path.relative(process.cwd(), name))
.join(' ')}`;

module.exports = {
'*.{js,ts,vue}': ['eslint --ignore-path .gitignore', 'prettier --write'],
};
7 changes: 6 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{}
{
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"bracketSpacing": true
}
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
}
6 changes: 0 additions & 6 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@

这是一个 **玻璃拟态** `CSS` 生成器,用于帮助设计师、前端开发者来快速设计组件。



## 推荐的开发环境

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (禁用Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).



## 安装

首先进入项目目录
Expand All @@ -40,8 +36,6 @@ npm run build

Tips: 将会有一个名为`dist`的目录生成,将它压缩成包并放入你的[Web容器](https://zh.wikipedia.org/wiki/Web%E5%AE%B9%E5%99%A8),如: [Nginx](http://nginx.org/), [Apache](https://www.apache.org/)...



## 证书

`Glassmorphism Generator`采用[MIT](https://github.com/ZenkieBear/glassmorphism/blob/main/LICENSE)作为开源许可证。
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

This is a glass-morphism CSS generator that makes it easier for designers and front-end developers to create their components.

## Suggested Tools
## Suggested Tools

* We recommend using [VSCode](https://code.visualstudio.com/) as your code editor.
* Suggested extensions for VSCode:
* [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and turn off Vetur)
* [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
- We recommend using [VSCode](https://code.visualstudio.com/) as your code editor.
- Suggested extensions for VSCode:
- [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and turn off Vetur)
- [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Getting Started

Expand Down
22 changes: 11 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.svg">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Glassmorphism Generator</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Glassmorphism Generator</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading

0 comments on commit 60b9665

Please sign in to comment.