Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
chore(frontend): scaffold
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
ferferga authored Nov 8, 2023
1 parent 4a481d5 commit f74964d
Show file tree
Hide file tree
Showing 9 changed files with 7,606 additions and 0 deletions.
86 changes: 86 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,89 @@
##### NODE #####
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
/logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/
frontend/node_modules/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# Nuxt generate
dist
frontend/dist

# Serverless directories
.serverless

# IDE / Editor
.idea

# Service worker
sw.js

# macOS
.DS_Store

# Vim swap files
*.swp

#### PYTHON ####
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
7 changes: 7 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fund=false
lockfile-version=3
save-exact=true
engine-strict=true

## Fix timeout errors in CI
fetch-retries=15
284 changes: 284 additions & 0 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
const restrictedGlobals = require('confusing-browser-globals');

const CI_environment = process.env.CI ? 0 : 1;
const commonTSAndVueConfig = {
extends: ['plugin:@typescript-eslint/recommended-requiring-type-checking'],
rules: {
'@typescript-eslint/no-misused-promises': 'off'
}
};

module.exports = {
root: true,
env: {
node: false,
browser: true
},
reportUnusedDisableDirectives: true,
ignorePatterns: [
'types/global/routes.d.ts',
'types/global/components.d.ts'
],
extends: [
'eslint:recommended',
'plugin:jsonc/recommended-with-json',
'plugin:no-unsanitized/DOM',
'plugin:optimize-regex/recommended',
'plugin:no-use-extend-native/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:promise/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:vue/vue3-recommended',
'plugin:sonarjs/recommended',
'plugin:eslint-comments/recommended',
'plugin:css/recommended',
'plugin:unicorn/recommended',
'plugin:you-dont-need-lodash-underscore/compatible',
'plugin:@intlify/vue-i18n/recommended',
'plugin:vue-scoped-css/vue3-recommended'
],
plugins: [
'jsdoc',
'no-unsanitized',
'optimize-regex',
'no-secrets',
'no-use-extend-native',
'@typescript-eslint',
'promise',
'import',
'vue',
'sonarjs',
'eslint-comments',
'css',
'unicorn',
'vue-scoped-css',
'@intlify/vue-i18n',
'file-progress'
],
rules: {
'file-progress/activate': CI_environment,
'semi': 'off',
'capitalized-comments': 'error',
'multiline-comment-style': 'error',
'@typescript-eslint/semi': ['error', 'always'],
'quotes': 'off',
'@typescript-eslint/quotes': ['error', 'single', { 'avoidEscape': true }],
'comma-dangle': 'error',
'indent': 'off',
'@typescript-eslint/indent': ['error', 2, {
'SwitchCase': 1,
'VariableDeclarator': 2,
'CallExpression': { arguments: 'first' },
'ArrayExpression': 'first',
'ObjectExpression': 'first',
'ImportDeclaration': 'first',
flatTernaryExpressions: true,
offsetTernaryExpressions: true
}],
'no-multi-spaces': ['error'],
'block-spacing': 'off',
'@typescript-eslint/block-spacing': ['error', 'always'],
'linebreak-style': ['error', 'unix'],
'brace-style': 'off',
'@typescript-eslint/brace-style': ['error'],
'unicode-bom': ['error', 'never'],
'no-trailing-spaces': ['error'],
'eol-last': ['error', 'always'],
'no-restricted-globals': ['error', ...restrictedGlobals],
'no-empty': ['error', { allowEmptyCatch: true }],
'no-secrets/no-secrets': 'error',
'import/newline-after-import': 'error',
'import/order': 'error',
'import/no-unresolved': ['error', { ignore: ['virtual:*'] }],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['vite.config.ts'],
optionalDependencies: false,
peerDependencies: false,
bundledDependencies: false
}
],
'import/no-nodejs-modules': 'error',
'no-restricted-imports': 'off',
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: [
{
group: ['*/plugins*'],
message:
'Do not use Vue plugins directly. Use composables (from @/composables) instead.',
allowTypeImports: true
},
{
group: ['*/main*'],
message:
'Do not use the Vue instance directly. Use composables (from @/composables) instead.',
allowTypeImports: true
}
]
}
],
'jsdoc/require-hyphen-before-param-description': 'error',
'jsdoc/no-types': 'error',
'jsdoc/require-jsdoc': 'error',
'jsdoc/informative-docs': 'error',
'promise/no-nesting': 'error',
'promise/no-return-in-finally': 'error',
'promise/prefer-await-to-callbacks': 'error',
'promise/prefer-await-to-then': 'error',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': true,
'ts-ignore': true,
'ts-nocheck': true,
'ts-check': true
}
],
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/prefer-ts-expect-error': 'error',
'@typescript-eslint/explicit-member-accessibility': 'error',
'prefer-arrow-callback': 'error',
'padding-line-between-statements': [
'error',
// Always require blank lines after directives (like 'use-strict'), except between directives
{ blankLine: 'always', prev: 'directive', next: '*' },
{ blankLine: 'any', prev: 'directive', next: 'directive' },
// Always require blank lines after import, except between imports
{ blankLine: 'always', prev: 'import', next: '*' },
{ blankLine: 'any', prev: 'import', next: 'import' },
// Always require blank lines before and after every sequence of variable declarations and export
{
blankLine: 'always',
prev: '*',
next: ['const', 'let', 'var', 'export']
},
{
blankLine: 'always',
prev: ['const', 'let', 'var', 'export'],
next: '*'
},
{
blankLine: 'any',
prev: ['const', 'let', 'var', 'export'],
next: ['const', 'let', 'var', 'export']
},
// Always require blank lines before and after class declaration, if, do/while, switch, try
{
blankLine: 'always',
prev: '*',
next: ['if', 'class', 'for', 'do', 'while', 'switch', 'try']
},
{
blankLine: 'always',
prev: ['if', 'class', 'for', 'do', 'while', 'switch', 'try'],
next: '*'
},
// Always require blank lines before return statements
{ blankLine: 'always', prev: '*', next: 'return' }
],
// Force some component order stuff, formatting and such, for consistency
'curly': ['error', 'all'],
'unicorn/filename-case': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-await-expression-member': 'off',
'no-multiple-empty-lines': 'error',
'vue/component-name-in-template-casing': [
'error',
'PascalCase',
{
registeredComponentsOnly: false
}
],
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'always'
}
}
],
'vue/define-macros-order': ['error', {
order: ['defineOptions', 'defineProps', 'defineEmits', 'defineSlots']
}],
'vue/html-closing-bracket-newline': ['error', { multiline: 'never' }],
'vue/multiline-html-element-content-newline': 'error',
'vue/multi-word-component-names': 'off',
'vue/return-in-computed-property': 'off'
},
/**
* Overrides allows us to omit the --ext CLI argument, simplifying package.json scripts section
*/
overrides: [
{
files: ['*.md'],
rules: {
'no-trailing-spaces': ['off']
}
},
{
files: ['*.ts', '*.tsx'],
parser: 'typescript-eslint-parser-for-extra-files',
parserOptions: {
parser: '@typescript-eslint/parser',
sourceType: 'module',
project: 'tsconfig.json',
extraFileExtensions: ['.vue']
},
...commonTSAndVueConfig
},
{
files: ['*.vue'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: 'typescript-eslint-parser-for-extra-files',
project: 'tsconfig.json',
sourceType: 'module',
vueFeatures: {
customMacros: ['defineModel']
}
},
...commonTSAndVueConfig
},
// TODO: Review once ESLint config is ESM
{
files: ['.eslintrc.cjs'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'import/no-extraneous-dependencies': 'off',
'unicorn/prefer-module': 'off',
'no-undef': 'off'
}
},
{
files: ['vite.config.ts', 'scripts/**/*.ts'],
rules: {
'import/no-nodejs-modules': 'off'
}
},
{
files: ['*.js']
},
{
files: ['*.d.ts'],
rules: {
'multiline-comment-style': 'off'
}
}
],
settings: {
'import/resolver': {
typescript: true,
node: true
},
progress: {
hide: false,
successMessage: 'Linting done!'
}
}
};
Empty file removed frontend/.keep
Empty file.
Loading

0 comments on commit f74964d

Please sign in to comment.