Skip to content

Commit

Permalink
Merge branch 'develop' into Feature/issue-152/Block/unblock-API
Browse files Browse the repository at this point in the history
  • Loading branch information
LuongDangDoanh authored Jul 5, 2024
2 parents 99bd266 + 7fb2f6b commit 401ed9e
Show file tree
Hide file tree
Showing 22 changed files with 7,796 additions and 328 deletions.
83 changes: 64 additions & 19 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"env": { "node": true, "browser": true },
"$schema": "https://json.schemastore.org/eslintrc",
"root": true,
"plugins": ["@typescript-eslint", "prettier", "@typescript-eslint"],
// "root": true,
"plugins": [
"prettier",
"@typescript-eslint",
// "@stylistic",
"import",
"promise"
],
"ignorePatterns": ["node_modules/", "dist/", "server.js", "*.d.ts"],
"extends": [
// extends mean use config from devDependencies that community created or recommended

Expand All @@ -11,19 +18,67 @@

// PLUGIN

// javascript
"plugin:promise/recommended", //eslint-plugin-promise
"plugin:import/recommended", //eslint-plugin-import

// typescript eslint
"plugin:@typescript-eslint/recommended", //@typescript-eslint/eslint-plugin
// "plugin:@typescript-eslint/stylistic", //@typescript-eslint/eslint-plugin
// "plugin:@typescript-eslint/recommended-type-checked", //@typescript-eslint/eslint-plugin
// "plugin:@typescript-eslint/stylistic-type-checked", //@typescript-eslint/eslint-plugin
"plugin:@typescript-eslint/stylistic", //@typescript-eslint/eslint-plugin
"plugin:@typescript-eslint/recommended-type-checked", //@typescript-eslint/eslint-plugin
"plugin:@typescript-eslint/stylistic-type-checked", //@typescript-eslint/eslint-plugin
"plugin:import/typescript", //eslint-plugin-import and eslint-import-resolver-typescript

// eslint stylistic
// "plugin:@stylistic/recommended-extends", //@stylistic/eslint-plugin

// prettier THIS MUST BE LAST
"plugin:prettier/recommended", //eslint-PLUGIN-prettier //disable because focus on new @stylistic/eslint-plugin
"prettier" //eslint-CONFIG-prettier (turn off eslint **rules** that conflict with prettier), turn on prettier/prettier rules
//eslint-CONFIG-prettier is used in "check-conflict-prettier-eslint" in package.json
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2020,
"project": ["./tsconfig.json"]
},
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
// rule that override the extends config above
// normal code
"no-console": "error",
"require-await": "error",
"eqeqeq": "error",
"no-nested-ternary": "error",

// eslint stylistic
// "@stylistic/quotes": ["error", "double"],
// "@stylistic/jsx-one-expression-per-line": "off",
// "@stylistic/semi": ["error", "always"],
// "@stylistic/arrow-parens": ["error", "always"],
// "@stylistic/brace-style": ["error", "1tbs", { "allowSingleLine": true }],
// "@stylistic/member-delimiter-style": [
// "error",
// {
// "multiline": { "delimiter": "semi", "requireLast": true },
// "singleline": { "delimiter": "semi", "requireLast": false }
// }
// ],

// plugin
"import/no-unresolved": "error", //eslint-plugin-import and eslint-import-resolver-typescript

// typescript
"@typescript-eslint/no-unsafe-argument": "warn", // WARN BECAUSE TOO MUCH TO FIX IN THE TIME
"@typescript-eslint/no-unsafe-member-access": "warn", // WARN BECAUSE TOO MUCH TO FIX IN THE TIME
"@typescript-eslint/no-unsafe-assignment": "warn", // WARN BECAUSE TOO MUCH TO FIX IN THE TIME
"@typescript-eslint/no-explicit-any": "warn", // WARN BECAUSE TOO MUCH TO FIX IN THE TIME
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/no-unused-vars": "warn",

// override prettier
"prettier/prettier": [
"error",
Expand All @@ -33,25 +88,15 @@
}
]
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2020,
"project": ["./tsconfig.json"]
},
"settings": {
// need to set react version for eslint-plugin-react, doesn't auto detect by default
"react": {
"version": "detect"
},
"import/resolver": {
//eslint-plugin-import and eslint-import-resolver-typescript
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
"extensions": [".js", ".ts"]
},
"typescript": {
"alwaysTryTypes": true,
"project": ["./tsconfig.json", "./tsconfig.node.json"]
"project": ["./tsconfig.json"]
}
}
}
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/checkPR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Currently migrating backdown to npm

# # Run: Check CI on PR
# name: Check CI on PR

# on:
# pull_request:
# branches: ["main"]

# jobs:
# lint_PR:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - name: Check pnpm standalone
# uses: actions/cache@v4
# with:
# path: /home/runner/setup-pnpm/node_modules/.bin/pnpm
# key: ${{ runner.os }}-pnpm-standalone
# restore-keys: |
# ${{ runner.os }}-pnpm-standalone

# - name: Install pnpm
# uses: pnpm/action-setup@v4
# with:
# version: 9
# run_install: false
# standalone: false

# - name: Install node
# uses: actions/setup-node@v4
# with:
# node-version: 20

# # - name: which pnpm
# # shell: bash
# # run: |
# # which pnpm
# # env:
# # TEST_TEST: ${{ steps.pnpmahihi.outputs.bin_dest }}

# # - name: echo echo $PNPM_HOME
# # shell: bash
# # run: |
# # echo $PNPM_HOME

# # - name: echo pnpm store directory
# # shell: bash
# # run: |
# # pnpm store path

# # - name: Get pnpm store directory
# # shell: bash
# # run: |
# # echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

# - name: Setup pnpm node_module cache
# uses: actions/cache@v4
# with:
# path: /home/runner/setup-pnpm/node_modules/.bin/store/v3
# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-pnpm-store-

# - name: Install dependencies
# run: pnpm install

# - name: Lint
# run: pnpm run prettier:check && pnpm run eslint:check-allow-warning && pnpm run check-types
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
echo "Running pre-commit hook"
# echo "Running pre-commit hook"
npm run lint-staged
npm run lint
# npm run lint
File renamed without changes.
Loading

0 comments on commit 401ed9e

Please sign in to comment.