Skip to content
Open
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
29 changes: 0 additions & 29 deletions examples/basic-nextjs-pages-router/.eslintrc

This file was deleted.

8 changes: 3 additions & 5 deletions examples/basic-nextjs-pages-router/.sitecore/component-map.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
// Below are built-in components that are available in the app, it's recommended to keep them as is

import { BYOCWrapper, NextjsContentSdkComponent, FEaaSWrapper } from '@sitecore-content-sdk/nextjs';
import { Form } from '@sitecore-content-sdk/nextjs';
// end of built-in components

// Components imported from the app itself
// end of built-in components
import * as PartialDesignDynamicPlaceholder from 'src/components/partial-design-dynamic-placeholder/PartialDesignDynamicPlaceholder';


// Components must be registered within the map to match the string key with component name in Sitecore
export const componentMap = new Map<string, NextjsContentSdkComponent>([
['BYOCWrapper', BYOCWrapper],
['FEaaSWrapper', FEaaSWrapper],
['Form', Form],
['PartialDesignDynamicPlaceholder', PartialDesignDynamicPlaceholder],
['PartialDesignDynamicPlaceholder', { ...PartialDesignDynamicPlaceholder }],
]);

export default componentMap;
8 changes: 6 additions & 2 deletions examples/basic-nextjs-pages-router/.sitecore/import-map.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// This file is auto-generated by the Sitecore Content SDK.
// Below are built-in Content SDK imports neccessary for the import map
import { combineImportEntries, defaultImportEntries } from '@sitecore-content-sdk/nextjs/codegen';
import {
combineImportEntries,
defaultImportEntries,
ImportEntry,
} from '@sitecore-content-sdk/nextjs/codegen';
// end of built-in imports

import { useEffect } from 'react';
Expand Down Expand Up @@ -72,6 +76,6 @@ const importMap = [
{ name: 'default', value: config },
]
}
];
] as ImportEntry[];

export default combineImportEntries(defaultImportEntries, importMap);
49 changes: 49 additions & 0 deletions examples/basic-nextjs-pages-router/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

const eslintConfig = [
...compat.extends(
"next",
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended"
),
{
plugins: {},
rules: {
// Don't force next/image
"@next/next/no-img-element": "off",
// Don't force alt for <Image/> (sourced from Sitecore media)
"jsx-a11y/alt-text": ["warn", { elements: ["img"] }],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
caughtErrorsIgnorePattern: ".",
},
],
"@typescript-eslint/no-explicit-any": "error",
"jsx-quotes": ["error", "prefer-double"],
},
ignores: [
".generated/**/*",
"**/*.d.ts",
"**/*.js",
"node_modules/**",
".next/**",
"out/**",
"build/**",
],
},
];

export default eslintConfig;
Loading
Loading