2023-07-20 19:25:04 -04:00
|
|
|
{
|
2023-11-24 08:59:24 +11:00
|
|
|
"parser": "@typescript-eslint/parser",
|
|
|
|
"parserOptions": {
|
|
|
|
"project": "./tsconfig.json"
|
|
|
|
},
|
2023-07-21 12:48:23 -04:00
|
|
|
"plugins": [
|
2025-03-06 10:57:46 -08:00
|
|
|
"react-perf",
|
2024-06-24 11:45:40 -04:00
|
|
|
"css-modules",
|
2025-01-11 09:59:09 -05:00
|
|
|
"jest",
|
2025-01-13 09:30:14 -05:00
|
|
|
"jsx-a11y",
|
2025-01-11 09:59:09 -05:00
|
|
|
"react",
|
2025-01-13 09:30:14 -05:00
|
|
|
"react-hooks",
|
2024-06-24 11:45:40 -04:00
|
|
|
"suggest-no-throw",
|
2025-01-13 09:30:14 -05:00
|
|
|
"testing-library",
|
2025-01-11 09:59:09 -05:00
|
|
|
"@typescript-eslint"
|
2023-07-21 12:48:23 -04:00
|
|
|
],
|
2023-07-20 19:25:04 -04:00
|
|
|
"extends": [
|
2025-01-13 09:30:14 -05:00
|
|
|
"plugin:css-modules/recommended",
|
|
|
|
"plugin:jsx-a11y/recommended",
|
|
|
|
"plugin:react-hooks/recommended"
|
2023-07-20 19:25:04 -04:00
|
|
|
],
|
|
|
|
"rules": {
|
2025-03-28 00:24:24 -04:00
|
|
|
"no-array-constructor": "off", // This is wrong; use the @typescript-eslint one instead.
|
|
|
|
"@typescript-eslint/no-array-constructor": "error",
|
|
|
|
"@typescript-eslint/no-array-delete": "error",
|
|
|
|
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
|
|
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
2025-03-27 18:08:57 -04:00
|
|
|
"@typescript-eslint/no-empty-object-type": "error",
|
2025-04-01 13:21:31 -04:00
|
|
|
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
2024-09-09 18:17:45 -04:00
|
|
|
"@typescript-eslint/no-floating-promises": "error",
|
2025-04-01 13:21:31 -04:00
|
|
|
"@typescript-eslint/no-for-in-array": "error",
|
2025-03-28 00:24:24 -04:00
|
|
|
"no-implied-eval": "off", // This is wrong; use the @typescript-eslint one instead.
|
|
|
|
"@typescript-eslint/no-implied-eval": "error",
|
2025-04-01 13:21:31 -04:00
|
|
|
"@typescript-eslint/no-misused-new": "error",
|
2024-09-09 18:17:45 -04:00
|
|
|
"@typescript-eslint/no-misused-promises": "error",
|
2025-03-28 00:24:24 -04:00
|
|
|
"@typescript-eslint/no-namespace": "error",
|
2025-04-01 13:21:31 -04:00
|
|
|
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
|
|
"@typescript-eslint/no-redundant-type-constituents": "error",
|
|
|
|
"@typescript-eslint/no-this-alias": "warn",
|
2025-03-28 00:24:24 -04:00
|
|
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
|
|
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
|
|
|
"no-unused-vars": "off", // This is wrong; use the @typescript-eslint one instead.
|
2025-03-19 03:52:10 +11:00
|
|
|
"@typescript-eslint/no-unused-vars": ["error", {
|
|
|
|
"varsIgnorePattern": "^_",
|
|
|
|
"argsIgnorePattern": "^_",
|
|
|
|
"ignoreRestSiblings": true,
|
|
|
|
"vars": "all",
|
|
|
|
"args": "none"
|
|
|
|
}],
|
2025-04-01 13:21:31 -04:00
|
|
|
"@typescript-eslint/no-unsafe-unary-minus": "error",
|
|
|
|
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
|
|
"no-throw-literal": "off", // Use @typescript-eslint/only-throw-error instead.
|
|
|
|
"@typescript-eslint/only-throw-error": "error",
|
2025-03-28 00:24:24 -04:00
|
|
|
"@typescript-eslint/prefer-as-const": "warn",
|
2025-04-01 13:21:31 -04:00
|
|
|
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
|
|
"@typescript-eslint/restrict-plus-operands": "error",
|
2025-01-13 09:30:14 -05:00
|
|
|
"jsx-a11y/click-events-have-key-events": "off",
|
|
|
|
"jsx-a11y/no-autofocus": "off",
|
|
|
|
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
2025-01-11 00:28:12 -05:00
|
|
|
"no-restricted-globals": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"name": "isNaN",
|
|
|
|
"message": "Use Number.isNaN() instead."
|
2025-04-01 13:21:31 -04:00
|
|
|
}
|
2025-02-05 09:01:45 -05:00
|
|
|
],
|
|
|
|
"no-restricted-syntax": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"selector": "CallExpression[callee.object.name='Array'][callee.property.name='isArray']",
|
|
|
|
"message": "Use isArray() in lib/utils.ts instead of Array.isArray()."
|
2025-04-01 20:39:55 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"selector": "CallExpression[callee.object.name='TOML'][callee.property.name='stringify']",
|
|
|
|
"message": "Do not use TOML.stringify directly. Use the wrappers in test-utils instead like settingsToToml."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"selector": "CallExpression[callee.object.name='TOML'][callee.property.name='parse']",
|
|
|
|
"message": "Do not use TOML.parse directly. Use the wrappers in test-utils instead like tomlToSettings."
|
2025-01-11 00:28:12 -05:00
|
|
|
}
|
|
|
|
],
|
2023-07-20 19:25:04 -04:00
|
|
|
"semi": [
|
|
|
|
"error",
|
|
|
|
"never"
|
2023-11-11 13:27:12 -08:00
|
|
|
],
|
2023-11-24 08:59:24 +11:00
|
|
|
"react-hooks/exhaustive-deps": "off",
|
2025-04-01 13:21:31 -04:00
|
|
|
"suggest-no-throw/suggest-no-throw": "error"
|
2023-11-24 08:59:24 +11:00
|
|
|
},
|
|
|
|
"overrides": [
|
|
|
|
{
|
|
|
|
"files": ["e2e/**/*.ts"], // Update the pattern based on your file structure
|
2025-01-13 09:30:14 -05:00
|
|
|
"extends": [
|
|
|
|
"plugin:testing-library/react"
|
|
|
|
],
|
2023-11-24 08:59:24 +11:00
|
|
|
"rules": {
|
2024-08-19 15:36:18 -04:00
|
|
|
"suggest-no-throw/suggest-no-throw": "off",
|
2024-08-21 15:02:54 +10:00
|
|
|
"testing-library/prefer-screen-queries": "off",
|
|
|
|
"jest/valid-expect": "off"
|
2023-11-24 08:59:24 +11:00
|
|
|
}
|
2024-06-24 11:45:40 -04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"files": ["src/**/*.test.ts"],
|
2025-01-13 09:30:14 -05:00
|
|
|
"extends": [
|
|
|
|
"plugin:testing-library/react"
|
|
|
|
],
|
2024-06-24 11:45:40 -04:00
|
|
|
"rules": {
|
2025-04-01 13:21:31 -04:00
|
|
|
"suggest-no-throw/suggest-no-throw": "off"
|
2024-06-24 11:45:40 -04:00
|
|
|
}
|
2023-11-24 08:59:24 +11:00
|
|
|
}
|
|
|
|
]
|
2023-07-20 19:25:04 -04:00
|
|
|
}
|