Skip to content
Draft
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
6 changes: 4 additions & 2 deletions .github/workflows/ui-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ on:
- "package.json"
- "package-lock.json"
- ".github/workflows/ui-lint.yml"
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
ui-lint:
name: UI Lint
runs-on: buildjet-4vcpu-ubuntu-2204
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: v21.1.0
node-version: v22.15.0
cache: "npm"
cache-dependency-path: "ui/package-lock.json"
- name: Install dependencies
Expand Down
108 changes: 57 additions & 51 deletions ui/eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,48 +1,44 @@
const {
defineConfig,
globalIgnores,
} = require("eslint/config");
const { defineConfig, globalIgnores } = require("eslint/config");
const eslintPluginPrettierRecommended = require("eslint-plugin-prettier/recommended");

const globals = require("globals");

const {
fixupConfigRules,
} = require("@eslint/compat");
const { fixupConfigRules } = require("@eslint/compat");

const tsParser = require("@typescript-eslint/parser");
const reactRefresh = require("eslint-plugin-react-refresh");
const js = require("@eslint/js");

const {
FlatCompat,
} = require("@eslint/eslintrc");
const { FlatCompat } = require("@eslint/eslintrc");

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

module.exports = defineConfig([{
module.exports = defineConfig([
{
languageOptions: {
globals: {
...globals.browser,
},
globals: {
...globals.browser,
},

parser: tsParser,
ecmaVersion: "latest",
sourceType: "module",
parser: tsParser,
ecmaVersion: "latest",
sourceType: "module",

parserOptions: {
project: ["./tsconfig.json", "./tsconfig.node.json"],
tsconfigRootDir: __dirname,
ecmaFeatures: {
jsx: true
}
parserOptions: {
project: ["./tsconfig.json", "./tsconfig.node.json"],
tsconfigRootDir: __dirname,
ecmaFeatures: {
jsx: true,
},
},
},

extends: fixupConfigRules(compat.extends(
extends: fixupConfigRules(
compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/stylistic",
Expand All @@ -51,43 +47,53 @@ module.exports = defineConfig([{
"plugin:react/jsx-runtime",
"plugin:import/recommended",
"prettier",
)),
),
),

plugins: {
"react-refresh": reactRefresh,
"react-refresh": reactRefresh,
},

rules: {
"react-refresh/only-export-components": ["warn", {
allowConstantExport: true,
}],
"react-refresh/only-export-components": [
"warn",
{
allowConstantExport: true,
},
],

"import/order": ["error", {
groups: ["builtin", "external", "internal", "parent", "sibling"],
"newlines-between": "always",
}],
"import/order": [
"error",
{
groups: ["builtin", "external", "internal", "parent", "sibling"],
"newlines-between": "always",
},
],
},

settings: {
"react": {
"version": "detect"
},
"import/resolver": {
alias: {
map: [
["@components", "./src/components"],
["@routes", "./src/routes"],
["@assets", "./src/assets"],
["@", "./src"],
],
react: {
version: "detect",
},
"import/resolver": {
alias: {
map: [
["@components", "./src/components"],
["@routes", "./src/routes"],
["@assets", "./src/assets"],
["@", "./src"],
],

extensions: [".ts", ".tsx", ".js", ".jsx", ".json"],
},
extensions: [".ts", ".tsx", ".js", ".jsx", ".json"],
},
},
},
}, globalIgnores([
},
globalIgnores([
"**/dist",
"**/.eslintrc.cjs",
"**/tailwind.config.js",
"**/postcss.config.js",
])]);
]),
eslintPluginPrettierRecommended,
]);
83 changes: 82 additions & 1 deletion ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"build:device": "tsc && vite build --mode=device --emptyOutDir",
"build:staging": "tsc && vite build --mode=cloud-staging",
"build:prod": "tsc && vite build --mode=cloud-production",
"lint": "eslint './src/**/*.{ts,tsx}'",
"lint:fix": "eslint './src/**/*.{ts,tsx}' --fix",
"lint": "eslint './src/**/*.{ts,tsx,css}'",
"lint:fix": "eslint './src/**/*.{ts,tsx,css}' --fix",
"preview": "vite preview"
},
"dependencies": {
Expand Down Expand Up @@ -70,12 +70,13 @@
"eslint": "^9.26.0",
"eslint-config-prettier": "^10.1.5",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.4.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.1.0",
"postcss": "^8.5.3",
"prettier": "^3.5.3",
"prettier": "3.5.3",
"prettier-plugin-tailwindcss": "^0.6.11",
"tailwindcss": "^4.1.7",
"typescript": "^5.8.3",
Expand Down
Loading
Loading