Skip to content

Commit

Permalink
Merge pull request #291 from cryptomator/feature/esm
Browse files Browse the repository at this point in the history
Migrate Build to ESM
  • Loading branch information
overheadhunter authored Aug 23, 2024
2 parents bd3c5dd + 3e464bc commit c3408a4
Show file tree
Hide file tree
Showing 35 changed files with 490 additions and 354 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated to Java 21 (#272)
- Updated to Quarkus 3.8.x LTS (#272)
- Bumpd build time dependencies
- Migrated remaining commonjs modules in frontend build to ESM
- Memoize infrequently changing data, reducing XHR roundtrips
- Switched to JWK thumbprint format in user profile
- Switched to Repository Pattern (#273)
Expand Down
51 changes: 0 additions & 51 deletions frontend/.eslintrc.js

This file was deleted.

12 changes: 7 additions & 5 deletions frontend/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
"html.format.wrapLineLength": 0,
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.quoteStyle": "single",
"mochaExplorer.env": {
"TS_NODE_COMPILER_OPTIONS": "{\"module\": \"commonjs\" }",
// "TS_NODE_PROJECT": "./test/tsconfig.json"
},
"mochaExplorer.nodeArgv": [
"--loader=ts-node/esm",
"--no-warnings=ExperimentalWarning",
"--experimental-specifier-resolution=node"
],
"mochaExplorer.files": "test/**/*.spec.ts",
"mochaExplorer.require": "ts-node/register",
"eslint.validate": ["typescript", "javascript", "vue"]
"eslint.validate": ["typescript", "javascript", "vue"],
"eslint.useFlatConfig": true
}
97 changes: 97 additions & 0 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// @ts-check
import eslint from "@eslint/js";
import pluginVue from 'eslint-plugin-vue';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
files: ['src/**/*.ts', 'test/**/*.ts'],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
],
plugins: {
'@typescript-eslint': tseslint.plugin,
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
ecmaVersion: 'latest',
sourceType: 'module',
},
},
rules: {
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-function-type': 'warn',
'@typescript-eslint/no-unused-vars': 'off', // is checked by noUnusedLocals in tsconfig.json // or use ['error', { 'ignoreRestSiblings': true }]
'no-unused-vars': 'off', // is checked by noUnusedLocals in tsconfig.json
'no-undef': 'off', // types checked by typescript already
'keyword-spacing': ['error', { before: true, after: true}],
'linebreak-style': ['error', 'unix'],
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true, }],
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0, maxBOF: 0 }],
'object-curly-spacing': ['error', 'always'],
'padded-blocks': ['error', 'never'],
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'space-infix-ops': 'error',
'indent': ['error', 2, { SwitchCase: 1 }],
}
},
{
files: ['test/**/*.ts'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off'
}
},
{
files: ['src/**/*.vue'],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs["flat/recommended"],
],
plugins: {
'@typescript-eslint': tseslint.plugin,
},
languageOptions: {
parserOptions: {
parser: tseslint.parser,
ecmaVersion: 'latest',
sourceType: 'module',
extraFileExtensions: ['.vue'],
ecmaFeatures: {
jsx: true
}
},
},
rules: {
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-function-type': 'warn',
'@typescript-eslint/no-unused-vars': 'off', // is checked by noUnusedLocals in tsconfig.json // or use ['error', { 'ignoreRestSiblings': true }]
'no-unused-vars': 'off', // is checked by noUnusedLocals in tsconfig.json
'no-undef': 'off', // types checked by typescript already
'keyword-spacing': ['error', { before: true, after: true}],
'linebreak-style': ['error', 'unix'],
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true, }],
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0, maxBOF: 0 }],
'object-curly-spacing': ['error', 'always'],
'padded-blocks': ['error', 'never'],
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'space-infix-ops': 'error',
'indent': ['error', 2, { SwitchCase: 1 }],
'vue/block-tag-newline': ['error', { singleline: 'consistent', multiline: 'consistent', }],
'vue/html-closing-bracket-spacing': 'off',
'vue/html-self-closing': 'off',
'vue/max-attributes-per-line': 'off',
'vue/padding-line-between-blocks': 'error',
'vue/singleline-html-element-content-newline': 'off',
'vue/space-infix-ops': 'error',
},
}
);
Loading

0 comments on commit c3408a4

Please sign in to comment.