Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
8610ba4b
Unverified
Commit
8610ba4b
authored
Jun 16, 2021
by
JJ Kasper
Committed by
GitHub
Jun 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix eslint version check for older versions (#26212)
parent
947ee9dd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
1 deletion
+33
-1
runLintCheck.ts
packages/next/lib/eslint/runLintCheck.ts
+1
-1
.eslintrc
test/integration/eslint/invalid-eslint-version/.eslintrc
+4
-0
index.js
...slint/invalid-eslint-version/node_modules/eslint/index.js
+1
-0
api.js
...int/invalid-eslint-version/node_modules/eslint/lib/api.js
+1
-0
package.json
...t/invalid-eslint-version/node_modules/eslint/package.json
+5
-0
index.js
.../integration/eslint/invalid-eslint-version/pages/index.js
+8
-0
index.test.js
test/integration/eslint/test/index.test.js
+13
-0
No files found.
packages/next/lib/eslint/runLintCheck.ts
View file @
8610ba4b
...
...
@@ -42,7 +42,7 @@ async function lint(
const
mod
=
await
import
(
deps
.
resolved
.
get
(
'eslint'
)
!
)
const
{
ESLint
}
=
mod
let
eslintVersion
=
ESLint
.
version
let
eslintVersion
=
ESLint
?
.
version
if
(
!
ESLint
)
{
eslintVersion
=
mod
?.
CLIEngine
?.
version
...
...
test/integration/eslint/invalid-eslint-version/.eslintrc
0 → 100644
View file @
8610ba4b
{
"extends": "next",
"root": true
}
test/integration/eslint/invalid-eslint-version/node_modules/eslint/index.js
0 → 100644
View file @
8610ba4b
module
.
exports
=
{}
test/integration/eslint/invalid-eslint-version/node_modules/eslint/lib/api.js
0 → 100644
View file @
8610ba4b
module
.
exports
=
{}
test/integration/eslint/invalid-eslint-version/node_modules/eslint/package.json
0 → 100644
View file @
8610ba4b
{
"name"
:
"eslint"
,
"main"
:
"./index.js"
,
"version"
:
"6.0.1"
}
test/integration/eslint/invalid-eslint-version/pages/index.js
0 → 100644
View file @
8610ba4b
const
Home
=
()
=>
(
<
div
>
<
p
>
Home
<
/p
>
/* Badly formatted comment */
<
/div
>
)
export
default
Home
test/integration/eslint/test/index.test.js
View file @
8610ba4b
...
...
@@ -11,6 +11,7 @@ const dirCustomConfig = join(__dirname, '../custom-config')
const
dirIgnoreDuringBuilds
=
join
(
__dirname
,
'../ignore-during-builds'
)
const
dirCustomDirectories
=
join
(
__dirname
,
'../custom-directories'
)
const
dirConfigInPackageJson
=
join
(
__dirname
,
'../config-in-package-json'
)
const
dirInvalidEslintVersion
=
join
(
__dirname
,
'../invalid-eslint-version'
)
describe
(
'ESLint'
,
()
=>
{
describe
(
'Next Build'
,
()
=>
{
...
...
@@ -73,6 +74,18 @@ describe('ESLint', () => {
'Warning: External synchronous scripts are forbidden'
)
})
test
.
only
(
'invalid eslint version'
,
async
()
=>
{
const
{
stdout
,
stderr
}
=
await
nextBuild
(
dirInvalidEslintVersion
,
[],
{
stdout
:
true
,
stderr
:
true
,
})
const
output
=
stdout
+
stderr
expect
(
output
).
toContain
(
'Your project has an older version of ESLint installed'
)
})
})
describe
(
'Next Lint'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment