mirror of
https://github.com/nicepkg/ai-workflow.git
synced 2026-11-18 18:04:23 +00:00
chore: update ESLint configuration by removing jsx-a11y plugin, refining rules, and enhancing TypeScript support; adjust pnpm-lock and VSCode settings accordingly
This commit is contained in:
Vendored
-1
@@ -9,7 +9,6 @@
|
||||
|
||||
// ESLint settings
|
||||
"eslint.useFlatConfig": true,
|
||||
"eslint.experimental.useFlatConfig": true,
|
||||
"eslint.format.enable": true,
|
||||
"eslint.nodePath": "website/node_modules",
|
||||
"eslint.validate": [
|
||||
|
||||
Generated
-3
@@ -209,9 +209,6 @@ importers:
|
||||
eslint-plugin-import:
|
||||
specifier: ^2.32.0
|
||||
version: 2.32.0(@typescript-eslint/parser@8.53.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.2(jiti@2.6.1))
|
||||
eslint-plugin-jsx-a11y:
|
||||
specifier: ^6.10.2
|
||||
version: 6.10.2(eslint@9.39.2(jiti@2.6.1))
|
||||
eslint-plugin-prettier:
|
||||
specifier: ^5.5.5
|
||||
version: 5.5.5(eslint-config-prettier@10.1.8(eslint@9.39.2(jiti@2.6.1)))(eslint@9.39.2(jiti@2.6.1))(prettier@3.8.0)
|
||||
|
||||
+87
-54
@@ -1,96 +1,129 @@
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
import next from "@next/eslint-plugin-next";
|
||||
import { defineConfig, globalIgnores } from "eslint/config";
|
||||
import prettier from "eslint-config-prettier/flat";
|
||||
import eslintPluginImport from "eslint-plugin-import";
|
||||
import eslintPluginPrettier from "eslint-plugin-prettier";
|
||||
import eslintPluginReact from "eslint-plugin-react";
|
||||
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
|
||||
import tseslint from "typescript-eslint";
|
||||
import { defineConfig } from "eslint/config";
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: import.meta.dirname,
|
||||
});
|
||||
|
||||
export default defineConfig(
|
||||
// Next.js Core Web Vitals config (includes React, React Hooks, and Next.js rules)
|
||||
...compat.extends("next/core-web-vitals", "next/typescript"),
|
||||
|
||||
// Prettier config (disables conflicting ESLint rules)
|
||||
prettier,
|
||||
|
||||
// Global ignores
|
||||
globalIgnores([
|
||||
// Default Next.js ignores
|
||||
".next/**",
|
||||
"out/**",
|
||||
"build/**",
|
||||
"next-env.d.ts",
|
||||
// Additional ignores
|
||||
"public/_pagefind/**",
|
||||
"node_modules/**",
|
||||
".git/**",
|
||||
]),
|
||||
|
||||
// Custom rules and plugins
|
||||
{
|
||||
ignores: ["**/.next/**", "**/public/_pagefind/**", "**/out/**"],
|
||||
},
|
||||
...compat.extends(
|
||||
"plugin:react/recommended",
|
||||
"plugin:react-hooks/recommended",
|
||||
"prettier"
|
||||
),
|
||||
{
|
||||
files: ["**/*.{js,mjs,cjs,jsx,ts,tsx}"],
|
||||
plugins: {
|
||||
import: eslintPluginImport,
|
||||
react: eslintPluginReact,
|
||||
},
|
||||
rules: {
|
||||
"import/no-anonymous-default-export": "warn",
|
||||
"react/no-unknown-property": "off",
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/prop-types": "off",
|
||||
"jsx-a11y/alt-text": [
|
||||
"warn",
|
||||
{
|
||||
elements: ["img"],
|
||||
img: ["Image"],
|
||||
},
|
||||
],
|
||||
"jsx-a11y/aria-props": "warn",
|
||||
"jsx-a11y/aria-proptypes": "warn",
|
||||
"jsx-a11y/aria-unsupported-elements": "warn",
|
||||
"jsx-a11y/role-has-required-aria-props": "warn",
|
||||
"jsx-a11y/role-supports-aria-props": "warn",
|
||||
"react/jsx-no-target-blank": "off",
|
||||
prettier: eslintPluginPrettier,
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect",
|
||||
next: {
|
||||
rootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Import rules
|
||||
"import/no-anonymous-default-export": "warn",
|
||||
"import/order": [
|
||||
"warn",
|
||||
{
|
||||
groups: [
|
||||
"builtin",
|
||||
"external",
|
||||
"internal",
|
||||
"parent",
|
||||
"sibling",
|
||||
"index",
|
||||
],
|
||||
"newlines-between": "never",
|
||||
alphabetize: {
|
||||
order: "asc",
|
||||
caseInsensitive: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
// React rules overrides
|
||||
"react/no-unknown-property": "off", // For Three.js props
|
||||
|
||||
// Prettier
|
||||
"prettier/prettier": "warn",
|
||||
},
|
||||
},
|
||||
|
||||
// Additional TypeScript config
|
||||
{
|
||||
files: ["**/*.ts", "**/*.tsx"],
|
||||
files: ["**/*.{ts,tsx}"],
|
||||
extends: [
|
||||
...tseslint.configs.recommended,
|
||||
...tseslint.configs.recommendedTypeChecked,
|
||||
...tseslint.configs.stylisticTypeChecked,
|
||||
],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// TypeScript rules
|
||||
"@typescript-eslint/triple-slash-reference": "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" },
|
||||
{
|
||||
prefer: "type-imports",
|
||||
fixStyle: "inline-type-imports",
|
||||
},
|
||||
],
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"warn",
|
||||
{
|
||||
argsIgnorePattern: "^_",
|
||||
varsIgnorePattern: "^_",
|
||||
caughtErrorsIgnorePattern: "^_",
|
||||
},
|
||||
],
|
||||
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
|
||||
"@typescript-eslint/require-await": "off",
|
||||
"@typescript-eslint/no-misused-promises": [
|
||||
"error",
|
||||
{ checksVoidReturn: { attributes: false } },
|
||||
{
|
||||
checksVoidReturn: {
|
||||
attributes: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
"@typescript-eslint/prefer-nullish-coalescing": "off",
|
||||
"@typescript-eslint/no-explicit-any": "warn",
|
||||
"@typescript-eslint/no-unnecessary-condition": "warn",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["**/*.{js,jsx,ts,tsx}"],
|
||||
plugins: {
|
||||
prettier: eslintPluginPrettier,
|
||||
},
|
||||
rules: {
|
||||
"prettier/prettier": "warn",
|
||||
},
|
||||
},
|
||||
|
||||
// Linter options
|
||||
{
|
||||
linterOptions: {
|
||||
reportUnusedDisableDirectives: true,
|
||||
reportUnusedDisableDirectives: "warn",
|
||||
},
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@@ -86,7 +86,6 @@
|
||||
"eslint-config-next": "^15.2.3",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"eslint-plugin-prettier": "^5.5.5",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.0.1",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { Canvas, useFrame } from "@react-three/fiber";
|
||||
import {
|
||||
Sphere,
|
||||
MeshDistortMaterial,
|
||||
@@ -8,6 +7,7 @@ import {
|
||||
Stars,
|
||||
PerspectiveCamera,
|
||||
} from "@react-three/drei";
|
||||
import { Canvas, useFrame } from "@react-three/fiber";
|
||||
import { useRef } from "react";
|
||||
import type * as THREE from "three";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user