Skip to content

Commit

Permalink
Merge pull request #2 from OreQr/eslint-v9-migration
Browse files Browse the repository at this point in the history
Migrate eslint to v9
  • Loading branch information
OreQr authored Jan 15, 2025
2 parents 713897c + 9ede590 commit e4b78d6
Show file tree
Hide file tree
Showing 5 changed files with 364 additions and 354 deletions.
41 changes: 0 additions & 41 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Minimalist Next.js boilerplate with modern web development tools.
- Tailwind CSS
- shadcn/ui
- Configured fonts
- ESLint
- ESLint v9
- Prettier
- VS Code configuration
- GitHub Actions CI
Expand Down
88 changes: 88 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */

import nextPlugin from "@next/eslint-plugin-next"
import tseslint from "@typescript-eslint/eslint-plugin"
import tsParser from "@typescript-eslint/parser"
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"
import tailwind from "eslint-plugin-tailwindcss"

/** @type {import("eslint").Linter.Config[]} */
const eslintConfig = [
{
plugins: {
"@next/next": nextPlugin,
},
rules: {
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs["core-web-vitals"].rules,
},
files: ["**/*.{mjs,ts,tsx}"],
},

...tailwind.configs["flat/recommended"],
{
settings: {
tailwindcss: {
callees: ["cn", "cva"],
},
},
},

{
plugins: {
"@typescript-eslint": tseslint,
},

languageOptions: {
parser: tsParser,
parserOptions: {
project: "tsconfig.json",
},
},

rules: {
...tseslint.configs["recommended-type-checked"].rules,
...tseslint.configs["stylistic-type-checked"].rules,

"@next/next/no-html-link-for-pages": "off",
"@next/next/no-img-element": "off",
"tailwindcss/no-custom-classname": "off",
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",

"@typescript-eslint/consistent-type-imports": [
"warn",
{
prefer: "type-imports",
fixStyle: "inline-type-imports",
},
],

"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],

"@typescript-eslint/require-await": "off",

"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: {
attributes: false,
},
},
],
},
},
{
ignores: [".next"],
},
eslintPluginPrettierRecommended,
]

export default eslintConfig
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.469.0",
"next": "15.1.3",
"next": "15.1.4",
"next-themes": "^0.4.4",
"react": "19.0.0",
"react-dom": "19.0.0",
Expand All @@ -34,13 +34,13 @@
"@types/node": "^22.10.5",
"@types/react": "^19.0.3",
"@types/react-dom": "^19.0.2",
"@typescript-eslint/eslint-plugin": "^8.19.1",
"@typescript-eslint/parser": "^8.19.1",
"@typescript-eslint/eslint-plugin": "^8.20.0",
"@typescript-eslint/parser": "^8.20.0",
"concurrently": "^9.1.2",
"eslint": "^8.57.1",
"eslint-config-next": "15.1.3",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint": "^9.18.0",
"eslint-config-next": "15.1.4",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.2",
"eslint-plugin-tailwindcss": "^3.17.5",
"postcss": "^8.4.49",
"prettier": "^3.4.2",
Expand Down
Loading

0 comments on commit e4b78d6

Please sign in to comment.