Merged in fix/linting-booking-flow (pull request #2709)

Fix/linting booking flow

* fix import issues and add lint check no-extraneous-dependencies
* fix use type HotelType instead of string
* add no-extraneous-dependencies lint check to booking-flow

Approved-by: Anton Gunnarsson
This commit is contained in:
Joakim Jäderberg
2025-08-27 12:02:37 +00:00
parent 80c3327419
commit 45a8fd8c43
3 changed files with 31 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
import path from "node:path"
import { fileURLToPath } from "node:url"
import { FlatCompat } from "@eslint/eslintrc"
import js from "@eslint/js"
import typescriptEslint from "@typescript-eslint/eslint-plugin"
@@ -10,6 +13,8 @@ const compat = new FlatCompat({
allConfig: js.configs.all,
})
const packageDir = path.dirname(fileURLToPath(import.meta.url))
export default defineConfig([
{
extends: compat.extends("next/core-web-vitals", "plugin:import/typescript"),
@@ -22,10 +27,31 @@ export default defineConfig([
parser: tsParser,
},
settings: {
// Ensure the plugin can resolve workspace packages and TS path aliases
"import/resolver": {
typescript: {
project: [path.join(packageDir, "tsconfig.json")],
alwaysTryTypes: true,
},
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
rules: {
"no-unused-vars": "off",
"react/function-component-definition": "error",
"import/no-relative-packages": "error",
"import/no-extraneous-dependencies": [
"warn",
{
includeInternal: true,
includeTypes: true,
packageDir: [packageDir],
},
],
"simple-import-sort/imports": [
"warn",
{

View File

@@ -38,13 +38,15 @@
"@scandic-hotels/design-system": "workspace:*",
"@scandic-hotels/trpc": "workspace:*",
"class-variance-authority": "^0.7.1",
"date-fns": "^4.1.0",
"downshift": "^9.0.9",
"motion": "^12.10.0",
"react-aria-components": "^1.8.0",
"react-day-picker": "^9.6.7",
"react-hook-form": "^7.56.2",
"react-intl": "^7.1.11",
"usehooks-ts": "3.1.1"
"usehooks-ts": "3.1.1",
"zustand": "^4.5.2"
},
"peerDependencies": {
"next": "^15",

View File

@@ -6115,6 +6115,7 @@ __metadata:
"@typescript-eslint/eslint-plugin": "npm:^8.32.0"
"@typescript-eslint/parser": "npm:^8.32.0"
class-variance-authority: "npm:^0.7.1"
date-fns: "npm:^4.1.0"
dotenv: "npm:^16.5.0"
downshift: "npm:^9.0.9"
eslint: "npm:^9"
@@ -6129,6 +6130,7 @@ __metadata:
usehooks-ts: "npm:3.1.1"
vitest: "npm:^3.2.4"
zod: "npm:^3.24.4"
zustand: "npm:^4.5.2"
peerDependencies:
next: ^15
react: ^19