Update ESLint configuration
CI Pipeline / test (20) (pull_request) Successful in 3m16s
CI Pipeline / test (18) (pull_request) Successful in 3m51s
CI Pipeline / e2e (chromium) (pull_request) Successful in 3m43s
CI Pipeline / e2e (firefox) (pull_request) Successful in 3m29s
CI Pipeline / e2e (webkit) (pull_request) Successful in 4m33s
CI Pipeline / visual-regression (pull_request) Successful in 6m18s
CI Pipeline / storybook (pull_request) Failing after 59s
CI Pipeline / performance (pull_request) Successful in 3m25s
CI Pipeline / lint (pull_request) Failing after 1m59s
CI Pipeline / build (pull_request) Failing after 2m25s
CI Pipeline / test (20) (pull_request) Successful in 3m16s
CI Pipeline / test (18) (pull_request) Successful in 3m51s
CI Pipeline / e2e (chromium) (pull_request) Successful in 3m43s
CI Pipeline / e2e (firefox) (pull_request) Successful in 3m29s
CI Pipeline / e2e (webkit) (pull_request) Successful in 4m33s
CI Pipeline / visual-regression (pull_request) Successful in 6m18s
CI Pipeline / storybook (pull_request) Failing after 59s
CI Pipeline / performance (pull_request) Successful in 3m25s
CI Pipeline / lint (pull_request) Failing after 1m59s
CI Pipeline / build (pull_request) Failing after 2m25s
This commit is contained in:
+89
-16
@@ -1,24 +1,97 @@
|
||||
// ESLint flat config for Next.js 16
|
||||
// Note: Using a workaround for FlatCompat circular reference issue
|
||||
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
|
||||
import storybook from "eslint-plugin-storybook";
|
||||
|
||||
import { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
});
|
||||
import js from "@eslint/js";
|
||||
import tseslint from "@typescript-eslint/eslint-plugin";
|
||||
import tsparser from "@typescript-eslint/parser";
|
||||
import nextPlugin from "@next/eslint-plugin-next";
|
||||
import globals from "globals";
|
||||
|
||||
const eslintConfig = [
|
||||
...compat.extends("next/core-web-vitals"),
|
||||
{
|
||||
files: ["**/*.js", "**/*.jsx", "**/*.mjs"],
|
||||
ignores: ["**/*.ts", "**/*.tsx"],
|
||||
},
|
||||
// Base JavaScript recommended rules
|
||||
js.configs.recommended,
|
||||
// Storybook config
|
||||
...storybook.configs["flat/recommended"],
|
||||
// Global ignores
|
||||
{
|
||||
ignores: [
|
||||
".next/**",
|
||||
"node_modules/**",
|
||||
"dist/**",
|
||||
"build/**",
|
||||
"coverage/**",
|
||||
"storybook-static/**",
|
||||
"playwright-report/**",
|
||||
"test-results/**",
|
||||
"lhci-results/**",
|
||||
"docs/**",
|
||||
],
|
||||
},
|
||||
// JavaScript files configuration
|
||||
{
|
||||
files: ["**/*.{js,jsx}"],
|
||||
languageOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.browser,
|
||||
...globals.es2021,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
// TypeScript files configuration
|
||||
{
|
||||
files: ["**/*.{ts,tsx}"],
|
||||
languageOptions: {
|
||||
parser: tsparser,
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.browser,
|
||||
...globals.es2021,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
project: "./tsconfig.json",
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
"@typescript-eslint": tseslint,
|
||||
"@next/next": nextPlugin,
|
||||
},
|
||||
rules: {
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
argsIgnorePattern: "^_",
|
||||
varsIgnorePattern: "^_",
|
||||
},
|
||||
],
|
||||
"@typescript-eslint/no-explicit-any": "warn",
|
||||
// Next.js rules
|
||||
"@next/next/no-html-link-for-pages": "off",
|
||||
"@next/next/no-img-element": "warn",
|
||||
},
|
||||
},
|
||||
// All files - basic rules
|
||||
{
|
||||
files: ["**/*.{ts,tsx,js,jsx}"],
|
||||
rules: {
|
||||
// Basic rules
|
||||
"react/no-unescaped-entities": "off",
|
||||
"no-console": "warn",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default eslintConfig;
|
||||
|
||||
Reference in New Issue
Block a user