Skip to content

Commit 61a23d6

Browse files
authored
Merge pull request #6 from Lenni009/dev
port to Vue
2 parents 3f66314 + 3f4cc50 commit 61a23d6

34 files changed

+8055
-902
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/dist
2+
/node_modules
3+
.eslintrc.js
4+
babel.config.js
5+
vite.config.ts

.eslintrc.js

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
const { resolve } = require('path');
2+
module.exports = {
3+
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
4+
// This option interrupts the configuration hierarchy at this file
5+
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
6+
root: true,
7+
8+
// https://eslint.vuejs.org/user-guide/#how-to-use-custom-parser
9+
// Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working
10+
// `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omitted
11+
parserOptions: {
12+
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#configuration
13+
// https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#eslint
14+
// Needed to make the parser take into account 'vue' files
15+
extraFileExtensions: ['.vue'],
16+
parser: '@typescript-eslint/parser',
17+
project: resolve(__dirname, './tsconfig.json'),
18+
tsconfigRootDir: __dirname,
19+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
20+
sourceType: 'module', // Allows for the use of imports
21+
},
22+
23+
env: {
24+
browser: true,
25+
},
26+
27+
// Rules order is important, please avoid shuffling them
28+
extends: [
29+
// Base ESLint recommended rules
30+
// 'eslint:recommended',
31+
32+
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage
33+
// ESLint typescript rules
34+
'plugin:@typescript-eslint/recommended',
35+
// consider disabling this class of rules if linting takes too long
36+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
37+
38+
// Uncomment any of the lines below to choose desired strictness,
39+
// but leave only one uncommented!
40+
// See https://eslint.vuejs.org/rules/#available-rules
41+
'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention)
42+
// 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
43+
// 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
44+
45+
'plugin:prettier-vue/recommended',
46+
47+
'prettier',
48+
'plugin:vuejs-accessibility/recommended',
49+
],
50+
51+
plugins: [
52+
// required to apply rules which need type information
53+
'@typescript-eslint',
54+
// required to apply rules which check for accesability in vue files
55+
'vuejs-accessibility',
56+
// https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-file
57+
// required to lint *.vue files
58+
'vue',
59+
],
60+
61+
globals: {
62+
ga: 'readonly', // Google Analytics
63+
cordova: 'readonly',
64+
__statics: 'readonly',
65+
__QUASAR_SSR__: 'readonly',
66+
__QUASAR_SSR_SERVER__: 'readonly',
67+
__QUASAR_SSR_CLIENT__: 'readonly',
68+
__QUASAR_SSR_PWA__: 'readonly',
69+
process: 'readonly',
70+
Capacitor: 'readonly',
71+
chrome: 'readonly',
72+
},
73+
74+
// add your custom rules here
75+
rules: {
76+
'linebreak-style': 'off',
77+
78+
'no-param-reassign': 'off',
79+
'no-void': 'off',
80+
'no-nested-ternary': 'off',
81+
'no-shadow': 'off',
82+
'max-classes-per-file': 'off',
83+
'no-explicit-any': 'off',
84+
85+
'prefer-promise-reject-errors': 'off',
86+
'no-use-before-define': ['error', { functions: false }],
87+
'vue/multi-word-component-names': 'off',
88+
89+
// TypeScript
90+
quotes: ['warn', 'single', { avoidEscape: true }],
91+
'@typescript-eslint/no-explicit-any': 'off',
92+
'@typescript-eslint/explicit-function-return-type': 'off',
93+
'@typescript-eslint/explicit-module-boundary-types': 'off',
94+
'@typescript-eslint/no-non-null-assertion': 'off',
95+
'@typescript-eslint/no-shadow': 'error',
96+
'@typescript-eslint/no-unused-vars': ['warn'],
97+
98+
// allow debugger during development only
99+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
100+
},
101+
};

.github/workflows/build-deploy.yml renamed to .github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ concurrency:
1616
jobs:
1717
build:
1818
runs-on: ubuntu-latest
19-
19+
2020
steps:
2121
- name: Checkout Repo
2222
uses: actions/checkout@v3
2323

24-
- name: Build
24+
- name: Build App
2525
run: |
2626
npm ci
2727
npm run build

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ pnpm-debug.log*
88
lerna-debug.log*
99

1010
node_modules
11+
.DS_Store
1112
dist
1213
dist-ssr
14+
coverage
1315
*.local
1416

17+
/cypress/videos/
18+
/cypress/screenshots/
19+
1520
# Editor directories and files
1621
.vscode/*
1722
!.vscode/extensions.json
1823
.idea
19-
.DS_Store
2024
*.suo
2125
*.ntvs*
2226
*.njsproj

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/dist

.prettierrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"singleQuote": true,
3+
"semi": true,
4+
"trailingComma": "es5",
5+
"tabWidth": 2,
6+
"printWidth": 120,
7+
"arrowParens": "always",
8+
"bracketSpacing": true,
9+
"endOfLine": "lf",
10+
"htmlWhitespaceSensitivity": "css",
11+
"useTabs": false,
12+
"vueIndentScriptAndStyle": false,
13+
"singleAttributePerLine": true
14+
}

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3+
}

env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

index.html

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0"
8+
/>
9+
<script
10+
type="module"
11+
src="/src/main.ts"
12+
></script>
13+
<title>Image Compressor</title>
14+
</head>
315

4-
<head>
5-
<meta charset="UTF-8">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>Image Compressor</title>
8-
<script type="module" src="src/main.ts"></script>
9-
<style>
10-
h1 {
11-
text-align: center;
12-
}
13-
14-
.container {
15-
margin-block-start: 1rem;
16-
}
17-
</style>
18-
</head>
19-
20-
<body>
21-
<div class="container">
22-
<h1>Image Compressor</h1>
23-
<p>Compresses Images to below 10MB</p>
24-
<h2>Input</h2>
25-
<input type="file">
26-
27-
<h2>Output</h2>
28-
<a href="" id="download" download style="display: none;">Download</a>
29-
<p id="status" style="display: none;">Compressing...</p>
30-
</div>
31-
</body>
32-
33-
</html>
16+
<body>
17+
<div
18+
id="app"
19+
class="container"
20+
></div>
21+
</body>
22+
</html>

0 commit comments

Comments
 (0)