-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Next): Add Airbnb lint for React Hooks
- Loading branch information
Showing
11 changed files
with
1,425 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
extends: ['airbnb', 'airbnb/hooks'], | ||
rules: { | ||
'max-len': [2, 150, 4], // increase page width | ||
semi: [2, 'never'], // remove semicolons | ||
'react/prop-types': 'off', | ||
'react/react-in-jsx-scope': 'off', // Next.js magically includes | ||
}, | ||
env: { | ||
jest: true, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
app/__tests__/testing-library.js → app/__tests__/testing-library.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react' | ||
import { render } from '@testing-library/react' | ||
import Index from '../pages/index' | ||
import Index from '../pages' | ||
|
||
test('renders deploy link', () => { | ||
const { getByText } = render(<Index />) | ||
const linkElement = getByText( | ||
/Instantly deploy your Next\.js site to a public URL with Vercel\./ | ||
/Instantly deploy your Next\.js site to a public URL with Vercel\./, | ||
) | ||
expect(linkElement).toBeInTheDocument() | ||
}) |
Oops, something went wrong.