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",
{