Skip to content

Commit cf4ba8d

Browse files
authored
Upgrade eslint to the latest version (vercel#24377)
## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added ## 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. ## Documentation / Examples - [ ] Make sure the linting passes
1 parent 08ee60d commit cf4ba8d

File tree

19 files changed

+65298
-64958
lines changed

19 files changed

+65298
-64958
lines changed

.eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
"extends": ["plugin:jest/recommended"],
2828
"rules": {
2929
"jest/expect-expect": "off",
30-
"jest/no-disabled-tests": "off"
30+
"jest/no-disabled-tests": "off",
31+
"jest/no-conditional-expect": "off",
32+
"jest/valid-title": "off",
33+
"jest/no-interpolation-in-snapshots": "off"
3134
}
3235
},
3336
{ "files": ["**/__tests__/**"], "env": { "jest": true } },

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"@types/http-proxy": "1.17.3",
5050
"@types/jest": "24.0.13",
5151
"@types/string-hash": "1.1.1",
52-
"@typescript-eslint/eslint-plugin": "2.17.0",
53-
"@typescript-eslint/parser": "2.17.0",
52+
"@typescript-eslint/eslint-plugin": "4.22.0",
53+
"@typescript-eslint/parser": "4.22.0",
5454
"@zeit/next-css": "1.0.2-canary.2",
5555
"@zeit/next-sass": "1.0.2-canary.2",
5656
"@zeit/next-typescript": "1.1.2-canary.0",
@@ -71,11 +71,11 @@
7171
"cross-env": "6.0.3",
7272
"cross-spawn": "6.0.5",
7373
"escape-string-regexp": "2.0.0",
74-
"eslint": "6.8.0",
75-
"eslint-plugin-import": "2.20.2",
76-
"eslint-plugin-jest": "23.13.1",
77-
"eslint-plugin-react": "7.19.0",
78-
"eslint-plugin-react-hooks": "2.3.0",
74+
"eslint": "7.24.0",
75+
"eslint-plugin-import": "2.22.1",
76+
"eslint-plugin-jest": "24.3.5",
77+
"eslint-plugin-react": "7.23.2",
78+
"eslint-plugin-react-hooks": "4.2.0",
7979
"execa": "2.0.3",
8080
"express": "4.17.0",
8181
"faunadb": "2.6.1",
@@ -87,7 +87,6 @@
8787
"image-size": "0.9.3",
8888
"is-animated": "2.0.0",
8989
"isomorphic-unfetch": "3.0.0",
90-
"jest-cli": "27.0.0-next.5",
9190
"ky": "0.19.1",
9291
"ky-universal": "0.6.0",
9392
"lerna": "4.0.0",
@@ -129,7 +128,8 @@
129128
"wait-port": "0.2.2",
130129
"web-streams-polyfill": "2.1.1",
131130
"webpack-bundle-analyzer": "4.3.0",
132-
"worker-loader": "3.0.7"
131+
"worker-loader": "3.0.7",
132+
"jest": "27.0.0-next.8"
133133
},
134134
"resolutions": {
135135
"browserslist": "4.16.1",

packages/next/build/output/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ export function startedDevelopmentServer(appUrl: string, bindAddr: string) {
1212
let previousClient: import('webpack').Compiler | null = null
1313
let previousServer: import('webpack').Compiler | null = null
1414

15-
type CompilerDiagnosticsWithFile = {
16-
errors: { file: string | undefined; message: string }[] | null
17-
warnings: { file: string | undefined; message: string }[] | null
18-
}
19-
2015
type CompilerDiagnostics = {
2116
errors: string[] | null
2217
warnings: string[] | null
@@ -44,6 +39,8 @@ type BuildStatusStore = {
4439
amp: AmpPageStatus
4540
}
4641

42+
// eslint typescript has a bug with TS enums
43+
/* eslint-disable no-shadow */
4744
enum WebpackStatusPhase {
4845
COMPILING = 1,
4946
COMPILED_WITH_ERRORS = 2,

packages/next/build/webpack-config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,10 @@ export default async function getBaseWebpackConfig(
596596
async function handleExternals(
597597
context: string,
598598
request: string,
599-
getResolve: () => (context: string, request: string) => Promise<string>
599+
getResolve: () => (
600+
resolveContext: string,
601+
resolveRequest: string
602+
) => Promise<string>
600603
) {
601604
if (request === 'next') {
602605
return `commonjs ${request}`
@@ -763,8 +766,8 @@ export default async function getBaseWebpackConfig(
763766
context: string
764767
request: string
765768
getResolve: () => (
766-
context: string,
767-
request: string
769+
resolveContext: string,
770+
resolveRequest: string
768771
) => Promise<string>
769772
}) => handleExternals(context, request, getResolve)
770773
: (

packages/next/build/webpack/plugins/webpack-conformance-plugin/TestInterface.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export interface IConformanceAnomaly {
66
stack_trace?: string
77
}
88

9+
// eslint typescript has a bug with TS enums
10+
/* eslint-disable no-shadow */
911
export enum IConformanceTestStatus {
1012
SUCCESS,
1113
FAILED,

packages/next/build/webpack/plugins/webpack-conformance-plugin/checks/granular-chunks-conformance.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* @eslint-disable no-redeclare */
12
import chalk from 'chalk'
23
import {
34
CONFORMANCE_ERROR_PREFIX,
@@ -10,11 +11,6 @@ import {
1011
} from '../TestInterface'
1112
import { deepEqual } from '../utils/utils'
1213

13-
export interface GranularChunksConformanceCheck
14-
extends IWebpackConformanceTest {
15-
granularChunksConfig: any
16-
}
17-
1814
function getWarningMessage(modifiedProp: string) {
1915
return (
2016
`${CONFORMANCE_WARNING_PREFIX}: The splitChunks config has been carefully ` +
@@ -33,7 +29,9 @@ function getErrorMessage(message: string) {
3329
)
3430
}
3531

36-
export class GranularChunksConformanceCheck {
32+
/* @eslint-disable-next-line no-redeclare */
33+
export class GranularChunksConformanceCheck implements IWebpackConformanceTest {
34+
granularChunksConfig: any
3735
constructor(granularChunksConfig: any) {
3836
this.granularChunksConfig = granularChunksConfig
3937
}

packages/next/compiled/conf/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/next/compiled/json5/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/next/compiled/terser/bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)