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
68 changes: 68 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import react from "eslint-plugin-react";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import jest from "eslint-plugin-jest";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
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 [...compat.extends(
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:jest/recommended",
).map(config => ({
...config,
})), {
plugins: {
react,
"@typescript-eslint": typescriptEslint,
jest,
},

languageOptions: {
globals: {
...globals.browser,
...globals.jest,
unlayer: "readonly",
},

parser: tsParser,
ecmaVersion: 12,
sourceType: "module",

parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},

settings: {
react: {
version: "detect",
},
},

rules: {
"prefer-const": "error",
"no-use-before-define": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
"prettier/prettier": "off",
"react/prop-types": "off",
"jest/valid-title": "off",
},
}];
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dotenv": "16.4.7",
"dotenv-flow-webpack": "2.0.0",
"eclint": "2.8.1",
"eslint": "8.57.1",
"eslint": "9.17.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-jest": "28.9.0",
"eslint-plugin-prettier": "5.2.1",
Expand Down Expand Up @@ -84,7 +84,7 @@
"fix-format": "yarn prettier-fix && yarn eclint-fix",
"eclint-fix": "eclint fix",
"eclint-check": "eclint check",
"eslint-check": "eslint --ext .ts --ext .tsx .",
"eslint-check": "eslint . --ext .ts --ext .tsx",
"prettier-fix": "prettier --write \"**/**\"",
"prettier-check": "prettier --check \"**/**\""
},
Expand Down
Loading