Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade eslint to the latest version #24377

Merged
merged 3 commits into from
Apr 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
"extends": ["plugin:jest/recommended"],
"rules": {
"jest/expect-expect": "off",
"jest/no-disabled-tests": "off"
"jest/no-disabled-tests": "off",
"jest/no-conditional-expect": "off",
"jest/valid-title": "off",
"jest/no-interpolation-in-snapshots": "off"
}
},
{ "files": ["**/__tests__/**"], "env": { "jest": true } },
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"@types/http-proxy": "1.17.3",
"@types/jest": "24.0.13",
"@types/string-hash": "1.1.1",
"@typescript-eslint/eslint-plugin": "2.17.0",
"@typescript-eslint/parser": "2.17.0",
"@typescript-eslint/eslint-plugin": "4.22.0",
"@typescript-eslint/parser": "4.22.0",
"@zeit/next-css": "1.0.2-canary.2",
"@zeit/next-sass": "1.0.2-canary.2",
"@zeit/next-typescript": "1.1.2-canary.0",
Expand All @@ -71,11 +71,11 @@
"cross-env": "6.0.3",
"cross-spawn": "6.0.5",
"escape-string-regexp": "2.0.0",
"eslint": "6.8.0",
"eslint-plugin-import": "2.20.2",
"eslint-plugin-jest": "23.13.1",
"eslint-plugin-react": "7.19.0",
"eslint-plugin-react-hooks": "2.3.0",
"eslint": "7.24.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jest": "24.3.5",
"eslint-plugin-react": "7.23.2",
"eslint-plugin-react-hooks": "4.2.0",
"execa": "2.0.3",
"express": "4.17.0",
"faunadb": "2.6.1",
Expand All @@ -87,7 +87,6 @@
"image-size": "0.9.3",
"is-animated": "2.0.0",
"isomorphic-unfetch": "3.0.0",
"jest-cli": "27.0.0-next.5",
"ky": "0.19.1",
"ky-universal": "0.6.0",
"lerna": "4.0.0",
Expand Down Expand Up @@ -129,7 +128,8 @@
"wait-port": "0.2.2",
"web-streams-polyfill": "2.1.1",
"webpack-bundle-analyzer": "4.3.0",
"worker-loader": "3.0.7"
"worker-loader": "3.0.7",
"jest": "27.0.0-next.8"
},
"resolutions": {
"browserslist": "4.16.1",
Expand Down
7 changes: 2 additions & 5 deletions packages/next/build/output/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ export function startedDevelopmentServer(appUrl: string, bindAddr: string) {
let previousClient: import('webpack').Compiler | null = null
let previousServer: import('webpack').Compiler | null = null

type CompilerDiagnosticsWithFile = {
errors: { file: string | undefined; message: string }[] | null
warnings: { file: string | undefined; message: string }[] | null
}

type CompilerDiagnostics = {
errors: string[] | null
warnings: string[] | null
Expand Down Expand Up @@ -44,6 +39,8 @@ type BuildStatusStore = {
amp: AmpPageStatus
}

// eslint typescript has a bug with TS enums
/* eslint-disable no-shadow */
enum WebpackStatusPhase {
COMPILING = 1,
COMPILED_WITH_ERRORS = 2,
Expand Down
9 changes: 6 additions & 3 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,10 @@ export default async function getBaseWebpackConfig(
async function handleExternals(
context: string,
request: string,
getResolve: () => (context: string, request: string) => Promise<string>
getResolve: () => (
resolveContext: string,
resolveRequest: string
) => Promise<string>
) {
if (request === 'next') {
return `commonjs ${request}`
Expand Down Expand Up @@ -763,8 +766,8 @@ export default async function getBaseWebpackConfig(
context: string
request: string
getResolve: () => (
context: string,
request: string
resolveContext: string,
resolveRequest: string
) => Promise<string>
}) => handleExternals(context, request, getResolve)
: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export interface IConformanceAnomaly {
stack_trace?: string
}

// eslint typescript has a bug with TS enums
/* eslint-disable no-shadow */
export enum IConformanceTestStatus {
SUCCESS,
FAILED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* @eslint-disable no-redeclare */
import chalk from 'chalk'
import {
CONFORMANCE_ERROR_PREFIX,
Expand All @@ -10,11 +11,6 @@ import {
} from '../TestInterface'
import { deepEqual } from '../utils/utils'

export interface GranularChunksConformanceCheck
extends IWebpackConformanceTest {
granularChunksConfig: any
}

function getWarningMessage(modifiedProp: string) {
return (
`${CONFORMANCE_WARNING_PREFIX}: The splitChunks config has been carefully ` +
Expand All @@ -33,7 +29,9 @@ function getErrorMessage(message: string) {
)
}

export class GranularChunksConformanceCheck {
/* @eslint-disable-next-line no-redeclare */
export class GranularChunksConformanceCheck implements IWebpackConformanceTest {
granularChunksConfig: any
constructor(granularChunksConfig: any) {
this.granularChunksConfig = granularChunksConfig
}
Expand Down
2 changes: 1 addition & 1 deletion packages/next/compiled/conf/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/next/compiled/json5/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/next/compiled/terser/bundle.min.js

Large diffs are not rendered by default.

Loading