Skip to content

Commit

Permalink
Merge pull request #293 from AndreaPontrandolfo/AndreaPontrandolfo/is…
Browse files Browse the repository at this point in the history
…sue251

feature(rules): changed some rules for nextjs
  • Loading branch information
AndreaPontrandolfo authored Nov 1, 2024
2 parents 3bbcf7f + 187e43c commit 90ef6e5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/nice-walls-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'eslint-config-sheriff': minor
---

feature(rules): changed some rules for nextjs
Fixes #251
2 changes: 2 additions & 0 deletions apps/config-validation-playground/src/mocks/InfoButton.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable react/function-component-definition */

import type { JSX } from 'react';

interface InfoButtonProps {
Expand Down
2 changes: 2 additions & 0 deletions apps/config-validation-playground/src/samples/react.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable react/function-component-definition */

import type { JSX } from 'react';

export const MyComponent = (): JSX.Element => {
Expand Down
9 changes: 9 additions & 0 deletions packages/eslint-config-sheriff/src/nextjsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,14 @@ export const nextjsConfig = {
rules: {
...nextjs.configs.recommended.rules,
...nextjs.configs['core-web-vitals'].rules,
'import/no-default-export': 0,
'react/function-component-definition': [
2,
{
namedComponents: 'function-declaration',
unnamedComponents: 'function-expression',
},
],
'@next/next/no-html-link-for-pages': 0, // pages router is legacy at this point. We don't need to support this rule anymore.
},
};

0 comments on commit 90ef6e5

Please sign in to comment.