mattermost-mobile/eslint.config.mjs
Elias Nahum 374f812b98
Update dependencies (#8721)
* update fastlane

* update dev dependencies

* update to eslint 9+

* update testing-library

* update react-intl

* update bottom-sheet

* update expo

* update reanimated

* upgrade msgpack

* upgrade datepicker

* upgrade react-navigation

* update sentry

* update FlasList

* update fuse.js moment-timezone node-html-parser and semver

* update gesture-handler

* update image-picker

* update react-native-keychain

* update react-native-localize

* update react-native-navigation

* update watermelonDB

* update react-native-permissions

* update react-native-safe-area-context and react-native-screens

* update react-native-share and react-native-svg

* update react-native-video and react-native-webrtc

* update @mattermost/rnutils

* update @mattermost/rnshare

* update @mattermost/hardware-keyboard

* fix isMainActivity

* update android dependencies

* fix upload file progress indicator

* fix entry update config & license

* revert to stable version of @sentry/react-native

* update react-intl again

* update moment-timezone

* upgrade @react-native-camera-roll/camera-roll

* update @react-native-clipboard/clipboard

* update @react-navigation again

* update @shopify/flash-list

* update eslint

* update expo again

* update html-entities

* update mime-db

* update react-native-permissions

* Revert "update react-intl again"

This reverts commit e8e6d5a60dfa56b82b810cbbd7cdffec7697ffc7.

* Revert "update react-intl"

This reverts commit c77f329bb38910aeeba03869b72d77a8b0e00ba1.

* update react-native-keychain

* update and patch react-intl

* mend

* feedback during review 1
2025-04-07 09:30:06 +08:00

143 lines
4 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {defineConfig, globalIgnores} from 'eslint/config';
import tseslint from "@typescript-eslint/eslint-plugin";
import * as tsparser from "@typescript-eslint/parser";
import importPlugin from "eslint-plugin-import";
import reactHooks from "eslint-plugin-react-hooks";
import stylisticTs from "@stylistic/eslint-plugin-ts";
// Load custom rulesets
import eslintMattermost, {jestConfig} from "./eslint/eslint-mattermost.mjs";
import eslintReact from "./eslint/eslint-react.mjs";
export default defineConfig([
globalIgnores([
"node_modules/",
"dist/",
"build/",
"coverage/",
"android/",
"ios/",
".github/",
"detox/artifacts/",
]),
eslintMattermost,
jestConfig,
eslintReact,
{
files: ["**/*.{js,jsx,ts,tsx}"],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: "latest",
ecmaFeatures: {
jsx: true
}
},
globals: {
__DEV__: true
},
sourceType: "module"
},
plugins: {
"@stylistic/ts": stylisticTs,
"@typescript-eslint": tseslint,
"import": importPlugin,
"react-hooks": reactHooks
},
settings: {
react: {
pragma: "React",
version: "detect"
}
},
rules: {
"eol-last": ["error", "always"],
"global-require": "off",
"no-undefined": "off",
"no-shadow": "off",
"react/display-name": [2, { "ignoreTranspilerName": false }],
"react/jsx-filename-extension": "off",
"react-hooks/exhaustive-deps": "warn",
"camelcase": ["off", { "properties": "never" }],
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
2,
{
vars: "all",
args: "after-used",
caughtErrors: "none",
ignoreRestSiblings: true,
}
],
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/no-explicit-any": "warn",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-underscore-dangle": "off",
"indent": [2, 4, { "SwitchCase": 1 }],
"key-spacing": [
2,
{
"singleLine": {
"beforeColon": false,
"afterColon": true
}
}
],
"@stylistic/ts/member-delimiter-style": 2,
"@typescript-eslint/no-unsafe-declaration-merging": "off",
"import/order": [
2,
{
"groups": ["builtin", "external", "parent", "sibling", "index", "type"],
"newlines-between": "always",
"pathGroups": [
{
"pattern": "{@(@actions|@app|@assets|@calls|@client|@components|@constants|@context|@database|@helpers|@hooks|@init|@managers|@queries|@screens|@selectors|@share|@store|@telemetry|@typings|@test|@utils)/**,@(@constants|@i18n|@store|@websocket)}",
"group": "external",
"position": "after"
},
{
"pattern": "app/**",
"group": "parent",
"position": "before"
}
],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
"pathGroupsExcludedImportTypes": ["type"]
}
]
}
},
{
files: ["detox/e2e/**"],
languageOptions: {
globals: {
by: true,
detox: true,
device: true,
element: true,
waitFor: true
}
},
rules: {
"func-names": "off",
"import/no-unresolved": "off",
"max-nested-callbacks": "off",
"no-process-env": "off",
"no-unused-expressions": "off"
}
}
]);