Last active
May 22, 2025 07:46
-
-
Save darktasevski/65cfc0f5cab0304a177bc3ad349d3e64 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { globalIgnores } from "eslint/config"; | |
| import globals from "globals"; | |
| import eslint from "@eslint/js"; | |
| import tseslint from "typescript-eslint"; | |
| import tsParser from "@typescript-eslint/parser"; | |
| import sonarjs from "eslint-plugin-sonarjs"; | |
| import reactPlugin from "eslint-plugin-react"; | |
| import * as reactHooks from "eslint-plugin-react-hooks"; | |
| import pluginSecurity from "eslint-plugin-security"; | |
| import importPlugin from "eslint-plugin-import"; | |
| import eslintConfigPrettier from "eslint-config-prettier/flat"; | |
| import jsxA11y from "eslint-plugin-jsx-a11y"; | |
| import pluginPromise from "eslint-plugin-promise"; | |
| import pluginJest from "eslint-plugin-jest"; | |
| import pluginjestDOM from "eslint-plugin-jest-dom"; | |
| import testingLibrary from "eslint-plugin-testing-library"; | |
| import playwright from "eslint-plugin-playwright"; | |
| export default tseslint.config( | |
| eslint.configs.recommended, | |
| pluginSecurity.configs.recommended, | |
| sonarjs.configs.recommended, | |
| pluginPromise.configs["flat/recommended"], | |
| eslintConfigPrettier, | |
| { | |
| files: ["**/*.{ts,tsx}"], | |
| extends: [ | |
| tseslint.configs.recommendedTypeChecked, | |
| tseslint.configs.stylisticTypeChecked, | |
| importPlugin.flatConfigs.recommended, | |
| importPlugin.flatConfigs.typescript, | |
| reactPlugin.configs.flat.recommended, | |
| reactPlugin.configs.flat["jsx-runtime"], | |
| reactHooks.configs["recommended-latest"], | |
| jsxA11y.flatConfigs.recommended, | |
| ], | |
| rules: { | |
| "import/no-duplicates": "error", | |
| "@typescript-eslint/ban-ts-comment": "off", | |
| "@typescript-eslint/no-unused-vars": [ | |
| 1, | |
| { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, | |
| ], | |
| }, | |
| }, | |
| { | |
| languageOptions: { | |
| globals: { | |
| ...globals.browser, | |
| ...globals.node, | |
| }, | |
| parser: tsParser, | |
| ecmaVersion: "latest", | |
| sourceType: "module", | |
| parserOptions: { | |
| projectService: true, | |
| tsconfigRootDir: import.meta.dirname, | |
| }, | |
| }, | |
| }, | |
| { | |
| files: ["**/*.test.{ts,tsx}"], | |
| languageOptions: { | |
| globals: pluginJest.environments.globals.globals, | |
| }, | |
| extends: [ | |
| pluginJest.configs["flat/recommended"], | |
| pluginjestDOM.configs["flat/recommended"], | |
| testingLibrary.configs["flat/react"], | |
| ], | |
| rules: { | |
| "sonarjs/no-clear-text-protocols": "off", | |
| "no-unused-expressions": "off", | |
| "@typescript-eslint/no-empty-function": "off", | |
| "@typescript-eslint/restrict-template-expressions": "off", | |
| "@typescript-eslint/no-non-null-assertion": "off", | |
| "@typescript-eslint/no-non-null-asserted-optional-chain": "off", | |
| "security/detect-non-literal-regexp": "off", | |
| "jest/valid-expect": "off", | |
| "jest/prefer-expect-assertions": "off", | |
| "jest/consistent-test-it": ["error", { fn: "test" }], | |
| "jest/prefer-lowercase-title": ["error", { ignore: ["describe"] }], | |
| "jest/no-hooks": "off", | |
| "jest/max-expects": "off", | |
| "jest/no-untyped-mock-factory": "off", | |
| }, | |
| }, | |
| { | |
| files: ["*.spec.ts"], | |
| ...playwright.configs["flat/recommended"], | |
| rules: { | |
| ...playwright.configs["flat/recommended"].rules, | |
| }, | |
| }, | |
| { | |
| rules: { | |
| "sonarjs/void-use": "off", | |
| "sonarjs/new-cap": "off", | |
| "sonarjs/no-nested-functions": "off", | |
| "sonarjs/pseudo-random": "off", | |
| "sonarjs/function-return-type": "off", | |
| "sonarjs/no-array-index-key": "off", | |
| "sonarjs/prefer-read-only-props": "off", | |
| "sonarjs/sonar-no-unused-vars": "off", | |
| }, | |
| }, | |
| { ignores: ["*", "!src"] }, | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment