Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions libs/@guardian/eslint-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @guardian/eslint-config

## 10.0.0-beta.3

### Minor Changes

Adds the `recommended` config of `eslint-plugin-react-hooks` when linting `jsx`, `mjsx`, `tsx` and `mtsx` files.

### Patch Changes

- Updates deps

## 10.0.0-beta.2

### Patch Changes
Expand Down
3 changes: 3 additions & 0 deletions libs/@guardian/eslint-config/configs/react.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import jsxA11y from 'eslint-plugin-jsx-a11y';
import react from 'eslint-plugin-react';
import hooks from 'eslint-plugin-react-hooks';
import globals from 'globals';

export default [
Expand All @@ -17,6 +18,7 @@ export default [
...react.configs.flat['jsx-runtime'],
plugins: {
react,
'react-hooks': hooks,
'jsx-a11y': jsxA11y,
},
rules: {
Expand All @@ -26,6 +28,7 @@ export default [
ignore: ['css'],
},
],
...hooks.configs.recommended.rules,
},
settings: {
react: {
Expand Down
22 changes: 11 additions & 11 deletions libs/@guardian/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@guardian/eslint-config",
"version": "10.0.0-beta.2",
"version": "10.0.0-beta.3",
"description": "ESLint config for Guardian JavaScript projects",
"type": "module",
"main": "index.js",
Expand All @@ -9,19 +9,19 @@
"lint": "wireit"
},
"dependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "4.4.0",
"@eslint/js": "9.9.1",
"@stylistic/eslint-plugin": "2.7.2",
"@eslint-community/eslint-plugin-eslint-comments": "4.4.1",
"@eslint/js": "9.13.0",
"@stylistic/eslint-plugin": "2.9.0",
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-typescript": "3.6.3",
"eslint-plugin-import-x": "4.2.0",
"eslint-plugin-jsx-a11y": "6.10.0",
"eslint-plugin-react": "7.35.2",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-storybook": "0.8.0",
"globals": "15.9.0",
"eslint-plugin-import-x": "4.3.1",
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-react": "7.37.2",
"eslint-plugin-react-hooks": "5.0.0",
"eslint-plugin-storybook": "0.10.1",
"globals": "15.11.0",
"read-package-up": "11.0.0",
"typescript-eslint": "8.4.0"
"typescript-eslint": "8.11.0"
},
"devDependencies": {
"eslint": "9.9.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Story = StoryObj<typeof Checkbox>;

const Template: Story = {
render: (args) => {
// eslint-disable-next-line react-hooks/rules-of-hooks -- it _is_ actually a react function component
const [checked, setChecked] = useState(args.checked);
return (
<Checkbox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Story = StoryObj<

const Template: Story = {
render: (args) => {
// eslint-disable-next-line react-hooks/rules-of-hooks -- it _is_ actually a react function component
const [checked, setChecked] = useState(
CheckboxStories.DefaultDefaultTheme.args?.checked,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export const WithWildlyVaryingLengthsTabletDefaultTheme: Story = {

export const ControlledMultiSelectDefaultTheme: Story = {
render: (args) => {
// eslint-disable-next-line react-hooks/rules-of-hooks -- it _is_ actually a react function component
const [state, setState] = useState({
opt1: true,
opt2: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type Story = StoryObj<typeof TextArea>;

const Template: Story = {
render: (args) => {
// eslint-disable-next-line react-hooks/rules-of-hooks -- it _is_ actually a react function component
const [value, setValue] = useState(args.value);
const onChange = (e: React.ChangeEvent<HTMLTextAreaElement>) =>
setValue(e.target.value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type Story = StoryObj<typeof TextInput>;

const Template: Story = {
render: (args) => {
// eslint-disable-next-line react-hooks/rules-of-hooks -- it _is_ actually a react function component
const [state, setState] = useState('');
return (
<TextInput
Expand Down
Loading
Loading