Files
livedash-node/eslint.config.js

109 lines
2.8 KiB
JavaScript

import js from "@eslint/js";
import nextPlugin from "@next/eslint-plugin-next";
import tseslint from "@typescript-eslint/eslint-plugin";
import tsparser from "@typescript-eslint/parser";
import reactHooks from "eslint-plugin-react-hooks";
export default [
js.configs.recommended,
{
ignores: [
".next/**",
"node_modules/**",
"coverage/**",
".trunk/**",
"*.config.js",
"*.config.mjs",
"*.config.mts",
],
},
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
globals: {
React: "readonly",
JSX: "readonly",
console: "readonly",
process: "readonly",
Buffer: "readonly",
__dirname: "readonly",
__filename: "readonly",
module: "readonly",
require: "readonly",
setTimeout: "readonly",
clearTimeout: "readonly",
setInterval: "readonly",
clearInterval: "readonly",
fetch: "readonly",
Request: "readonly",
Response: "readonly",
URL: "readonly",
URLSearchParams: "readonly",
Headers: "readonly",
FormData: "readonly",
Blob: "readonly",
File: "readonly",
AbortController: "readonly",
AbortSignal: "readonly",
crypto: "readonly",
performance: "readonly",
structuredClone: "readonly",
atob: "readonly",
btoa: "readonly",
TextEncoder: "readonly",
TextDecoder: "readonly",
ReadableStream: "readonly",
WritableStream: "readonly",
TransformStream: "readonly",
queueMicrotask: "readonly",
globalThis: "readonly",
NodeJS: "readonly",
},
},
plugins: {
"@typescript-eslint": tseslint,
"react-hooks": reactHooks,
"@next/next": nextPlugin,
},
rules: {
...tseslint.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-require-imports": "off",
"no-unused-vars": "off",
"no-undef": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
},
},
{
files: ["**/*.{js,mjs,cjs}"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
console: "readonly",
process: "readonly",
Buffer: "readonly",
__dirname: "readonly",
__filename: "readonly",
module: "readonly",
require: "readonly",
exports: "readonly",
},
},
},
];