38 lines
980 B
JavaScript
38 lines
980 B
JavaScript
// @ts-check
|
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
import nextTs from "eslint-config-next/typescript";
|
|
import tseslint from "typescript-eslint";
|
|
|
|
const eslintConfig = defineConfig([
|
|
// Next.js core-web-vitals and TypeScript configs
|
|
...nextVitals,
|
|
...nextTs,
|
|
// Add strict TypeScript rules on top
|
|
...tseslint.configs.strictTypeChecked,
|
|
...tseslint.configs.stylisticTypeChecked,
|
|
// Configure TypeScript parser options
|
|
{
|
|
files: ["**/*.{ts,tsx}"],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
projectService: true,
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
},
|
|
// Override default ignores of eslint-config-next
|
|
globalIgnores([
|
|
// Default ignores of eslint-config-next:
|
|
".next/**",
|
|
"out/**",
|
|
"build/**",
|
|
"next-env.d.ts",
|
|
// Additional ignores:
|
|
"*.mjs",
|
|
"tailwind.config.ts",
|
|
]),
|
|
]);
|
|
|
|
export default eslintConfig;
|