mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-18 16:53:16 +00:00
84 lines
2.3 KiB
JavaScript
84 lines
2.3 KiB
JavaScript
import { defineConfig, globalIgnores } from "eslint/config";
|
|
import react from "eslint-plugin-react";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
|
import prettier from "eslint-plugin-prettier";
|
|
import { fixupPluginRules } from "@eslint/compat";
|
|
import globals from "globals";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import js from "@eslint/js";
|
|
import { FlatCompat } from "@eslint/eslintrc";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
const compat = new FlatCompat({
|
|
baseDirectory: __dirname,
|
|
recommendedConfig: js.configs.recommended,
|
|
allConfig: js.configs.all
|
|
});
|
|
|
|
export default defineConfig([globalIgnores(["**/index.js", "**/PaymentMethods/Icons/code/code.js"]), {
|
|
extends: compat.extends(
|
|
"eslint:recommended",
|
|
"plugin:react/recommended",
|
|
'plugin:@typescript-eslint/recommended',
|
|
"prettier",
|
|
),
|
|
|
|
plugins: {
|
|
react,
|
|
"react-hooks": fixupPluginRules(reactHooks),
|
|
"@typescript-eslint": typescriptEslint,
|
|
prettier,
|
|
},
|
|
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.jest,
|
|
...globals.node,
|
|
},
|
|
|
|
ecmaVersion: "latest",
|
|
sourceType: "module",
|
|
|
|
parserOptions: {
|
|
ecmaVersion: 2020,
|
|
sourceType: 'module',
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
},
|
|
|
|
project: "./tsconfig.json",
|
|
},
|
|
},
|
|
|
|
settings: {
|
|
"import/resolver": {
|
|
typescript: {},
|
|
},
|
|
|
|
react: {
|
|
version: "detect",
|
|
},
|
|
},
|
|
|
|
rules: {
|
|
"react-hooks/rules-of-hooks": "error",
|
|
"react-hooks/exhaustive-deps": "off",
|
|
"react/prop-types": "off",
|
|
"react/react-in-jsx-scope": "off",
|
|
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
|
|
"@typescript-eslint/naming-convention": ["error", {
|
|
selector: "variableLike",
|
|
format: ["camelCase", "snake_case", "PascalCase", "UPPER_CASE"],
|
|
leadingUnderscore: "allow",
|
|
}],
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' }
|
|
],
|
|
},
|
|
}]); |