-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add eslint verification configuration, add lint CI workflows (#284
- Loading branch information
Showing
29 changed files
with
2,392 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
dist | ||
public | ||
node_modules | ||
.netlify | ||
.vercel | ||
.github | ||
.changeset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = { | ||
extends: ['@evan-yang', 'plugin:astro/recommended'], | ||
rules: { | ||
'no-console': ['error', { allow: ['error'] }], | ||
'react/display-name': 'off', | ||
'react-hooks/rules-of-hooks': 'off', | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.astro'], | ||
parser: 'astro-eslint-parser', | ||
parserOptions: { | ||
parser: '@typescript-eslint/parser', | ||
extraFileExtensions: ['.astro'], | ||
}, | ||
rules: { | ||
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'], | ||
}, | ||
}, | ||
{ | ||
// Define the configuration for `<script>` tag. | ||
// Script in `<script>` is assigned a virtual file name with the `.js` extension. | ||
files: ['**/*.astro/*.js', '*.astro/*.js'], | ||
parser: '@typescript-eslint/parser', | ||
rules: { | ||
'prettier/prettier': 'off', | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Lint CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
|
||
- name: Set node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: pnpm | ||
|
||
- name: Install | ||
run: pnpm install --no-frozen-lockfile | ||
|
||
- name: Lint | ||
run: pnpm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
registry=https://registry.npmjs.org/ | ||
strict-peer-dependencies=false | ||
auto-install-peers=true | ||
shamefully-hoist=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"recommendations": ["astro-build.astro-vscode"], | ||
"recommendations": ["astro-build.astro-vscode","dbaeumer.vscode-eslint","antfu.unocss"], | ||
"unwantedRecommendations": [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"editor.formatOnSave": false, | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"astro", // Enable .astro | ||
"typescript", // Enable .ts | ||
"typescriptreact" // Enable .tsx | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
{ | ||
"name": "chatgpt-api-demo", | ||
"type": "module", | ||
"version": "0.0.1", | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "astro build", | ||
"build:vercel": "OUTPUT=vercel astro build", | ||
"build:netlify": "OUTPUT=netlify astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
"astro": "astro", | ||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.astro", | ||
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx,.astro --fix" | ||
}, | ||
"dependencies": { | ||
"@astrojs/netlify": "2.0.0", | ||
|
@@ -18,6 +20,7 @@ | |
"@astrojs/vercel": "^3.1.3", | ||
"@unocss/reset": "^0.50.1", | ||
"astro": "^2.0.15", | ||
"eslint": "^8.36.0", | ||
"eventsource-parser": "^0.1.0", | ||
"highlight.js": "^11.7.0", | ||
"js-sha256": "^0.9.0", | ||
|
@@ -32,10 +35,13 @@ | |
"devDependencies": { | ||
"@iconify-json/carbon": "^1.1.16", | ||
"@types/markdown-it": "^12.2.3", | ||
"@typescript-eslint/parser": "^5.54.1", | ||
"@unocss/preset-attributify": "^0.50.1", | ||
"@unocss/preset-icons": "^0.50.4", | ||
"@unocss/preset-typography": "^0.50.3", | ||
"eslint-plugin-astro": "^0.24.0", | ||
"punycode": "^2.3.0", | ||
"unocss": "^0.50.1" | ||
"unocss": "^0.50.1", | ||
"@evan-yang/eslint-config": "^1.0.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
0e69a11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
chatgpt-demo – ./
chatgpt-api-demo.vercel.app
chatgpt-demo-git-main-ddiu8081.vercel.app
chatgpt-demo-ddiu8081.vercel.app
chatgpt.ddiu.me
ai.ddiu.io
chatgpt.ddiu.io