create-content-sdk-app 1.3.0-canary.7 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +5 -5
  2. package/dist/bin.js +119 -119
  3. package/dist/common/base/Initializer.js +2 -2
  4. package/dist/common/base/args.js +2 -2
  5. package/dist/common/base/prompts.js +7 -7
  6. package/dist/common/index.js +18 -18
  7. package/dist/common/processes/install.js +55 -55
  8. package/dist/common/processes/next.js +63 -63
  9. package/dist/common/processes/transform.js +115 -115
  10. package/dist/common/utils/cmd.js +53 -53
  11. package/dist/common/utils/helpers.js +80 -80
  12. package/dist/index.js +6 -6
  13. package/dist/initialize.js +71 -71
  14. package/dist/initializers/nextjs/args.js +2 -2
  15. package/dist/initializers/nextjs/index.js +30 -30
  16. package/dist/initializers/nextjs/prompts.js +26 -26
  17. package/dist/initializers/nextjs-app-router (beta)/args.js +2 -2
  18. package/dist/initializers/nextjs-app-router (beta)/index.js +30 -30
  19. package/dist/initializers/nextjs-app-router (beta)/prompts.js +26 -26
  20. package/dist/templates/nextjs/.cursor/rules/general.mdc +81 -81
  21. package/dist/templates/nextjs/.cursor/rules/javascript.mdc +112 -112
  22. package/dist/templates/nextjs/.cursor/rules/project-setup.mdc +100 -100
  23. package/dist/templates/nextjs/.cursor/rules/sitecore.mdc +147 -147
  24. package/dist/templates/nextjs/.env.container.example +27 -27
  25. package/dist/templates/nextjs/.env.remote.example +45 -44
  26. package/dist/templates/nextjs/.gitattributes +11 -11
  27. package/dist/templates/nextjs/.prettierrc +8 -8
  28. package/dist/templates/nextjs/.vscode/extensions.json +8 -8
  29. package/dist/templates/nextjs/.vscode/launch.json +15 -15
  30. package/dist/templates/nextjs/.windsurfrules +183 -183
  31. package/dist/templates/nextjs/CLAUDE.md +170 -170
  32. package/dist/templates/nextjs/LICENSE.txt +202 -202
  33. package/dist/templates/nextjs/LLMs.txt +179 -179
  34. package/dist/templates/nextjs/README.md +7 -7
  35. package/dist/templates/nextjs/copilot-instructions.md +170 -170
  36. package/dist/templates/nextjs/eslint.config.mjs +81 -81
  37. package/dist/templates/nextjs/gitignore +28 -28
  38. package/dist/templates/nextjs/package.json +68 -68
  39. package/dist/templates/nextjs/sitecore.config.ts.example +38 -38
  40. package/dist/templates/nextjs/src/middleware.ts +16 -7
  41. package/dist/templates/nextjs/tsconfig.json +40 -40
  42. package/dist/templates/nextjs-app-router (beta)/.cursor/rules/app-router-setup.mdc +116 -116
  43. package/dist/templates/nextjs-app-router (beta)/.cursor/rules/general.mdc +80 -80
  44. package/dist/templates/nextjs-app-router (beta)/.cursor/rules/javascript.mdc +112 -112
  45. package/dist/templates/nextjs-app-router (beta)/.cursor/rules/sitecore.mdc +171 -171
  46. package/dist/templates/nextjs-app-router (beta)/.env.container.example +27 -27
  47. package/dist/templates/nextjs-app-router (beta)/.env.remote.example +45 -44
  48. package/dist/templates/nextjs-app-router (beta)/.gitattributes +11 -11
  49. package/dist/templates/nextjs-app-router (beta)/.sitecore/import-map.server.ts +60 -0
  50. package/dist/templates/nextjs-app-router (beta)/.windsurfrules +287 -287
  51. package/dist/templates/nextjs-app-router (beta)/CLAUDE.md +271 -271
  52. package/dist/templates/nextjs-app-router (beta)/LLMs.txt +236 -236
  53. package/dist/templates/nextjs-app-router (beta)/README.md +7 -7
  54. package/dist/templates/nextjs-app-router (beta)/copilot-instructions.md +271 -271
  55. package/dist/templates/nextjs-app-router (beta)/eslint.config.mjs +29 -29
  56. package/dist/templates/nextjs-app-router (beta)/gitignore +31 -29
  57. package/dist/templates/nextjs-app-router (beta)/package.json +54 -54
  58. package/dist/templates/nextjs-app-router (beta)/postcss.config.mjs +5 -5
  59. package/dist/templates/nextjs-app-router (beta)/sitecore.config.ts.example +38 -38
  60. package/dist/templates/nextjs-app-router (beta)/src/Layout.tsx +9 -3
  61. package/dist/templates/nextjs-app-router (beta)/src/Providers.tsx +9 -17
  62. package/dist/templates/nextjs-app-router (beta)/src/app/[site]/[locale]/[[...path]]/page.tsx +1 -5
  63. package/dist/templates/nextjs-app-router (beta)/src/app/api/editing/config/route.ts +2 -0
  64. package/dist/templates/nextjs-app-router (beta)/src/app/api/editing/render/route.ts +1 -1
  65. package/dist/templates/nextjs-app-router (beta)/src/app/globals.css +1 -1
  66. package/dist/templates/nextjs-app-router (beta)/src/middleware.ts +12 -1
  67. package/dist/templates/nextjs-app-router (beta)/tsconfig.json +48 -48
  68. package/package.json +73 -74
  69. package/LICENSE.MD +0 -202
  70. package/dist/templates/nextjs-app-router (beta)/src/DesignLibraryLayout.tsx +0 -7
  71. /package/dist/templates/nextjs-app-router (beta)/.sitecore/{import-map.ts → import-map.client.ts} +0 -0
