Skip to content

Commit 0f3c9ff

Browse files
WesSouzaarturbien
authored andcommitted
chore(lint): add eslint-plugin-react-hooks
This also disables no-undef for TypeScript files and removes no-nested-ternary.
1 parent a7eeda1 commit 0f3c9ff

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ module.exports = {
22
extends: [
33
'plugin:@typescript-eslint/recommended',
44
'airbnb',
5-
'plugin:prettier/recommended'
5+
'plugin:prettier/recommended',
6+
'plugin:react-hooks/recommended'
67
],
78
parser: '@typescript-eslint/parser',
89
plugins: ['react', 'prettier'],
@@ -32,6 +33,7 @@ module.exports = {
3233
'import/prefer-default-export': 'off',
3334
'jsx-a11y/label-has-associated-control': ['error', { assert: 'either' }],
3435
'jsx-a11y/label-has-for': 'off',
36+
'no-nested-ternary': 'off',
3537
'prettier/prettier': 'error',
3638
'react/forbid-prop-types': 'off',
3739
'react/jsx-filename-extension': [

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"eslint-plugin-jsx-a11y": "^6.6.0",
8787
"eslint-plugin-prettier": "^4.2.1",
8888
"eslint-plugin-react": "^7.30.1",
89+
"eslint-plugin-react-hooks": "^4.6.0",
8990
"firebase-tools": "^11.3.0",
9091
"husky": "^8.0.1",
9192
"jest": "^28.1.3",

src/Button/Button.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-nested-ternary */
2-
31
import React, { forwardRef } from 'react';
42
import styled, { css } from 'styled-components';
53
import {

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7173,6 +7173,11 @@ eslint-plugin-prettier@^4.2.1:
71737173
dependencies:
71747174
prettier-linter-helpers "^1.0.0"
71757175

7176+
eslint-plugin-react-hooks@^4.6.0:
7177+
version "4.6.0"
7178+
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3"
7179+
integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==
7180+
71767181
eslint-plugin-react@^7.30.1:
71777182
version "7.30.1"
71787183
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.30.1.tgz#2be4ab23ce09b5949c6631413ba64b2810fd3e22"

0 commit comments

Comments
 (0)