Skip to content
Open
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
4 changes: 2 additions & 2 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import * as path from "path";

const buildEslintCommand = (filenames) =>
`next lint --fix --file ${filenames
`eslint --fix ${filenames
.map((f) => path.relative(process.cwd(), f))
.join(" --file ")}`;
.join(" ")}`;

/**
* @type {import("lint-staged").Configuration}
Expand Down
30 changes: 10 additions & 20 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import { FlatCompat } from "@eslint/eslintrc";
import { defineConfig, globalIgnores } from 'eslint/config';
import nextVitals from 'eslint-config-next/core-web-vitals';
import nextTs from 'eslint-config-next/typescript';

import checkFile from "eslint-plugin-check-file";
import header from "eslint-plugin-header";
import importPlugin from "eslint-plugin-import";
import jestPlugin from "eslint-plugin-jest";
import js from "@eslint/js";
import jsdoc from "eslint-plugin-jsdoc";
import tsEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
import storybook from "eslint-plugin-storybook";

const __dirname = dirname(fileURLToPath(import.meta.url));
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
});

// Workaround for a compatibility issue between eslint-plugin-header and ESLint v9:
// See https://github.com/Stuk/eslint-plugin-header/issues/59
// TODO: This line can be removed and the default header config can be used
// again after the aforementioned issue has been fixed.
header.rules.header.meta.schema = false;

const config = [
...compat.extends("next/core-web-vitals", "next/typescript"),
{
ignores: [
const config = defineConfig([
...nextVitals,
...nextTs,
globalIgnores([
"node_modules/**",
".next/**",
"out/**",
Expand All @@ -42,11 +36,7 @@ const config = [
"coverage",
"!.storybook",
"playwright-report/**",
],
},
...compat.config({
extends: ["next"],
}),
]),
...storybook.configs["flat/recommended"],
{
languageOptions: {
Expand Down Expand Up @@ -205,6 +195,6 @@ const config = [
"react-hooks/rules-of-hooks": "off",
},
},
];
]);

export default config;
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
import "./.next/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
Loading
Loading