@@ -1,170 +1,170 @@
1
- # GitHub Copilot Instructions for Sitecore Content SDK Next.js Project
2
-
3
- ## Project Purpose and Tech Stack
4
-
5
- This is a **Sitecore Content SDK** application built with **Next.js** and **TypeScript**. The project follows Sitecore best practices for XM Cloud development and provides a modern, performant web application framework.
6
-
7
- ### Key Technologies
8
- - **Next.js** - React framework with SSR/SSG capabilities
9
- - **Sitecore Content SDK** - Official SDK for Sitecore XM Cloud integration
10
- - **TypeScript** - Type-safe JavaScript development
11
- - **Sitecore XM Cloud** - Headless CMS platform
12
- - **React** - Component-based UI library
13
-
14
- ## Coding Standards
15
-
16
- ### TypeScript Standards
17
- - Use **strict mode** in tsconfig.json
18
- - Prefer type assertions over `any`: `value as ContentItem`
19
- - Use discriminated unions for complex state management
20
- - Enable strict null checks and strict function types
21
-
22
- ### Naming Conventions
23
- - **Variables/Functions**: camelCase (`getUserData()`, `isLoading`, `currentUser`)
24
- - **Components**: PascalCase (`SitecoreComponent`, `PageLayout`, `ContentBlock`)
25
- - **Constants**: UPPER_SNAKE_CASE (`API_ENDPOINT`, `DEFAULT_TIMEOUT`)
26
- - **Directories**: kebab-case (`src/components`, `src/api-clients`)
27
- - **Types/Interfaces**: PascalCase (`ContentItem`, `LayoutProps`, `SitecoreConfig`)
28
-
29
- ### Modular Layout
30
- ```
31
- src/
32
- components/ # UI components (React)
33
- lib/ # Configuration and utilities
34
- pages/ # Next.js pages
35
- assets/ # Static assets and styles
36
- types/ # TypeScript type definitions
37
- hooks/ # Custom React hooks
38
- ```
39
-
40
- ## Library Usage
41
-
42
- ### @sitecore-content-sdk
43
- - Use `SitecoreClient` for content fetching
44
- - Implement proper error handling with try/catch blocks
45
- - Cache API responses using React Query or SWR
46
- - Handle content preview vs. published content scenarios
47
-
48
- ```typescript
49
- import { SitecoreClient } from '@sitecore-content-sdk/nextjs/client';
50
- import scConfig from 'sitecore.config';
51
-
52
- const client = new SitecoreClient({
53
- ...scConfig,
54
- });
55
- ```
56
-
57
- ### React Patterns
58
- - Use **Server Components** for data fetching and static content
59
- - Use **Client Components** for interactivity (use 'use client')
60
- - Implement proper error boundaries
61
- - Use React.memo for expensive components
62
- - Leverage useCallback and useMemo for performance optimization
63
-
64
- ### Sitecore Field Components
65
- - Always use Sitecore field components: `<Text>`, `<RichText>`, `<Image>`
66
- - Validate field existence before rendering
67
- - Handle empty/null fields gracefully
68
- - Prefer Sitecore field components over manual rendering
69
-
70
- ```typescript
71
- // Good: Using Sitecore field components
72
- <Text field={fields?.title} tag="h1" />
73
- <RichText field={fields?.content} />
74
- <Image field={fields?.backgroundImage} />
75
-
76
- // Avoid: Manual field value extraction unless necessary
77
- ```
78
-
79
- ## Example Patterns and Prompts
80
-
81
- ### Component Development
82
- ```typescript
83
- // Component props interface
84
- interface HeroProps {
85
- fields: {
86
- title: Field;
87
- subtitle: Field;
88
- backgroundImage: Field;
89
- };
90
- }
91
-
92
- export default function Hero({ fields }: HeroProps) {
93
- return (
94
- <div>
95
- <Text field={fields?.title} tag="h1" />
96
- <Text field={fields?.subtitle} tag="p" />
97
- <Image field={fields?.backgroundImage} />
98
- </div>
99
- );
100
- }
101
- ```
102
-
103
- ### Error Handling
104
- ```typescript
105
- async function fetchPageData(path: string): Promise<Page | null> {
106
- if (!path) {
107
- throw new Error('Page path is required');
108
- }
109
-
110
- try {
111
- const pageData = await client.getPage(path);
112
- return pageData;
113
- } catch (error) {
114
- throw new SitecoreFetchError(`Failed to fetch page data for ${path}`, error);
115
- }
116
- }
117
- ```
118
-
119
- ### Configuration
120
- ```typescript
121
- // sitecore.config.ts
122
- import { defineConfig } from '@sitecore-content-sdk/nextjs/config';
123
-
124
- export default defineConfig({
125
- api: {
126
- edge: {
127
- contextId: process.env.SITECORE_EDGE_CONTEXT_ID || '',
128
- clientContextId: process.env.NEXT_PUBLIC_SITECORE_EDGE_CONTEXT_ID,
129
- edgeUrl: process.env.SITECORE_EDGE_URL || 'https://edge-platform.sitecorecloud.io',
130
- },
131
- local: {
132
- apiKey: process.env.SITECORE_API_KEY || '',
133
- apiHost: process.env.SITECORE_API_HOST || '',
134
- },
135
- },
136
- defaultSite: process.env.NEXT_PUBLIC_DEFAULT_SITE_NAME || 'default',
137
- defaultLanguage: process.env.NEXT_PUBLIC_DEFAULT_LANGUAGE || 'en',
138
- editingSecret: process.env.SITECORE_EDITING_SECRET,
139
- });
140
- ```
141
-
142
- ## Development Workflow
143
-
144
- 1. **Install dependencies**: `npm install`
145
- 2. **Configure environment**: Copy `.env.example` to `.env.local`
146
- 3. **Start development**: `npm run dev`
147
- 4. **Build for production**: `npm run build`
148
-
149
- ## Best Practices
150
-
151
- ### Performance
152
- - Optimize images using Next.js Image component
153
- - Implement proper loading states
154
- - Cache expensive operations appropriately
155
- - Consider server-side rendering implications
156
- - Lazy-load non-critical modules
157
-
158
- ### Security
159
- - Sanitize user inputs before processing
160
- - Validate data at application boundaries
161
- - Use HTTPS for all Sitecore connections
162
- - Never expose sensitive configuration in client-side code
163
- - Escape content when rendering to prevent XSS
164
-
165
- ### Code Quality
166
- - Follow DRY principle - extract common functionality
167
- - Use SOLID principles for maintainable code
168
- - Write self-documenting code with clear intent
169
- - Implement proper error boundaries
170
- - Test behavior, not implementation details
1
+ # GitHub Copilot Instructions for Sitecore Content SDK Next.js Project
2
+
3
+ ## Project Purpose and Tech Stack
4
+
5
+ This is a **Sitecore Content SDK** application built with **Next.js** and **TypeScript**. The project follows Sitecore best practices for XM Cloud development and provides a modern, performant web application framework.
6
+
7
+ ### Key Technologies
8
+ - **Next.js** - React framework with SSR/SSG capabilities
9
+ - **Sitecore Content SDK** - Official SDK for Sitecore XM Cloud integration
10
+ - **TypeScript** - Type-safe JavaScript development
11
+ - **Sitecore XM Cloud** - Headless CMS platform
12
+ - **React** - Component-based UI library
13
+
14
+ ## Coding Standards
15
+
16
+ ### TypeScript Standards
17
+ - Use **strict mode** in tsconfig.json
18
+ - Prefer type assertions over `any`: `value as ContentItem`
19
+ - Use discriminated unions for complex state management
20
+ - Enable strict null checks and strict function types
21
+
22
+ ### Naming Conventions
23
+ - **Variables/Functions**: camelCase (`getUserData()`, `isLoading`, `currentUser`)
24
+ - **Components**: PascalCase (`SitecoreComponent`, `PageLayout`, `ContentBlock`)
25
+ - **Constants**: UPPER_SNAKE_CASE (`API_ENDPOINT`, `DEFAULT_TIMEOUT`)
26
+ - **Directories**: kebab-case (`src/components`, `src/api-clients`)
27
+ - **Types/Interfaces**: PascalCase (`ContentItem`, `LayoutProps`, `SitecoreConfig`)
28
+
29
+ ### Modular Layout
30
+ ```
31
+ src/
32
+ components/ # UI components (React)
33
+ lib/ # Configuration and utilities
34
+ pages/ # Next.js pages
35
+ assets/ # Static assets and styles
36
+ types/ # TypeScript type definitions
37
+ hooks/ # Custom React hooks
38
+ ```
39
+
40
+ ## Library Usage
41
+
42
+ ### @sitecore-content-sdk
43
+ - Use `SitecoreClient` for content fetching
44
+ - Implement proper error handling with try/catch blocks
45
+ - Cache API responses using React Query or SWR
46
+ - Handle content preview vs. published content scenarios
47
+
48
+ ```typescript
49
+ import { SitecoreClient } from '@sitecore-content-sdk/nextjs/client';
50
+ import scConfig from 'sitecore.config';
51
+
52
+ const client = new SitecoreClient({
53
+ ...scConfig,
54
+ });
55
+ ```
56
+
57
+ ### React Patterns
58
+ - Use **Server Components** for data fetching and static content
59
+ - Use **Client Components** for interactivity (use 'use client')
60
+ - Implement proper error boundaries
61
+ - Use React.memo for expensive components
62
+ - Leverage useCallback and useMemo for performance optimization
63
+
64
+ ### Sitecore Field Components
65
+ - Always use Sitecore field components: `<Text>`, `<RichText>`, `<Image>`
66
+ - Validate field existence before rendering
67
+ - Handle empty/null fields gracefully
68
+ - Prefer Sitecore field components over manual rendering
69
+
70
+ ```typescript
71
+ // Good: Using Sitecore field components
72
+ <Text field={fields?.title} tag="h1" />
73
+ <RichText field={fields?.content} />
74
+ <Image field={fields?.backgroundImage} />
75
+
76
+ // Avoid: Manual field value extraction unless necessary
77
+ ```
78
+
79
+ ## Example Patterns and Prompts
80
+
81
+ ### Component Development
82
+ ```typescript
83
+ // Component props interface
84
+ interface HeroProps {
85
+ fields: {
86
+ title: Field;
87
+ subtitle: Field;
88
+ backgroundImage: Field;
89
+ };
90
+ }
91
+
92
+ export default function Hero({ fields }: HeroProps) {
93
+ return (
94
+ <div>
95
+ <Text field={fields?.title} tag="h1" />
96
+ <Text field={fields?.subtitle} tag="p" />
97
+ <Image field={fields?.backgroundImage} />
98
+ </div>
99
+ );
100
+ }
101
+ ```
102
+
103
+ ### Error Handling
104
+ ```typescript
105
+ async function fetchPageData(path: string): Promise<Page | null> {
106
+ if (!path) {
107
+ throw new Error('Page path is required');
108
+ }
109
+
110
+ try {
111
+ const pageData = await client.getPage(path);
112
+ return pageData;
113
+ } catch (error) {
114
+ throw new SitecoreFetchError(`Failed to fetch page data for ${path}`, error);
115
+ }
116
+ }
117
+ ```
118
+
119
+ ### Configuration
120
+ ```typescript
121
+ // sitecore.config.ts
122
+ import { defineConfig } from '@sitecore-content-sdk/nextjs/config';
123
+
124
+ export default defineConfig({
125
+ api: {
126
+ edge: {
127
+ contextId: process.env.SITECORE_EDGE_CONTEXT_ID || '',
128
+ clientContextId: process.env.NEXT_PUBLIC_SITECORE_EDGE_CONTEXT_ID,
129
+ edgeUrl: process.env.SITECORE_EDGE_URL || 'https://edge-platform.sitecorecloud.io',
130
+ },
131
+ local: {
132
+ apiKey: process.env.SITECORE_API_KEY || '',
133
+ apiHost: process.env.SITECORE_API_HOST || '',
134
+ },
135
+ },
136
+ defaultSite: process.env.NEXT_PUBLIC_DEFAULT_SITE_NAME || 'default',
137
+ defaultLanguage: process.env.NEXT_PUBLIC_DEFAULT_LANGUAGE || 'en',
138
+ editingSecret: process.env.SITECORE_EDITING_SECRET,
139
+ });
140
+ ```
141
+
142
+ ## Development Workflow
143
+
144
+ 1. **Install dependencies**: `npm install`
145
+ 2. **Configure environment**: Copy `.env.example` to `.env.local`
146
+ 3. **Start development**: `npm run dev`
147
+ 4. **Build for production**: `npm run build`
148
+
149
+ ## Best Practices
150
+
151
+ ### Performance
152
+ - Optimize images using Next.js Image component
153
+ - Implement proper loading states
154
+ - Cache expensive operations appropriately
155
+ - Consider server-side rendering implications
156
+ - Lazy-load non-critical modules
157
+
158
+ ### Security
159
+ - Sanitize user inputs before processing
160
+ - Validate data at application boundaries
161
+ - Use HTTPS for all Sitecore connections
162
+ - Never expose sensitive configuration in client-side code
163
+ - Escape content when rendering to prevent XSS
164
+
165
+ ### Code Quality
166
+ - Follow DRY principle - extract common functionality
167
+ - Use SOLID principles for maintainable code
168
+ - Write self-documenting code with clear intent
169
+ - Implement proper error boundaries
170
+ - Test behavior, not implementation details
@@ -1,81 +1,81 @@
1
- // packages/create-content-sdk-app/src/templates/nextjs/eslint.config.mjs
2
- import { defineConfig } from 'eslint/config'
3
- import js from '@eslint/js'
4
- import * as nextEslintPlugin from '@next/eslint-plugin-next'
5
- import tsParser from '@typescript-eslint/parser'
6
- import * as tsEslintPlugin from '@typescript-eslint/eslint-plugin'
7
- import * as importEslintPlugin from 'eslint-plugin-import'
8
- import * as reactHooksEslintPlugin from 'eslint-plugin-react-hooks'
9
- import globals from 'globals'
10
-
11
- // Normalize ESM/CJS shapes to plugin objects
12
- const nextPlugin = nextEslintPlugin.default ?? nextEslintPlugin
13
- const tsPlugin = tsEslintPlugin.default ?? tsEslintPlugin
14
- const importPlugin = importEslintPlugin.default ?? importEslintPlugin
15
- const reactHooksPlugin = reactHooksEslintPlugin.default ?? reactHooksEslintPlugin
16
-
17
- export default defineConfig([
18
- // ignores
19
- { ignores: ['node_modules/**', '.next/**', 'dist/**', 'build/**', 'coverage/**'] },
20
-
21
- // core ESLint recommended
22
- js.configs.recommended,
23
-
24
- // register plugins (applies to all files)
25
- {
26
- plugins: {
27
- '@next/next': nextPlugin,
28
- '@typescript-eslint': tsPlugin,
29
- import: importPlugin,
30
- 'react-hooks': reactHooksPlugin,
31
- },
32
- },
33
-
34
- // project rules
35
- {
36
- files: ['**/*.{js,jsx,ts,tsx}'],
37
- languageOptions: {
38
- parser: tsParser,
39
- parserOptions: {
40
- ecmaVersion: 2021,
41
- sourceType: 'module',
42
- ecmaFeatures: { jsx: true },
43
- },
44
- globals: {
45
- ...(globals.node ?? {}),
46
- ...(globals.browser ?? {}),
47
- ...(globals.es2021 ?? {}), // guarded to avoid "Cannot convert undefined or null to object"
48
- URL: 'readonly',
49
- },
50
- },
51
- settings: {
52
- 'import/resolver': { typescript: {} },
53
- },
54
- rules: {
55
- // Next.js
56
- ...(nextPlugin.configs?.recommended?.rules ?? {}),
57
- ...(nextPlugin.configs?.['core-web-vitals']?.rules ?? {}),
58
- '@next/next/no-html-link-for-pages': 'off',
59
- '@next/next/no-img-element': 'off',
60
- '@next/next/no-sync-scripts': 'off',
61
- '@next/next/no-assign-module-variable': 'off',
62
-
63
- // TypeScript
64
- '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
65
- 'no-unused-vars': 'off',
66
- 'no-undef': 'off',
67
-
68
- // Plugins
69
- 'import/no-anonymous-default-export': 'error',
70
- 'react-hooks/exhaustive-deps': 'warn',
71
- 'react-hooks/rules-of-hooks': 'error',
72
-
73
- // Preferences
74
- 'prefer-const': 'error',
75
- 'no-var': 'error',
76
-
77
- // Temporary: ignore escapes in strings/regex to align with new-starter components
78
- 'no-useless-escape': 'off',
79
- },
80
- },
81
- ])
1
+ // packages/create-content-sdk-app/src/templates/nextjs/eslint.config.mjs
2
+ import { defineConfig } from 'eslint/config'
3
+ import js from '@eslint/js'
4
+ import * as nextEslintPlugin from '@next/eslint-plugin-next'
5
+ import tsParser from '@typescript-eslint/parser'
6
+ import * as tsEslintPlugin from '@typescript-eslint/eslint-plugin'
7
+ import * as importEslintPlugin from 'eslint-plugin-import'
8
+ import * as reactHooksEslintPlugin from 'eslint-plugin-react-hooks'
9
+ import globals from 'globals'
10
+
11
+ // Normalize ESM/CJS shapes to plugin objects
12
+ const nextPlugin = nextEslintPlugin.default ?? nextEslintPlugin
13
+ const tsPlugin = tsEslintPlugin.default ?? tsEslintPlugin
14
+ const importPlugin = importEslintPlugin.default ?? importEslintPlugin
15
+ const reactHooksPlugin = reactHooksEslintPlugin.default ?? reactHooksEslintPlugin
16
+
17
+ export default defineConfig([
18
+ // ignores
19
+ { ignores: ['node_modules/**', '.next/**', 'dist/**', 'build/**', 'coverage/**'] },
20
+
21
+ // core ESLint recommended
22
+ js.configs.recommended,
23
+
24
+ // register plugins (applies to all files)
25
+ {
26
+ plugins: {
27
+ '@next/next': nextPlugin,
28
+ '@typescript-eslint': tsPlugin,
29
+ import: importPlugin,
30
+ 'react-hooks': reactHooksPlugin,
31
+ },
32
+ },
33
+
34
+ // project rules
35
+ {
36
+ files: ['**/*.{js,jsx,ts,tsx}'],
37
+ languageOptions: {
38
+ parser: tsParser,
39
+ parserOptions: {
40
+ ecmaVersion: 2021,
41
+ sourceType: 'module',
42
+ ecmaFeatures: { jsx: true },
43
+ },
44
+ globals: {
45
+ ...(globals.node ?? {}),
46
+ ...(globals.browser ?? {}),
47
+ ...(globals.es2021 ?? {}), // guarded to avoid "Cannot convert undefined or null to object"
48
+ URL: 'readonly',
49
+ },
50
+ },
51
+ settings: {
52
+ 'import/resolver': { typescript: {} },
53
+ },
54
+ rules: {
55
+ // Next.js
56
+ ...(nextPlugin.configs?.recommended?.rules ?? {}),
57
+ ...(nextPlugin.configs?.['core-web-vitals']?.rules ?? {}),
58
+ '@next/next/no-html-link-for-pages': 'off',
59
+ '@next/next/no-img-element': 'off',
60
+ '@next/next/no-sync-scripts': 'off',
61
+ '@next/next/no-assign-module-variable': 'off',
62
+
63
+ // TypeScript
64
+ '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
65
+ 'no-unused-vars': 'off',
66
+ 'no-undef': 'off',
67
+
68
+ // Plugins
69
+ 'import/no-anonymous-default-export': 'error',
70
+ 'react-hooks/exhaustive-deps': 'warn',
71
+ 'react-hooks/rules-of-hooks': 'error',
72
+
73
+ // Preferences
74
+ 'prefer-const': 'error',
75
+ 'no-var': 'error',
76
+
77
+ // Temporary: ignore escapes in strings/regex to align with new-starter components
78
+ 'no-useless-escape': 'off',
79
+ },
80
+ },
81
+ ])
@@ -1,28 +1,28 @@
1
- # See https://help.github.com/ignore-files/ for more about ignoring files.
2
-
3
- # dependencies
4
- /node_modules
5
-
6
- # next.js
7
- /.next*/
8
- /out/
9
-
10
- # misc
11
- .DS_Store
12
-
13
- # local env files
14
- .env.local
15
- .env.*.local
16
- .env
17
-
18
- # Log files
19
- *.log*
20
-
21
- # vercel
22
- .vercel
23
-
24
- # sitecore temp files
25
- .sitecore/*
26
- # except for component-map
27
- !.sitecore/component-map.ts
28
- !.sitecore/import-map.ts
1
+ # See https://help.github.com/ignore-files/ for more about ignoring files.
2
+
3
+ # dependencies
4
+ /node_modules
5
+
6
+ # next.js
7
+ /.next*/
8
+ /out/
9
+
10
+ # misc
11
+ .DS_Store
12
+
13
+ # local env files
14
+ .env.local
15
+ .env.*.local
16
+ .env
17
+
18
+ # Log files
19
+ *.log*
20
+
21
+ # vercel
22
+ .vercel
23
+
24
+ # sitecore temp files
25
+ .sitecore/*
26
+ # except for component-map
27
+ !.sitecore/component-map.ts
28
+ !.sitecore/import-map.ts