Skip to content

Commit

Permalink
feat(Next): Add Airbnb lint for React Hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
danactive committed May 1, 2021
1 parent 31d1e17 commit a304aa2
Show file tree
Hide file tree
Showing 11 changed files with 1,425 additions and 42 deletions.
12 changes: 12 additions & 0 deletions app/.eslintrc.js
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,
},
}
2 changes: 1 addition & 1 deletion app/__tests__/snapshot.js → app/__tests__/snapshot.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import renderer from 'react-test-renderer'
import Index from '../pages/index'
import Index from '../pages'

it('renders homepage unchanged', () => {
const tree = renderer.create(<Index />).toJSON()
Expand Down
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()
})
Loading

0 comments on commit a304aa2

Please sign in to comment.