Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[migrate] upgrade to ESLint 9, Node.js 20 & other latest Upstream packages/actions #16

Merged
merged 12 commits into from
Sep 14, 2024
31 changes: 5 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,16 @@ on:
- master
jobs:
Build-and-Deploy:
runs-on: ubuntu-latest
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
runs-on: ubuntu-latest
TechQuery marked this conversation as resolved.
Show resolved Hide resolved
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 9
- uses: actions/setup-node@v3
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
run: pnpm i --frozen-lockfile

- name: Build Production
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
run: pnpm build

- name: Deploy Production
uses: peaceiris/actions-gh-pages@v3
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
with:
publish_dir: ./dist
personal_token: ${{ secrets.GITHUB_TOKEN }}
force_orphan: true
- uses: actions/checkout@v4
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
Soecka marked this conversation as resolved.
Show resolved Hide resolved

- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
Expand Down
2 changes: 2 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ vscode:
- eamodio.gitlens
- github.vscode-pull-request-github
- github.vscode-github-actions
- streetsidesoftware.code-spell-checker

tasks:
- init: pnpm i
command: npm start
74 changes: 74 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import typescriptPlugin from 'typescript-eslint';
import globals from 'globals';

import js from '@eslint/js';
import json from '@eslint/json';
import markdown from '@eslint/markdown';

import eslintConfigPrettier from 'eslint-config-prettier';
import react from 'eslint-plugin-react';
import simpleImportSort from 'eslint-plugin-simple-import-sort';

export default [
// import sort
{
files: ['**/*.{js,ts,jsx,tsx}'],
plugins: {
'simple-import-sort': simpleImportSort
},
rules: {
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error'
}
},
// TypeScript
{
files: ['**/*.{ts,tsx}'],
plugins: {
'@typescript-eslint': typescriptPlugin.plugin
}
},
// JavaScript
{
name: 'eslint/js',
files: ['**/*.{js,ts,jsx,tsx}'],
languageOptions: { globals: globals.browser },
plugins: { js },
rules: {
'consistent-return': 'error'
}
},
// React
{
name: 'react-jsx',
files: ['**/*.{js,ts,jsx,tsx}'],
plugins: { react },
rules: {
'react/jsx-no-target-blank': 'warn',
'react/jsx-sort-props': [
'error',
{
reservedFirst: true,
shorthandLast: true,
callbacksLast: true,
noSortAlphabetically: true
}
]
}
},
// JSON files
{
name: 'eslint/json',
files: ['**/*.json', '.c8rc'],
ignores: ['**/package-lock.json'],
language: 'json/json',
plugins: { json }
},
// MarkDown
{
files: ['**/*.md'],
language: 'markdown/gfm',
plugins: { markdown }
},
eslintConfigPrettier
];
61 changes: 37 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,62 @@
"author": "[email protected]",
"dependencies": {
"@editorjs/code": "^2.9.0",
"@editorjs/editorjs": "^2.29.1",
"@editorjs/header": "^2.8.1",
"@editorjs/image": "^2.9.0",
"@editorjs/editorjs": "^2.30.5",
"@editorjs/header": "^2.8.7",
"@editorjs/image": "^2.9.3",
"@editorjs/link": "^2.6.2",
"@editorjs/list": "^1.9.0",
"@editorjs/paragraph": "^2.11.5",
"@editorjs/quote": "^2.6.0",
"@editorjs/list": "^1.10.0",
"@editorjs/paragraph": "^2.11.6",
"@editorjs/quote": "^2.7.2",
"browser-fs-access": "^0.35.0",
"browser-unhandled-rejection": "^1.0.2",
"echarts-jsx": "^1.2.0",
"echarts-jsx": "^1.2.1",
"editorjs-html": "^3.4.3",
"idea-react": "^2.0.0-rc.2",
"koajax": "^1.1.2",
"koajax": "^3.0.2",
"lodash": "^4.17.21",
"mobx": "^6.12.4",
"mobx-github": "^0.3.2",
"mobx": "^6.13.2",
"mobx-github": "^0.3.4",
"mobx-i18n": "^0.5.0",
"mobx-react": "^9.1.1",
"mobx-restful": "^1.0.0",
"mobx-restful-table": "^2.0.0-rc.1",
"preact": "^10.22.0",
"react-bootstrap": "^2.10.3",
"mobx-restful": "^1.0.1",
"mobx-restful-table": "^2.0.0",
"preact": "^10.23.2",
"react-bootstrap": "^2.10.4",
"react-bootstrap-editor": "^2.0.4",
"react-editor-js": "^2.1.0",
"react-router-class-tools": "^0.1.3",
"react-router-dom": "^6.24.0",
"react-router-dom": "^6.26.2",
"web-utility": "^4.4.0"
},
"devDependencies": {
"@babel/runtime": "^7.24.7",
"@babel/runtime": "^7.25.6",
"@eslint/js": "^9.10.0",
"@eslint/json": "^0.4.0",
"@eslint/markdown": "^6.1.0",
"@parcel/config-default": "~2.12.0",
"@parcel/packager-raw-url": "~2.12.0",
"@parcel/transformer-less": "~2.12.0",
"@parcel/transformer-typescript-tsc": "~2.12.0",
"@parcel/transformer-webmanifest": "~2.12.0",
"@types/lodash": "^4.17.5",
"@types/node": "^18.19.39",
"@types/lodash": "^4.17.7",
"@types/node": "^20.16.5",
"buffer": "^6.0.3",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"eslint": "9.10.0",
Soecka marked this conversation as resolved.
Show resolved Hide resolved
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.35.2",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-spellcheck": "^0.0.20",
"globals": "^15.9.0",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
"parcel": "~2.12.0",
"parcel-transformer-mdx": "^0.3.3",
"prettier": "^3.3.2",
"parcel-transformer-mdx": "^0.4.2",
"prettier": "^3.3.3",
"prismjs": "^1.29.0",
"process": "^0.11.10",
"typescript": "~5.5.2",
"typescript": "~5.6.2",
"typescript-eslint": "^8.5.0",
"workbox-cli": "^7.1.0"
},
"alias": {
Expand All @@ -66,7 +76,10 @@
"tabWidth": 4
},
"lint-staged": {
"*.{html,md,less,json,yml,js,ts,tsx}": "prettier --write"
"*.{html,md,less,json,yml,js,mjs,ts,tsx}": [
"eslint --fix",
"prettier --write"
]
},
"browserslist": "> 0.5%, last 2 versions, not dead, IE 11",
"scripts": {
Expand Down
Loading