forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: eslint not ignoring "/app" (vercel#50261)
## Why? ``` src/app/layout.tsx ``` ![code](https://github.com/vercel/next.js/assets/120007119/3cc991f8-a96d-4ffb-9f84-4dfdbcac5318) **eslint[@next/next/no-before-interactive-script-outside-document](https://nextjs.org/docs/messages/no-before-interactive-script-outside-document)** > `next/script`'s `beforeInteractive` strategy should not be used outside of `pages/_document.js`. ## How? - Possibility of pathname starts with "/" on OS X and Linux, so added condition to check file path starting with "/" - e.g. "/src/app" or "/app" - Added test code Passed - `pnpm build && pnpm lint` - `pnpm jest test/unit/eslint-plugin-next/no-before-interactive-script-outside-document.test.ts` Extends vercel#46609 Fixes vercel#50096 Fixes NEXT-1230
- Loading branch information
1 parent
8617d57
commit 836ca8f
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters