Skip to content

Commit

Permalink
Upgrade eslint to the latest version (#24377)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
timneutkens authored Apr 25, 2021
1 parent 08ee60d commit cf4ba8d
Show file tree
Hide file tree
Showing 19 changed files with 65,298 additions and 64,958 deletions.
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

0 comments on commit cf4ba8d

Please sign in to comment.