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:
@@ -1,3 +1,6 @@
|
|||||||
|
import path from "node:path"
|
||||||
|
import { fileURLToPath } from "node:url"
|
||||||
|
|
||||||
import { FlatCompat } from "@eslint/eslintrc"
|
import { FlatCompat } from "@eslint/eslintrc"
|
||||||
import js from "@eslint/js"
|
import js from "@eslint/js"
|
||||||
import typescriptEslint from "@typescript-eslint/eslint-plugin"
|
import typescriptEslint from "@typescript-eslint/eslint-plugin"
|
||||||
@@ -10,6 +13,8 @@ const compat = new FlatCompat({
|
|||||||
allConfig: js.configs.all,
|
allConfig: js.configs.all,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const packageDir = path.dirname(fileURLToPath(import.meta.url))
|
||||||
|
|
||||||
export default defineConfig([
|
export default defineConfig([
|
||||||
{
|
{
|
||||||
extends: compat.extends("next/core-web-vitals", "plugin:import/typescript"),
|
extends: compat.extends("next/core-web-vitals", "plugin:import/typescript"),
|
||||||
@@ -22,10 +27,31 @@ export default defineConfig([
|
|||||||
parser: tsParser,
|
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: {
|
rules: {
|
||||||
"no-unused-vars": "off",
|
"no-unused-vars": "off",
|
||||||
"react/function-component-definition": "error",
|
"react/function-component-definition": "error",
|
||||||
"import/no-relative-packages": "error",
|
"import/no-relative-packages": "error",
|
||||||
|
"import/no-extraneous-dependencies": [
|
||||||
|
"warn",
|
||||||
|
{
|
||||||
|
includeInternal: true,
|
||||||
|
includeTypes: true,
|
||||||
|
packageDir: [packageDir],
|
||||||
|
},
|
||||||
|
],
|
||||||
"simple-import-sort/imports": [
|
"simple-import-sort/imports": [
|
||||||
"warn",
|
"warn",
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,13 +38,15 @@
|
|||||||
"@scandic-hotels/design-system": "workspace:*",
|
"@scandic-hotels/design-system": "workspace:*",
|
||||||
"@scandic-hotels/trpc": "workspace:*",
|
"@scandic-hotels/trpc": "workspace:*",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
|
"date-fns": "^4.1.0",
|
||||||
"downshift": "^9.0.9",
|
"downshift": "^9.0.9",
|
||||||
"motion": "^12.10.0",
|
"motion": "^12.10.0",
|
||||||
"react-aria-components": "^1.8.0",
|
"react-aria-components": "^1.8.0",
|
||||||
"react-day-picker": "^9.6.7",
|
"react-day-picker": "^9.6.7",
|
||||||
"react-hook-form": "^7.56.2",
|
"react-hook-form": "^7.56.2",
|
||||||
"react-intl": "^7.1.11",
|
"react-intl": "^7.1.11",
|
||||||
"usehooks-ts": "3.1.1"
|
"usehooks-ts": "3.1.1",
|
||||||
|
"zustand": "^4.5.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"next": "^15",
|
"next": "^15",
|
||||||
|
|||||||
@@ -6115,6 +6115,7 @@ __metadata:
|
|||||||
"@typescript-eslint/eslint-plugin": "npm:^8.32.0"
|
"@typescript-eslint/eslint-plugin": "npm:^8.32.0"
|
||||||
"@typescript-eslint/parser": "npm:^8.32.0"
|
"@typescript-eslint/parser": "npm:^8.32.0"
|
||||||
class-variance-authority: "npm:^0.7.1"
|
class-variance-authority: "npm:^0.7.1"
|
||||||
|
date-fns: "npm:^4.1.0"
|
||||||
dotenv: "npm:^16.5.0"
|
dotenv: "npm:^16.5.0"
|
||||||
downshift: "npm:^9.0.9"
|
downshift: "npm:^9.0.9"
|
||||||
eslint: "npm:^9"
|
eslint: "npm:^9"
|
||||||
@@ -6129,6 +6130,7 @@ __metadata:
|
|||||||
usehooks-ts: "npm:3.1.1"
|
usehooks-ts: "npm:3.1.1"
|
||||||
vitest: "npm:^3.2.4"
|
vitest: "npm:^3.2.4"
|
||||||
zod: "npm:^3.24.4"
|
zod: "npm:^3.24.4"
|
||||||
|
zustand: "npm:^4.5.2"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
next: ^15
|
next: ^15
|
||||||
react: ^19
|
react: ^19
|
||||||
|
|||||||
Reference in New Issue
Block a user