style-guide
style-guide copied to clipboard
Vercel's engineering style guide
(node:33293) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created)
Ref: https://vercel.com/docs/observability/webhooks-overview/webhooks-api#securing-webhooks Rule: https://github.com/vercel/style-guide/blob/canary/eslint/rules/unicorn.js#L20 Snippet: ```ts import type { NextApiRequest, NextApiResponse } from 'next'; import crypto from 'crypto'; import getRawBody from 'raw-body'; ``` The linter wants `crypto` to be `node:crypto`;...
The new strict rules are very restrictive, requiring numbers to be stringified. This might make sense in UIs, but for things logs this is probably too much. For example, the...
There are a few file conventions in Next.js that must contain default export. Currently, using this style guide out of the box will cause an error in those files, because...
We plan to implement support for ESLint's new flat config format around the time that ESLint v9.0.0 launches. At that time, this will be the default config format for ESLint....
I followed the [with-tailwind](https://github.com/vercel/turbo/tree/main/examples/with-tailwind) example, which uses the new eslint rules from vercel/styleguide. I was having issues getting eslint to recognize imports from the `packages` directory, even though typescript could...
`Error: Failed to load plugin 'unicorn' declared in '.eslintrc.js » /Users/{{USERNAME}}/Workspace/{{APPNAME}}/node_modules/@vercel/style-guide/eslint/browser.js » /Users/{{USERNAME}}//Workspace/{{APPNAME}}/node_modules/@vercel/style-guide/eslint/_base.js » /Users/{{USERNAME}}//Workspace/{{APPNAME}}/node_modules/@vercel/style-guide/eslint/rules/unicorn.js':`
As of the latest release, we've unpinned version dependencies. This gives users more flexibility, and makes it easier to bump dependencies of this package (like `@typescript-eslint`) to support new TypeScript...
Originally suggested by @timneutkens because the Next.js team will be adding it. Periods in regex tend to lead to a lot of unintentional matching, and this will help prevent performance...