chore: eslint updates to the tailwind example (#6377)

minor updates to eslint rules in tailwind example
This commit is contained in:
Paul
2024-05-15 21:56:19 -03:00
committed by GitHub
parent d053778bf2
commit 3456b5f6a7
3 changed files with 29 additions and 3 deletions

View File

@@ -1,7 +1,29 @@
/** @type {import('eslint').Linter.Config} */ /** @type {import('eslint').Linter.Config} */
module.exports = { module.exports = {
extends: ['plugin:@next/next/core-web-vitals', '@payloadcms'],
ignorePatterns: ['**/payload-types.ts'],
overrides: [
{
extends: ['plugin:@typescript-eslint/disable-type-checked'],
files: ['*.js', '*.cjs', '*.json', '*.md', '*.yml', '*.yaml'],
},
{
files: ['./src/**/*.ts', './src/**/*.tsx'],
rules: {
'no-restricted-exports': 'off',
'perfectionist/sort-jsx-props': 'warn',
'perfectionist/sort-objects': 'warn',
'perfectionist/sort-named-exports': 'warn',
'jsx-a11y/heading-has-content': 'warn',
'jsx-a11y/html-has-lang': 'warn',
'perfectionist/sort-imports': 'warn',
'perfectionist/sort-named-imports': 'warn',
},
},
],
parserOptions: { parserOptions: {
project: ['./tsconfig.json'], project: ['./tsconfig.json'],
tsconfigRootDir: __dirname, tsconfigRootDir: __dirname,
}, },
root: true,
} }

View File

@@ -1,6 +1,8 @@
import { ReactNode } from 'react' import type { ReactNode } from 'react'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
import { Inter as FontSans } from 'next/font/google' import { Inter as FontSans } from 'next/font/google'
import React from 'react'
type LayoutProps = { type LayoutProps = {
children: ReactNode children: ReactNode
@@ -15,7 +17,7 @@ const fontSans = FontSans({
const Layout = ({ children }: LayoutProps) => { const Layout = ({ children }: LayoutProps) => {
return ( return (
<html> <html lang="en">
<body className={cn('min-h-screen bg-background font-sans antialiased', fontSans.variable)}> <body className={cn('min-h-screen bg-background font-sans antialiased', fontSans.variable)}>
{children} {children}
</body> </body>

View File

@@ -1,4 +1,6 @@
import { NextPage } from 'next' import type { NextPage } from 'next'
import React from 'react'
const Page: NextPage = () => { const Page: NextPage = () => {
return ( return (