Skip to content
This repository was archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
refactor: updated eslint, prettier configs, make tragets and ci checks
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Biriukov <[email protected]>
  • Loading branch information
birtony committed Sep 15, 2022
1 parent 9221c1a commit 551945b
Show file tree
Hide file tree
Showing 133 changed files with 12,430 additions and 12,712 deletions.
15 changes: 15 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Copyright SecureKey Technologies Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

**/package.json
**/package-lock.json
**/node_modules/**
**/dist/
**/public/agent-js-worker/
**/build/
test/fixtures/keys/tls
test/fixtures/wallet-web/config/

49 changes: 31 additions & 18 deletions cmd/wallet-web/.eslintrc.js → .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

module.exports = {
root: true,
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 2022,
vueFeatures: {
filter: true,
interpolationAsNonHTML: false,
},
},
env: { browser: true, es2022: true, node: true, mocha: true },
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'plugin:tailwindcss/recommended',
'plugin:wdio/recommended',
'plugin:mocha/recommended',
'plugin:eslint-comments/recommended',
'plugin:i18n-json/recommended',
'plugin:prettier/recommended',
'prettier',
],
plugins: ['vue', 'tailwindcss', 'eslint-comments', 'i18n-json', 'prettier'],
plugins: ['vue', 'tailwindcss', 'wdio', 'mocha', 'eslint-comments', 'prettier'],
// Default rules for any file we lint
rules: {
'vue/multi-word-component-names': [
Expand All @@ -32,19 +34,14 @@ module.exports = {
* Disallow the use of console
* https://eslint.org/docs/rules/no-console
*/
'no-console': 'off',
'no-console': 'warn',

/**
* Disallow Reassignment of Function Parameters
* https://eslint.org/docs/rules/no-param-reassign
*/
'no-param-reassign': ['error', { props: false }],

/** Disallows unnecessary return await
* https://eslint.org/docs/rules/no-return-await
*/
'no-return-await': 'error',

/**
* Disallow using an async function as a Promise executor
* https://eslint.org/docs/rules/no-async-promise-executor
Expand All @@ -55,7 +52,8 @@ module.exports = {
* Disallow await inside of loops
* https://eslint.org/docs/rules/no-await-in-loop
*/
'no-await-in-loop': 'error',
// TODO: https://github.com/trustbloc/wallet/issues/1885 fix related code and enable this rule
'no-await-in-loop': 'warn',

/**
* Disallow assignments that can lead to race conditions due to
Expand Down Expand Up @@ -87,10 +85,25 @@ module.exports = {
* https://eslint.org/docs/rules/class-methods-use-this
*/
'class-methods-use-this': 'off',

'mocha/max-top-level-suites': ['warn', { limit: 2 }],

/**
* Added temporary to disable error for defineProps in setup scripts in Vue components
*/
'no-unused-vars': ['error', { varsIgnorePattern: 'props' }],

/**
* TODO: https://github.com/trustbloc/wallet/issues/1886 remove once corresponding issues are fixed
*/
'mocha/no-setup-in-describe': 'off',
},
globals: {
__webpack_public_path__: 'writable',
},
settings: {
tailwindcss: {
config: 'tailwind.js',
config: 'cmd/wallet-web/tailwind.js',
},
},
};
120 changes: 60 additions & 60 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,105 +11,105 @@ version: 2

updates:
# Root package.json
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "weekly"
day: "monday"
time: "04:00"
interval: 'weekly'
day: 'monday'
time: '04:00'
# Use Eastern Standard Time (UTC -05:00)
timezone: "America/Toronto"
timezone: 'America/Toronto'
open-pull-requests-limit: 1
commit-message:
prefix: "chore(deps): "
prefix: 'chore(deps): '
labels:
- "dependencies"
- "area: UI"
- 'dependencies'
- 'area: UI'

# Wallet Web package.json
- package-ecosystem: "npm"
directory: "/cmd/wallet-web"
- package-ecosystem: 'npm'
directory: '/cmd/wallet-web'
schedule:
interval: "weekly"
day: "monday"
interval: 'weekly'
day: 'monday'
# By default, the time is set to 05:00
timezone: "America/Toronto"
timezone: 'America/Toronto'
open-pull-requests-limit: 1
commit-message:
prefix: "chore(deps): "
prefix: 'chore(deps): '
labels:
- "dependencies"
- "area: UI"
- 'dependencies'
- 'area: UI'

# UI Automation package.json
- package-ecosystem: "npm"
directory: "/test/ui-automation"
- package-ecosystem: 'npm'
directory: '/test/ui-automation'
schedule:
interval: "weekly"
day: "tuesday"
time: "04:00"
timezone: "America/Toronto"
interval: 'weekly'
day: 'tuesday'
time: '04:00'
timezone: 'America/Toronto'
open-pull-requests-limit: 1
commit-message:
prefix: "chore(deps): "
prefix: 'chore(deps): '
labels:
- "dependencies"
- "area: integration tests"
- 'dependencies'
- 'area: integration tests'

# Demo Login Consent Server go.mod
- package-ecosystem: "gomod"
directory: "/test/mock/demo-login-consent-server"
- package-ecosystem: 'gomod'
directory: '/test/mock/demo-login-consent-server'
schedule:
interval: "weekly"
day: "wednesday"
timezone: "America/Toronto"
interval: 'weekly'
day: 'wednesday'
timezone: 'America/Toronto'
open-pull-requests-limit: 1
commit-message:
prefix: "chore(deps): "
prefix: 'chore(deps): '
labels:
- "dependencies"
- "area: backend"
- 'dependencies'
- 'area: backend'

# Wallet Web Dockerfile
- package-ecosystem: "docker"
directory: "/images/wallet-web"
- package-ecosystem: 'docker'
directory: '/images/wallet-web'
schedule:
interval: "weekly"
day: "thursday"
time: "04:00"
timezone: "America/Toronto"
interval: 'weekly'
day: 'thursday'
time: '04:00'
timezone: 'America/Toronto'
open-pull-requests-limit: 1
commit-message:
prefix: "chore(deps): "
prefix: 'chore(deps): '
labels:
- "dependencies"
- "area: docker"
- 'dependencies'
- 'area: docker'

# Demo Login Consent Server Dockerfile
- package-ecosystem: "docker"
directory: "/test/mock/demo-login-consent-server/image"
- package-ecosystem: 'docker'
directory: '/test/mock/demo-login-consent-server/image'
schedule:
interval: "weekly"
day: "thursday"
time: "06:00"
timezone: "America/Toronto"
interval: 'weekly'
day: 'thursday'
time: '06:00'
timezone: 'America/Toronto'
open-pull-requests-limit: 1
commit-message:
prefix: "chore(deps): "
prefix: 'chore(deps): '
labels:
- "dependencies"
- "area: docker"
- 'dependencies'
- 'area: docker'

# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: "weekly"
day: "friday"
timezone: "America/Toronto"
interval: 'weekly'
day: 'friday'
timezone: 'America/Toronto'
open-pull-requests-limit: 1
commit-message:
prefix: "chore(deps): "
prefix: 'chore(deps): '
labels:
- "dependencies"
- "area: CI/CD"
- 'dependencies'
- 'area: CI/CD'
Loading

0 comments on commit 551945b

Please sign in to comment.