Skip to content

Commit

Permalink
Test lint config after first-time setup
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jun 24, 2024
1 parent fc382a9 commit 084fbc1
Show file tree
Hide file tree
Showing 8 changed files with 609 additions and 27 deletions.
1 change: 0 additions & 1 deletion test/integration/eslint/first-time-setup/.eslintrc.json

This file was deleted.

9 changes: 0 additions & 9 deletions test/integration/eslint/first-time-setup/pages/index.js

This file was deleted.

17 changes: 0 additions & 17 deletions test/integration/eslint/test/next-build.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { join } from 'path'

import { nextBuild } from 'next-test-utils'

const dirFirstTimeSetup = join(__dirname, '../first-time-setup')
const dirCustomConfig = join(__dirname, '../custom-config')
const dirIgnoreDuringBuilds = join(__dirname, '../ignore-during-builds')
const dirBaseDirectories = join(__dirname, '../base-directories')
Expand All @@ -23,22 +22,6 @@ describe('Next Build', () => {
;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode',
() => {
test('first time setup', async () => {
const eslintrcJson = join(dirFirstTimeSetup, '.eslintrc.json')
await fs.writeFile(eslintrcJson, '')

const { stdout, stderr } = await nextBuild(dirFirstTimeSetup, [], {
stdout: true,
stderr: true,
lint: true,
})
const output = stdout + stderr

expect(output).toContain(
'No ESLint configuration detected. Run next lint to begin setup'
)
})

test('shows warnings and errors', async () => {
const { stdout, stderr } = await nextBuild(dirCustomConfig, [], {
stdout: true,
Expand Down
7 changes: 7 additions & 0 deletions test/production/eslint/first-time-setup-ts/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Test() {
return (
<div>
<h1>Hello title</h1>
</div>
)
}
29 changes: 29 additions & 0 deletions test/production/eslint/first-time-setup-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"noEmit": true,
"incremental": true,
"module": "esnext",
"esModuleInterop": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
7 changes: 7 additions & 0 deletions test/production/eslint/first-time-setup/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Test() {
return (
<div>
<h1>Hello title</h1>
</div>
)
}
Loading

0 comments on commit 084fbc1

Please sign in to comment.