Skip to content

Commit 312d622

Browse files
committed
feat: updated eslint, dependency upgrades
1 parent b4f370c commit 312d622

File tree

49 files changed

+2619
-1769
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2619
-1769
lines changed

.eslintignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,77 +7,59 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
docker-publish:
11-
if: startsWith(github.ref, 'refs/tags/')
12-
runs-on: ubuntu-latest
13-
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v4
17-
18-
- name: Set up QEMU
19-
uses: docker/setup-qemu-action@v3
20-
21-
- name: Set up Docker Buildx
22-
uses: docker/setup-buildx-action@v3
23-
24-
- name: Login to Docker Hub
25-
uses: docker/login-action@v3
26-
with:
27-
username: ${{ secrets.DOCKERHUB_USERNAME }}
28-
password: ${{ secrets.DOCKERHUB_TOKEN }}
29-
30-
- name: Publish
31-
uses: docker/build-push-action@v6
32-
with:
33-
context: .
34-
platforms: linux/amd64,linux/arm64
35-
push: true
36-
tags: ${{ vars.DOCKERHUB_REPO }}:latest
37-
38-
app-publish:
10+
publish-tauri:
3911
permissions:
4012
contents: write
4113
strategy:
4214
fail-fast: false
4315
matrix:
44-
platform: [ macos-latest, ubuntu-latest, windows-latest ]
16+
include:
17+
- platform: 'macos-latest'
18+
args: '--target aarch64-apple-darwin'
19+
- platform: 'macos-latest'
20+
args: '--target x86_64-apple-darwin'
21+
- platform: 'ubuntu-22.04'
22+
args: ''
23+
- platform: 'windows-latest'
24+
args: ''
25+
4526
runs-on: ${{ matrix.platform }}
4627
steps:
47-
- name: Checkout repository
48-
uses: actions/checkout@v4
28+
- uses: actions/checkout@v4
4929

