mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 17:00:16 +00:00
522413678a
## Description: - Fixes #1790 - Fixed the codebase: - expressions short-circuiting with `&&` changed to proper `if` statements - `A instanceof B;` expressions now emit warnings ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: michal7952 --------- Co-authored-by: Evan <evanpelle@gmail.com>
62 lines
1.7 KiB
JavaScript
62 lines
1.7 KiB
JavaScript
import { includeIgnoreFile } from "@eslint/compat";
|
|
import pluginJs from "@eslint/js";
|
|
import eslintConfigPrettier from "eslint-config-prettier/flat";
|
|
import globals from "globals";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import tseslint from "typescript-eslint";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
const gitignorePath = path.resolve(__dirname, ".gitignore");
|
|
|
|
/** @type {import('eslint').Linter.Config[]} */
|
|
export default [
|
|
includeIgnoreFile(gitignorePath),
|
|
{ ignores: ["src/server/gatekeeper/**"] },
|
|
{ files: ["**/*.{js,mjs,cjs,ts}"] },
|
|
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
|
|
pluginJs.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
eslintConfigPrettier,
|
|
{
|
|
languageOptions: {
|
|
parserOptions: {
|
|
projectService: {
|
|
allowDefaultProject: [
|
|
"__mocks__/fileMock.js",
|
|
"eslint.config.js",
|
|
"jest.config.ts",
|
|
"postcss.config.js",
|
|
"tailwind.config.js",
|
|
"webpack.config.js",
|
|
],
|
|
},
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
rules: {
|
|
// Disable rules that would fail. The failures should be fixed, and the entries here removed.
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
"no-unused-vars": "off",
|
|
},
|
|
},
|
|
{
|
|
rules: {
|
|
// Enable rules
|
|
"@typescript-eslint/prefer-nullish-coalescing": "error",
|
|
eqeqeq: "error",
|
|
"no-case-declarations": "error",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{
|
|
args: "none",
|
|
caughtErrors: "none",
|
|
},
|
|
],
|
|
},
|
|
},
|
|
];
|