Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vercel/next.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v10.1.1
Choose a base ref
...
head repository: vercel/next.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v10.1.2
Choose a head ref
  • 3 commits
  • 50 files changed
  • 2 contributors

Commits on Mar 30, 2021

  1. Temporarily remove experimental ESLint integration (#23521)

    This pull request **temporarily** removes ESLint, as it was not landed in accordance with our standard experimental policies. We are fully committed to landing this change again.
    
    This is being reverted because:
    
    - Next.js has very strict goals for its install size. This feature resulted in adding over 17MB, or a 43.6% increase.
    - The feature was not first landed under the `experimental` key in `next.config.js`, rather, it was added under the stable namespace (top-level)
    - Using the feature doesn't do a "guided setup" like TypeScript, it should ask you to "bring your own" dependencies for ESLint
    - It uses a undesirable ESLint plugin name: `plugin:@next/next/recommended`. This should read out as strictly `next`, or as short as we can get it.
    - Does not provide actionable warnings (missing link to resolve issue)
    - Does not follow appropriate console output styling. We need to revisit how these are presented.
    
    To re-land this, we need to ensure the following minimums are met:
    - Very minor change in install size
    - Fully experimental (i.e. flagged) with warnings
    - Finalized package name and configuration shape, preferably so we can do ` { extends: 'next' } `.
    Timer authored Mar 30, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    eecc334 View commit details
  2. v10.1.2-canary.0

    timneutkens committed Mar 30, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1344e2d View commit details
  3. v10.1.2

    timneutkens committed Mar 30, 2021
    2

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1ff6057 View commit details
Showing with 45 additions and 923 deletions.
  1. +0 −2 .eslintignore
  2. +0 −70 docs/api-reference/next.config.js/eslint-warnings-errors.md
  3. +0 −49 docs/basic-features/eslint.md
  4. +0 −8 docs/manifest.json
  5. +1 −1 lerna.json
  6. +1 −1 packages/create-next-app/package.json
  7. +8 −14 packages/eslint-plugin-next/lib/rules/no-html-link-for-pages.js
  8. +0 −14 packages/eslint-plugin-next/lib/utils/url.js
  9. +1 −1 packages/eslint-plugin-next/package.json
  10. +1 −1 packages/next-bundle-analyzer/package.json
  11. +1 −1 packages/next-codemod/package.json
  12. +1 −1 packages/next-env/package.json
  13. +1 −1 packages/next-mdx/package.json
  14. +1 −1 packages/next-plugin-google-analytics/package.json
  15. +1 −1 packages/next-plugin-sentry/package.json
  16. +1 −1 packages/next-plugin-storybook/package.json
  17. +1 −1 packages/next-polyfill-module/package.json
  18. +1 −1 packages/next-polyfill-nomodule/package.json
  19. +0 −35 packages/next/build/index.ts
  20. +0 −68 packages/next/lib/eslint/customFormatter.ts
  21. +0 −141 packages/next/lib/verifyAndLint.ts
  22. +0 −4 packages/next/next-server/server/config-shared.ts
  23. +7 −11 packages/next/package.json
  24. +0 −1 packages/next/server/hot-reloader.ts
  25. +0 −12 packages/next/server/on-demand-entry-handler.ts
  26. +1 −1 packages/react-dev-overlay/package.json
  27. +1 −1 packages/react-refresh-utils/package.json
  28. +0 −3 test-pnp.sh
  29. +3 −8 test/integration/dist-dir/test/index.test.js
  30. +0 −16 test/integration/eslint/custom-eslint-config/.eslintrc.json
  31. +0 −1 test/integration/eslint/custom-eslint-config/next.config.js
  32. +0 −13 test/integration/eslint/custom-eslint-config/pages/index.js
  33. +0 −14 test/integration/eslint/custom-next-config/.eslintrc.json
  34. +0 −6 test/integration/eslint/custom-next-config/next.config.js
  35. +0 −13 test/integration/eslint/custom-next-config/pages/index.js
  36. +0 −3 test/integration/eslint/pkg-json-eslint-config/next.config.js
  37. +0 −36 test/integration/eslint/pkg-json-eslint-config/package.json
  38. +0 −13 test/integration/eslint/pkg-json-eslint-config/pages/index.js
  39. +0 −37 test/integration/eslint/test/custom-eslint-config.test.js
  40. +0 −55 test/integration/eslint/test/custom-next-config.test.js
  41. +0 −44 test/integration/eslint/test/pkg-json-eslint-config.test.js
  42. +1 −1 test/integration/index-index/pages/index/index.js
  43. +1 −1 test/integration/index-index/pages/index/index/index.js
  44. +1 −1 test/integration/index-index/pages/index/project/index.js
  45. +1 −1 test/integration/index-index/pages/index/user.js
  46. +0 −5 test/integration/production-build-dir/next.config.js
  47. +1 −2 test/integration/production/pages/error-in-ssr-render.js
  48. +2 −2 test/integration/tsconfig-verifier/pages/index.tsx
  49. +0 −3 test/integration/webpack-require-hook/next.config.js
  50. +6 −202 yarn.lock
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ node_modules
**/.next/**
**/_next/**
**/dist/**
e2e-tests/**
examples/with-typescript-eslint-jest/**
examples/with-kea/**
packages/next/bundles/webpack/packages/*.runtime.js
@@ -17,5 +16,4 @@ packages/next-codemod/**/*.js
packages/next-codemod/**/*.d.ts
packages/next-env/**/*.d.ts
test/integration/async-modules/**
test/integration/eslint/**
test-timings.json
70 changes: 0 additions & 70 deletions docs/api-reference/next.config.js/eslint-warnings-errors.md

This file was deleted.

49 changes: 0 additions & 49 deletions docs/basic-features/eslint.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/manifest.json
Original file line number Diff line number Diff line change
@@ -33,10 +33,6 @@
"title": "Fast Refresh",
"path": "/docs/basic-features/fast-refresh.md"
},
{
"title": "ESLint",
"path": "/docs/basic-features/eslint.md"
},
{
"title": "TypeScript",
"path": "/docs/basic-features/typescript.md"
@@ -340,10 +336,6 @@
"title": "Configuring onDemandEntries",
"path": "/docs/api-reference/next.config.js/configuring-onDemandEntries.md"
},
{
"title": "ESLint Warnings and Errors",
"path": "/docs/api-reference/next.config.js/eslint-warnings-errors.md"
},
{
"title": "Ignoring TypeScript Errors",
"path": "/docs/api-reference/next.config.js/ignoring-typescript-errors.md"
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -17,5 +17,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "10.1.1"
"version": "10.1.2"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "10.1.1",
"version": "10.1.2",
"keywords": [
"react",
"next",
22 changes: 8 additions & 14 deletions packages/eslint-plugin-next/lib/rules/no-html-link-for-pages.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
const path = require('path')
const fs = require('fs')
const {
getUrlFromPagesDirectory,
normalizeURL,
execOnce,
} = require('../utils/url')

const pagesDirWarning = execOnce((pagesDirs) => {
console.warn(
`Pages directory cannot be found at ${pagesDirs.join(' or ')}. ` +
`If using a custom path, please configure with the no-html-link-for-pages rule in your eslint config file`
)
})
const { getUrlFromPagesDirectory, normalizeURL } = require('../utils/url')

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = {
meta: {
docs: {
@@ -34,8 +26,10 @@ module.exports = {
]
const pagesDir = pagesDirs.find((dir) => fs.existsSync(dir))
if (!pagesDir) {
pagesDirWarning(pagesDirs)
return {}
throw new Error(
`Pages directory cannot be found at ${pagesDirs.join(' or ')}. ` +
`If using a custom path, please configure with the no-html-link-for-pages rule`
)
}

const urls = getUrlFromPagesDirectory('/', pagesDir)
14 changes: 0 additions & 14 deletions packages/eslint-plugin-next/lib/utils/url.js
Original file line number Diff line number Diff line change
@@ -76,21 +76,7 @@ function normalizeURL(url) {
return url
}

function execOnce(fn) {
let used = false
let result

return (...args) => {
if (!used) {
used = true
result = fn(...args)
}
return result
}
}

module.exports = {
getUrlFromPagesDirectory,
normalizeURL,
execOnce,
}
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "10.1.1",
"version": "10.1.2",
"description": "ESLint plugin for NextJS.",
"main": "lib/index.js",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "10.1.1",
"version": "10.1.2",
"main": "index.js",
"license": "MIT",
"repository": {
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "10.1.1",
"version": "10.1.2",
"license": "MIT",
"dependencies": {
"chalk": "4.1.0",
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "10.1.1",
"version": "10.1.2",
"keywords": [
"react",
"next",
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "10.1.1",
"version": "10.1.2",
"main": "index.js",
"license": "MIT",
"repository": {
2 changes: 1 addition & 1 deletion packages/next-plugin-google-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-google-analytics",
"version": "10.1.1",
"version": "10.1.2",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-google-analytics"
2 changes: 1 addition & 1 deletion packages/next-plugin-sentry/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-sentry",
"version": "10.1.1",
"version": "10.1.2",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-sentry"
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "10.1.1",
"version": "10.1.2",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "10.1.1",
"version": "10.1.2",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "10.1.1",
"version": "10.1.2",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
35 changes: 0 additions & 35 deletions packages/next/build/index.ts
Original file line number Diff line number Diff line change
@@ -180,41 +180,6 @@ export default async function build(
telemetry.record(events)
)

if (config.eslint?.build) {
await nextBuildSpan
.traceChild('verify-and-lint')
.traceAsyncFn(async () => {
const lintWorkers = new Worker(
require.resolve('../lib/verifyAndLint'),
{
numWorkers: config.experimental.cpus,
enableWorkerThreads: config.experimental.workerThreads,
}
) as Worker & {
verifyAndLint: typeof import('../lib/verifyAndLint').verifyAndLint
}

lintWorkers.getStdout().pipe(process.stdout)
lintWorkers.getStderr().pipe(process.stderr)

const lintResults = await lintWorkers.verifyAndLint(
dir,
pagesDir,
null
)

if (lintResults.hasErrors) {
console.error(chalk.red('Failed to compile.'))
console.error(lintResults.results)
process.exit(1)
} else if (lintResults.hasMessages) {
console.log(lintResults.results)
}

lintWorkers.end()
})
}

const ignoreTypeScriptErrors = Boolean(config.typescript?.ignoreBuildErrors)
await nextBuildSpan
.traceChild('verify-typescript-setup')
Loading