50-
- name: Install dependencies (ubuntu only)
51-
if: matrix.platform == 'ubuntu-latest'
30+
- name: install dependencies (ubuntu only)
31+
if: matrix.platform == 'ubuntu-22.04'
5232
run: |
5333
sudo apt-get update
5434
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
5535
56-
- name: Node.js setup
36+
- name: setup node
5737
uses: actions/setup-node@v4
5838
with:
59-
node-version: 'lts/*'
39+
node-version: lts/*
6040
cache: 'yarn'
6141

62-
- name: Rust setup
42+
- name: install Rust stable
6343
uses: dtolnay/rust-toolchain@stable
44+
with:
45+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
6446

6547
- name: Rust cache
6648
uses: swatinem/rust-cache@v2
6749
with:
6850
workspaces: './src-tauri -> target'
6951

70-
- name: Install app dependencies and build web
71-
run: yarn && yarn build
52+
- name: Install frontend dependencies
53+
run: yarn install
7254

7355
- name: Build the app
7456
uses: tauri-apps/tauri-action@v0
75-
7657
env:
7758
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7859
with:
7960
tagName: ${{ github.ref_name }}
8061
releaseName: 'Advanced PassGen v__VERSION__'
81-
releaseBody: 'See the assets to download and install this version.'
62+
releaseBody: 'See the assets to download this version and install.'
8263
releaseDraft: true
8364
prerelease: false
65+
args: ${{ matrix.args }}

.github/workflows/test.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,55 @@ jobs:
1515
run: yarn
1616

1717
- name: Run ESLint
18-
run: yarn run eslint . --ext .ts,.tsx,.js,.jsx
18+
run: yarn lint
19+
20+
- name: Run Prettier
21+
run: yarn format
1922

2023
test-tauri:
2124
strategy:
2225
fail-fast: false
2326
matrix:
24-
platform: [ macos-latest, ubuntu-latest, windows-latest ]
27+
include:
28+
- platform: 'macos-latest'
29+
args: '--target aarch64-apple-darwin'
30+
- platform: 'macos-latest'
31+
args: '--target x86_64-apple-darwin'
32+
- platform: 'ubuntu-22.04'
33+
args: ''
34+
- platform: 'windows-latest'
35+
args: ''
2536

2637
runs-on: ${{ matrix.platform }}
2738
steps:
28-
- name: Checkout repository
29-
uses: actions/checkout@v4
39+
- uses: actions/checkout@v4
3040

31-
- name: Install dependencies (ubuntu only)
32-
if: matrix.platform == 'ubuntu-latest'
41+
- name: install dependencies (ubuntu only)
42+
if: matrix.platform == 'ubuntu-22.04'
3343
run: |
3444
sudo apt-get update
3545
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
3646
3747
- name: Setup node
3848
uses: actions/setup-node@v4
3949
with:
40-
node-version: 'lts/*'
50+
node-version: lts/*
4151
cache: 'yarn'
4252

43-
- name: Rust setup
53+
- name: Install Rust stable
4454
uses: dtolnay/rust-toolchain@stable
55+
with:
56+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
4557

4658
- name: Rust cache
4759
uses: swatinem/rust-cache@v2
4860
with:
4961
workspaces: './src-tauri -> target'
5062

51-
- name: Install app dependencies and build it
52-
run: yarn && yarn build
63+
- name: Install frontend dependencies
64+
run: yarn install
5365

54-
- uses: tauri-apps/tauri-action@v0
66+
- name: Build the app
67+
uses: tauri-apps/tauri-action@v0
5568
env:
5669
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dist
2+
.yarn
3+
dist
4+
node_modules
5+
nginx
6+
.idea
7+
README.md
8+
src-tauri
9+
.github

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"tabWidth": 2,
5+
"semi": true,
6+
"arrowParens": "always"
7+
}

eslint.config.js

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import js from '@eslint/js';
2+
import importPlugin from 'eslint-plugin-import';
3+
import react from 'eslint-plugin-react';
4+
import reactHooks from 'eslint-plugin-react-hooks';
5+
import reactRefresh from 'eslint-plugin-react-refresh';
6+
import globals from 'globals';
7+
8+
export default [
9+
importPlugin.flatConfigs.recommended,
10+
{
11+
ignores: [
12+
'dist',
13+
'.yarn',
14+
'dist',
15+
'node_modules',
16+
'nginx',
17+
'.idea',
18+
'src-tauri',
19+
'.github',
20+
],
21+
},
22+
{
23+
files: ['**/*.{js,jsx}'],
24+
languageOptions: {
25+
ecmaVersion: 'latest',
26+
globals: globals.browser,
27+
parserOptions: {
28+
ecmaVersion: 'latest',
29+
ecmaFeatures: { jsx: true },
30+
sourceType: 'module',
31+
},
32+
},
33+
settings: {
34+
react: { version: '19.0' },
35+
'import/resolver': {
36+
node: {
37+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
38+
},
39+
},
40+
},
41+
plugins: {
42+
react,
43+
'react-hooks': reactHooks,
44+
'react-refresh': reactRefresh,
45+
},
46+
rules: {
47+
...js.configs.recommended.rules,
48+
...react.configs.recommended.rules,
49+
...react.configs['jsx-runtime'].rules,
50+
...reactHooks.configs.recommended.rules,
51+
'no-multi-spaces': ['error', { ignoreEOLComments: false }],
52+
'no-trailing-spaces': ['error', { skipBlankLines: false }],
53+
'no-use-before-define': ['error', { functions: true }],
54+
'react/jsx-no-target-blank': 'off',
55+
'react-refresh/only-export-components': [
56+
'warn',
57+
{ allowConstantExport: true },
58+
],
59+
'react/function-component-definition': [
60+
2,
61+
{
62+
namedComponents: 'arrow-function',
63+
unnamedComponents: 'arrow-function',
64+
},
65+
],
66+
'react/prop-types': 0,
67+
'react/jsx-uses-vars': 'error',
68+
'react/jsx-uses-react': 'error',
69+
semi: [2, 'always'],
70+
quotes: [2, 'single'],
71+
'import/order': [
72+
'error',
73+
{
74+
groups: ['builtin', 'external', 'internal', ['parent', 'sibling']],
75+
pathGroups: [
76+
{
77+
pattern: 'react',
78+
group: 'external',
79+
position: 'before',
80+
},
81+
],
82+
pathGroupsExcludedImportTypes: ['react'],
83+
'newlines-between': 'never',
84+
alphabetize: {
85+
order: 'asc',
86+
caseInsensitive: true,
87+
},
88+
},
89+
],
90+
},
91+
},
92+
];

index.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8"/>
5-
<link rel="icon" href="/favicon.ico"/>
6-
<meta name="viewport" content="width=device-width, initial-scale=1"/>
7-
<meta name="theme-color" content="#000000"/>
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
88
<meta
9-
name="description"
10-
content="Advanced PassGen is a password generator that can be used to quickly generate thousands of passwords"
9+
name="description"
10+
content="Advanced PassGen is a password generator that can be used to quickly generate thousands of passwords"
1111
/>
12-
<link rel="apple-touch-icon" href="/logo192.png"/>
13-
<link rel="manifest" href="/manifest.json"/>
12+
<link rel="apple-touch-icon" href="/logo192.png" />
13+
<link rel="manifest" href="/manifest.json" />
1414
<title>Advanced PassGen</title>
15-
</head>
16-
<body>
17-
<noscript>You need to enable JavaScript to run this app.</noscript>
18-
<div id="root"></div>
19-
<script type="module" src="/src/index.jsx"></script>
20-
</body>
15+
</head>
16+
<body>
17+
<noscript>You need to enable JavaScript to run this app.</noscript>
18+
<div id="root"></div>
19+
<script type="module" src="/src/index.jsx"></script>
20+
</body>
2121
</html>

0 commit comments

Comments
 (0)