Merge pull request #4677 from h3poteto/feat/eslint

Setup eslint
This commit is contained in:
AkiraFukushima 2023-12-02 16:35:03 +09:00 committed by GitHub
commit 2fa69fa8e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1269 additions and 23 deletions

44
.eslintrc.json Normal file
View File

@ -0,0 +1,44 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"overrides": [
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint"
],
"rules": {
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"react/display-name": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
]
},
"settings": {
"react": {
"version": "18.2"
}
}
}

24
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,24 @@
name: Lint
on:
pull_request:
jobs:
reviewdog:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install
run: |
yarn install
- uses: reviewdog/action-setup@v1
- name: Run eslint
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
run: |
yarn run lint | reviewdog -f=eslint -reporter=github-pr-review -fail-on-error=true

View File

@ -9,7 +9,8 @@
"dev": "nextron",
"build": "nextron build",
"postinstall": "electron-builder install-app-deps",
"typecheck": "tsc -p renderer --noEmit && tsc -p main --noEmit"
"typecheck": "tsc -p renderer --noEmit && tsc -p main --noEmit",
"lint": "eslint renderer --ext ts,tsx"
},
"dependencies": {
"blurhash": "^2.0.5",
@ -32,9 +33,14 @@
"@types/node": "^18.11.18",
"@types/react": "^18.0.26",
"@types/sanitize-html": "^2.9.4",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"autoprefixer": "^10.4.16",
"electron": "^26.2.2",
"electron-builder": "^24.6.4",
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-react": "^7.33.2",
"next": "^12.3.4",
"nextron": "^8.12.0",
"postcss": "^8.4.31",

1216
yarn.lock

File diff suppressed because it is too large Load Diff