Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge changes from the dev branch into the stage branch #397

Merged
merged 17 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
NODE_ENV=development
VITE_ENV=dev
VITE_API_HOST=http://localhost:8000/
VITE_ADMIN_PANEL_HOST=http://localhost:3000/
VITE_SECURE_LOCAL_STORAGE_HASH_KEY=ML_SECURE
VITE_SECURE_LOCAL_STORAGE_PREFIX=ML_SECURE
VITE_IV_LENGTH=16
VITE_BUILD_VERSION=dev-build
18 changes: 11 additions & 7 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
node_modules/
dist/
.prettierrc.js
.eslintrc.js
env.d.ts
public
.gitignore
# Ignore everything
/*

# Except for the src directory
!src

# And any top-level JS or TS files
!/*.js
!/*.jsx
!/*.ts
!/*.tsx
110 changes: 79 additions & 31 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ module.exports = {
jest: true,
},
parser: '@typescript-eslint/parser',
plugins: ['react', 'react-hooks', '@typescript-eslint', 'prettier', 'eslint-plugin-import'],
plugins: [
'react',
'react-hooks',
'@typescript-eslint',
'prettier',
'eslint-plugin-import',
'unused-imports',
],
overrides: [
{
files: ['*.ts', '*.tsx'],
Expand All @@ -24,41 +31,16 @@ module.exports = {
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
],
rules: {
'linebreak-style': ['error', 'unix'],
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-floating-promises': 'off',
// Error
'@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }],
'prettier/prettier': 'error',
'react/display-name': 'off',
'react/prop-types': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'no-console': "warn",
'no-case-declarations': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'import/order': [
'error',
{
groups: [
['external', 'builtin'],
'internal',
['sibling', 'parent'],
'index',
],
groups: [['external', 'builtin'], 'internal', ['sibling', 'parent'], 'index'],
pathGroups: [
{
pattern: '@(react)',
Expand All @@ -77,7 +59,73 @@ module.exports = {
caseInsensitive: true,
},
},
]
],
'unused-imports/no-unused-imports': 'error',
'import/no-cycle': 'error',
'constructor-super': 'error',
'no-this-before-super': 'error',
'no-useless-computed-key': 'error',
'no-useless-constructor': 'off',
'no-useless-rename': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-template': 'error',
'no-restricted-syntax': ['error', 'ForInStatement', 'SequenceExpression'],
'no-caller': 'error',
'no-template-curly-in-string': 'error',
'array-callback-return': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
eqeqeq: ['error', 'always'],
'no-lone-blocks': 'error',
'no-proto': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-undef-init': 'error',
'no-nested-ternary': 'error',
'no-unneeded-ternary': 'error',
'no-debugger': 'error',
'no-empty': 'error',
'no-unused-labels': 'error',
'prefer-const': 'error',

// Warn
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-floating-promises': 'warn',
'react/display-name': 'warn',
'react/prop-types': 'warn',
'react-hooks/exhaustive-deps': 'warn',
'no-console': 'warn',
'@typescript-eslint/no-non-null-assertion': 'warn',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],

// Off
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'no-case-declarations': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-extra-semi': 'off',
'prefer-destructuring': 'off',
camelcase: 'off',
},
},
],
Expand All @@ -86,4 +134,4 @@ module.exports = {
version: 'detect',
},
},
};
};
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI
on: [pull_request]

env:
NODE_VERSION: 20.11.0

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- uses: actions/cache@v4
with:
path: |
~/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}

- run: yarn install --frozen-lockfile

- uses: wearerequired/lint-action@v2
with:
eslint: true
eslint_extensions: mjs,js,jsx,mts,ts,tsx
prettier: true
prettier_extensions: mjs,js,jsx,mts,ts,tsx
continue_on_error: false
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install deps
run: yarn install --frozen-lockfile

- uses: actions/cache@v4
with:
path: |
~/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}

- name: Running tests
env:
REACT_APP_API_DOMAIN: http://localhost:8080
run: yarn test
13 changes: 0 additions & 13 deletions .github/workflows/tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ coverage
*.sw?
.env
.env*

!.env.example
16 changes: 13 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/node_modules
/public
/src/i18n/
# Ignore everything
/*

# Except for the src directory
!src

# And any top-level JS or TS files
!/*.js
!/*.mjs
!/*.jsx
!/*.ts
!/*.mts
!/*.tsx
14 changes: 8 additions & 6 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
arrowParens: 'always',
bracketSameLine: false,
bracketSpacing: true,
singleQuote: false,
singleQuote: true,
jsxSingleQuote: false,
trailingComma: 'all',
printWidth: 120,
semi: true,
printWidth: 100,
tabWidth: 2,
useTabs: false,
semi: false
}
endOfLine: 'lf',
};
2 changes: 1 addition & 1 deletion Jenkinsfile.groovy
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build( job: env.MindloggerWebRefactorNewBuilder )
build( job: env.MindloggerWebRefactorBuilder )
Loading
Loading