Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve eslint config #3390

Merged
merged 1 commit into from
Jul 28, 2024
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
25 changes: 22 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
{
"extends": "next",
"extends": ["next", "plugin:unicorn/recommended"],
"settings": {
"next": {
"rootDir": "./apps/librelingo-web/src"
}
},
"ignorePatterns": ["playwright-report", "apps/librelingo-web/out"],
"rules": {
"@next/next/no-html-link-for-pages": "off"
}
"@next/next/no-html-link-for-pages": "off",
"unicorn/prevent-abbreviations": [
"error",
{
"allowList": {
"Props": true,
"generateStaticParams": true,
"props": true,
"env": true
}
}
]
},
"overrides": [
{
"files": ["./apps/librelingo-web/src/components/ui/**/*"],
"rules": {
"unicorn/prevent-abbreviations": "off"
}
}
]
}
2 changes: 1 addition & 1 deletion apps/librelingo-web/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Metadata } from 'next'
import CourseCard from './CourseCard'
import { Course, listAvailableCourses } from '@/data/course'
import CourseCard from './course-card'

export const metadata: Metadata = {
title: 'LibreLingo',
Expand Down
6 changes: 3 additions & 3 deletions apps/librelingo-web/src/data/course.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path'
import path from 'node:path'
import courseConfig from '@/courses/config.json'
import fs from 'fs'
import fs from 'node:fs'

export type Course = {
id: string
Expand All @@ -24,7 +24,7 @@ function getFullJsonPath(jsonPath: string) {
async function getCourseMetadataByJsonPath(jsonPath: string) {
const fileContent = await fs.promises.readFile(
getFullJsonPath(jsonPath),
'utf-8'
'utf8'
)
return JSON.parse(fileContent)
}
Expand Down
3 changes: 2 additions & 1 deletion apps/librelingo-web/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { fontFamily } from 'tailwindcss/defaultTheme'
import tailwindAnimate from 'tailwindcss-animate'
import type { Config } from 'tailwindcss'

const config = {
Expand Down Expand Up @@ -78,7 +79,7 @@ const config = {
},
},
},
plugins: [require('tailwindcss-animate')],
plugins: [tailwindAnimate],
} satisfies Config

export default config
Loading