-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* lots of eslint updates * adds eslint: dirs flag to next.config.js * update lint command in docs * update per review comments * re-add --no-lint command for build * Apply suggestions from code review Co-authored-by: JJ Kasper <[email protected]>
- Loading branch information
1 parent
7b77415
commit 50a36ee
Showing
19 changed files
with
247 additions
and
90 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
description: Next.js reports ESLint errors and warnings during builds by default. Learn how to opt-out of this behavior here. | ||
--- | ||
|
||
# Ignoring ESLint | ||
|
||
When ESLint is detected in your project, Next.js fails your **production build** (`next build`) when errors are present. | ||
|
||
If you'd like Next.js to dangerously produce production code even when your application has ESLint errors, you can disable the built-in linting step completely. | ||
|
||
> Be sure you have configured ESLint to run in a separate part of your workflow (for example, in CI or a pre-commit hook). | ||
Open `next.config.js` and enable the `ignoreDuringBuilds` option in the `eslint` config: | ||
|
||
```js | ||
module.exports = { | ||
eslint: { | ||
// Warning: Dangerously allow production builds to successfully complete even if | ||
// your project has ESLint errors. | ||
ignoreDuringBuilds: true, | ||
}, | ||
} | ||
``` | ||
|
||
## Related | ||
|
||
<div class="card"> | ||
<a href="/docs/api-reference/next.config.js/introduction.md"> | ||
<b>Introduction to next.config.js:</b> | ||
<small>Learn more about the configuration file used by Next.js.</small> | ||
</a> | ||
</div> | ||
|
||
<div class="card"> | ||
<a href="/docs/basic-features/eslint.md"> | ||
<b>ESLint:</b> | ||
<small>Get started with ESLint in Next.js.</small> | ||
</a> | ||
</div> |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "next", | ||
"root": true, | ||
"rules": { | ||
"@next/next/no-html-link-for-pages": 0 | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const Custom = () => ( | ||
<div> | ||
<script src="https://example.com" /> | ||
</div> | ||
) | ||
|
||
export default Custom |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
eslint: { | ||
dirs: ['utils', 'custom'], | ||
}, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const Home = () => ( | ||
<div> | ||
<p>Home</p> | ||
<a href="test">Test link</a> | ||
</div> | ||
) | ||
|
||
export default Home |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const Utils = () => <div>/* Badly formatted comment */</div> | ||
|
||
export default Utils |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "next", | ||
"root": true, | ||
"rules": { | ||
"@next/next/no-html-link-for-pages": 0 | ||
} | ||
} |
Oops, something went wrong.