Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 10 additions & 203 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,211 +1,18 @@
{
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"env": {
"node": true,
"es6": true
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"rules": {
"no-extra-parens": [
"warn",
"all",
{
"nestedBinaryExpressions": false
}
],
"valid-jsdoc": [
"warn",
{
"requireReturn": false,
"requireReturnDescription": false,
"prefer": {
"arg": "param",
"argument": "param",
"prop": "property",
"constructor": "class",
"augments": "extends",
"fires": "emits",
"var": "member",
"yield": "yields",
"return": "returns",
"exception": "throws",
"virtual": "abstract"
},
"preferType": {
"String": "string",
"Number": "number",
"Boolean": "boolean",
"Symbol": "symbol",
"function": "Function",
"object": "Object",
"date": "Date",
"error": "Error"
}
}
],
"@typescript-eslint/indent": ["error", "tab"],
"accessor-pairs": "warn",
"array-callback-return": "error",
"complexity": "warn",
"curly": ["error", "multi-line", "consistent"],
"dot-location": ["error", "property"],
"dot-notation": "error",
"eqeqeq": "error",
"no-console": ["error", { "allow": ["log", "warn", "error"] }],
"no-empty-function": "error",
"no-floating-decimal": "error",
"no-implied-eval": "error",
"no-lone-blocks": "error",
"no-multi-spaces": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-new": "error",
"no-octal-escape": "error",
"no-return-assign": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-unmodified-loop-condition": "error",
"no-unused-expressions": "error",
"no-useless-call": "error",
"no-useless-concat": "error",
"no-useless-escape": "error",
"no-void": "error",
"no-warning-comments": "warn",
"wrap-iife": "error",
"yoda": "error",

"no-label-var": "error",
// We have to disable the base rule because of a weird bug w/ tslint
// https://stackoverflow.com/questions/63961803/eslint-says-all-enums-in-typescript-app-are-already-declared-in-the-upper-scope
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"no-undef-init": "error",

"callback-return": "error",
"handle-callback-err": "error",
"no-mixed-requires": "error",
"no-new-require": "error",
"no-path-concat": "error",

"array-bracket-spacing": "error",
"block-spacing": "error",
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": "error",
"comma-dangle": "error",
"comma-spacing": "error",
"comma-style": "error",
"computed-property-spacing": "error",
"consistent-this": "error",
"eol-last": "error",
"func-names": "error",
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
"id-length": [
"error",
{ "exceptions": ["i", "j", "a", "b", "e", "r", "m", "c", "x", "y", "_"] }
],
"indent": [0, 4, { "SwitchCase": 1 }],
"key-spacing": "error",
"keyword-spacing": [
"error",
{
"overrides": {
"if": { "after": true },
"for": { "after": true },
"while": { "after": true },
"catch": { "after": true },
"switch": { "after": true }
}
}
],
"max-depth": "error",
"max-len": ["error", 200, 2],
"max-nested-callbacks": ["error", { "max": 4 }],
"max-statements-per-line": ["error", { "max": 2 }],
"new-cap": "error",
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 6 }],
"no-array-constructor": "error",
"no-bitwise": "off",
"no-lonely-if": "error",
"no-mixed-operators": "error",
"no-multiple-empty-lines": [
"error",
{ "max": 2, "maxEOF": 1, "maxBOF": 0 }
],
"no-new-object": "error",
"no-spaced-func": "error",
"no-trailing-spaces": "error",
"no-unneeded-ternary": ["error", { "defaultAssignment": false }],
"no-whitespace-before-property": "error",
"object-curly-newline": "error",
"object-curly-spacing": ["error", "always"],
"operator-assignment": "error",
"operator-linebreak": [
"error",
"before",
{
"overrides": {
"+": "after",
"-": "after"
}
}
],
"padded-blocks": [
"error",
{ "classes": "always", "blocks": "never", "switches": "never" }
],
"quote-props": ["error", "as-needed"],
"quotes": [
"warning",
"single",
{ "avoidEscape": true, "allowTemplateLiterals": true }
],
"semi-spacing": "error",
"semi": "error",
"space-before-blocks": "error",
"space-before-function-paren": [
"error",
{ "anonymous": "always", "named": "never", "asyncArrow": "always" }
],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": "error",
"unicode-bom": "error",

"arrow-body-style": "error",
"arrow-spacing": "error",
"no-duplicate-imports": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-destructuring": [
"error",
{
"VariableDeclarator": {
"array": false,
"object": true
},
"AssignmentExpression": {
"array": true,
"object": true
}
},
{
"enforceForRenamedProperties": false
}
],
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"rest-spread-spacing": "error",
"template-curly-spacing": "error",
"yield-star-spacing": "error"
}
"plugins": ["react", "@typescript-eslint"],
"rules": {}
}
16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Lint Code Base
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
24 changes: 0 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,12 @@ RUN npm ci --omit=dev
# Build stage (development + build)
FROM deps AS build

<<<<<<< HEAD
# Mount caching for npm to speed up subsequent installs
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci
=======
# Install all dependencies including devDeps for build
RUN npm ci
>>>>>>> origin/mizuho-integration

# Copy the rest of the source code into the container
COPY . .

<<<<<<< HEAD
# Build the project
RUN npm run build

=======
# Ensure config.ts exists (fallback to example in CI/containers)
RUN test -f config.ts || cp config.example.ts config.ts

Expand All @@ -66,7 +53,6 @@ RUN npm run build
# Also include package.json in dist for module-alias '@root/package.json' resolution
RUN cp package.json dist/package.json

>>>>>>> origin/mizuho-integration
# ─────────────────────────────────────────────────────────────
# Final runtime stage (minimal image)
FROM base AS final
Expand All @@ -83,19 +69,9 @@ RUN apk add --no-cache \
# Run the application as a non-root user
USER node

<<<<<<< HEAD
# Copy package.json so package manager commands work
COPY package.json .

# Copy necessary files from previous stages
COPY --from=build /usr/src/app/package.json ./package.json
COPY --from=build /usr/src/app/package-lock.json ./package-lock.json
COPY --from=build /usr/src/app/tsconfig.json ./tsconfig.json
=======
# Copy necessary files from previous stages
COPY --from=build /usr/src/app/package.json ./package.json
COPY --from=build /usr/src/app/package-lock.json ./package-lock.json
>>>>>>> origin/mizuho-integration
COPY --from=deps /usr/src/app/node_modules ./node_modules
COPY --from=build /usr/src/app/dist ./dist
COPY --from=build /usr/src/app/assets ./assets
Expand Down
21 changes: 21 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// eslint.config.mjs
// @ts-check

import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

// Put your ignore patterns here instead of .eslintignore
const ignores = ["node_modules/**", "dist/**", "build/**"];

export default tseslint.config(
{
// ESLint's built-in recommended rules
...eslint.configs.recommended,
ignores,
},
// TypeScript-ESLint's recommended rules, with the same ignores applied
...tseslint.configs.recommended.map((config) => ({
...config,
ignores,
}))
);
Loading
Loading