Skip to content

Commit 49c04b3

Browse files
committed
chore: improve eslint config
1 parent 0524e53 commit 49c04b3

File tree

7 files changed

+653
-13
lines changed

7 files changed

+653
-13
lines changed

.eslintrc.json

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
11
{
2-
"extends": "next",
2+
"extends": ["next", "plugin:unicorn/recommended"],
33
"settings": {
44
"next": {
55
"rootDir": "./apps/librelingo-web/src"
66
}
77
},
88
"ignorePatterns": ["playwright-report", "apps/librelingo-web/out"],
99
"rules": {
10-
"@next/next/no-html-link-for-pages": "off"
11-
}
10+
"@next/next/no-html-link-for-pages": "off",
11+
"unicorn/prevent-abbreviations": [
12+
"error",
13+
{
14+
"allowList": {
15+
"Props": true,
16+
"generateStaticParams": true,
17+
"props": true,
18+
"env": true
19+
}
20+
}
21+
]
22+
},
23+
"overrides": [
24+
{
25+
"files": ["./apps/librelingo-web/src/components/ui/**/*"],
26+
"rules": {
27+
"unicorn/prevent-abbreviations": "off"
28+
}
29+
}
30+
]
1231
}

apps/librelingo-web/src/app/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Metadata } from 'next'
2-
import CourseCard from './CourseCard'
32
import { Course, listAvailableCourses } from '@/data/course'
3+
import CourseCard from './course-card'
44

55
export const metadata: Metadata = {
66
title: 'LibreLingo',

apps/librelingo-web/src/data/course.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import path from 'path'
1+
import path from 'node:path'
22
import courseConfig from '@/courses/config.json'
3-
import fs from 'fs'
3+
import fs from 'node:fs'
44

55
export type Course = {
66
id: string
@@ -24,7 +24,7 @@ function getFullJsonPath(jsonPath: string) {
2424
async function getCourseMetadataByJsonPath(jsonPath: string) {
2525
const fileContent = await fs.promises.readFile(
2626
getFullJsonPath(jsonPath),
27-
'utf-8'
27+
'utf8'
2828
)
2929
return JSON.parse(fileContent)
3030
}

apps/librelingo-web/tailwind.config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { fontFamily } from 'tailwindcss/defaultTheme'
2+
import tailwindAnimate from 'tailwindcss-animate'
23
import type { Config } from 'tailwindcss'
34

45
const config = {
@@ -78,7 +79,7 @@ const config = {
7879
},
7980
},
8081
},
81-
plugins: [require('tailwindcss-animate')],
82+
plugins: [tailwindAnimate],
8283
} satisfies Config
8384

8485
export default config

0 commit comments

Comments
 (0)