Unverified Commit 08e69cfd authored by Balázs Orbán's avatar Balázs Orbán Committed by GitHub

chore: extend example contribution guidelines (#38511)

Trying to create more consistency in our examples.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
parent e7b6b193
...@@ -265,13 +265,17 @@ Below are the steps to add a new link: ...@@ -265,13 +265,17 @@ Below are the steps to add a new link:
When you add an example to the [examples](examples) directory, please follow these guidelines to ensure high quality examples: When you add an example to the [examples](examples) directory, please follow these guidelines to ensure high quality examples:
- TypeScript should be leveraged for new examples (no need for separate JavaScript and TypeScript examples) - TypeScript should be leveraged for new examples (no need for separate JavaScript and TypeScript examples, converting old JavaScript examples is preferred)
- Examples should not add custom ESLint configuration (we have specific templates for ESLint) - Examples should not add custom ESLint configuration (we have specific templates for ESLint)
- If API routes aren't used in an example, they should be omitted - If API routes aren't used in an example, they should be omitted
- If an example exists for a certain library and you would like to showcase a specific feature of that library, the existing example should be updated (instead of adding a new example) - If an example exists for a certain library and you would like to showcase a specific feature of that library, the existing example should be updated (instead of adding a new example)
- Package manager specific config should not be added (e.g. `resolutions` in `package.json`) - Package manager specific config should not be added (e.g. `resolutions` in `package.json`)
- In `package.json` the version of `next` (and `eslint-config-next`) should be `latest` - In `package.json` the version of `next` (and `eslint-config-next`) should be `latest`
- In `package.json` the dependency versions should be up-to-date - In `package.json` the dependency versions should be up-to-date
- Use `export default function` for page components and API Routes instead of `const`/`let` (The exception is if the page has `getInitialProps`, in which case [`NextPage`](https://nextjs.org/docs/api-reference/data-fetching/get-initial-props#typescript) could be useful)
- CMS example directories should be prefixed with `cms-`
- Example directories should not be prefixed with `with-`
- Make sure linting passes (you can run `pnpm lint-fix`)
Also don’t forget to add a `README.md` file with the following format: Also don’t forget to add a `README.md` file with the following format:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment