2018-03-17 18:36:42 +01:00
|
|
|
{
|
2021-07-18 14:56:59 +02:00
|
|
|
"parser": "@typescript-eslint/parser",
|
2018-03-17 19:43:34 +01:00
|
|
|
"plugins": [
|
2021-07-18 14:56:59 +02:00
|
|
|
"@typescript-eslint",
|
2024-04-09 22:42:42 +02:00
|
|
|
"react-native", // for no-inline-styles rule
|
2020-06-01 14:54:23 +02:00
|
|
|
],
|
|
|
|
"extends": [
|
|
|
|
"standard",
|
|
|
|
"standard-react",
|
2021-05-08 08:41:45 +02:00
|
|
|
"standard-jsx",
|
2020-06-01 14:54:23 +02:00
|
|
|
"plugin:react-hooks/recommended",
|
2021-05-08 08:41:45 +02:00
|
|
|
"plugin:react/recommended",
|
2021-07-18 14:56:59 +02:00
|
|
|
"plugin:@typescript-eslint/recommended",
|
2023-12-18 16:21:42 +01:00
|
|
|
"@react-native",
|
2021-07-18 14:56:59 +02:00
|
|
|
"plugin:prettier/recommended" // removes all eslint rules that can mess up with prettier
|
2018-03-17 19:43:34 +01:00
|
|
|
],
|
2018-03-17 21:39:21 +01:00
|
|
|
"rules": {
|
2020-06-01 14:54:23 +02:00
|
|
|
"react/jsx-handler-names": "off", // activated by standard-react config
|
2021-05-08 08:41:45 +02:00
|
|
|
"react/display-name": "off",
|
2020-06-01 14:54:23 +02:00
|
|
|
"react-native/no-inline-styles": "error",
|
2022-01-28 13:16:47 +01:00
|
|
|
"react-native/no-unused-styles": "error",
|
2024-09-13 01:38:09 +02:00
|
|
|
"react/no-is-mounted": "off",
|
2022-01-28 13:16:47 +01:00
|
|
|
"react-native/no-single-element-style-arrays": "error",
|
2020-06-01 14:54:23 +02:00
|
|
|
"prettier/prettier": [
|
|
|
|
"warn",
|
2018-03-17 21:39:21 +01:00
|
|
|
{
|
2020-06-01 14:54:23 +02:00
|
|
|
"singleQuote": true,
|
|
|
|
"printWidth": 140,
|
|
|
|
"trailingComma": "all",
|
|
|
|
"arrowParens": "avoid"
|
2018-03-20 01:49:32 +01:00
|
|
|
}
|
2021-07-18 14:56:59 +02:00
|
|
|
],
|
|
|
|
"@typescript-eslint/no-empty-function": "off", // used often in the codebase, useful e.g. in testing
|
|
|
|
"@typescript-eslint/ban-ts-comment": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"ts-expect-error": "allow-with-description",
|
|
|
|
"ts-ignore": "allow-with-description", // temporary allow to ease the migration
|
|
|
|
"ts-nocheck": true,
|
|
|
|
"ts-check": false
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],
|
|
|
|
|
|
|
|
// disable rules that are superseded by @typescript-eslint rules
|
|
|
|
"no-unused-vars": "off",
|
|
|
|
"no-use-before-define": "off",
|
|
|
|
|
|
|
|
// disable rules that we want to enforce only for typescript files
|
|
|
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
|
|
"@typescript-eslint/no-var-requires": "off",
|
2021-09-09 13:00:11 +02:00
|
|
|
"@typescript-eslint/no-this-alias": "off",
|
2024-04-09 22:42:42 +02:00
|
|
|
"@typescript-eslint/no-use-before-define": "off",
|
2018-10-20 23:10:21 +02:00
|
|
|
},
|
2021-07-18 14:56:59 +02:00
|
|
|
"overrides": [
|
|
|
|
{
|
|
|
|
// enable the rule specifically for TypeScript files
|
|
|
|
"files": ["*.ts", "*.tsx"],
|
|
|
|
"rules": {
|
2021-09-09 13:00:11 +02:00
|
|
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
|
|
"@typescript-eslint/no-this-alias": "off",
|
|
|
|
"@typescript-eslint/no-var-requires": "off",
|
|
|
|
"@typescript-eslint/no-inferrable-types": "off",
|
2021-07-18 14:56:59 +02:00
|
|
|
"@typescript-eslint/no-use-before-define": ["error", { "variables": false }]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"env": {
|
2018-10-20 23:10:21 +02:00
|
|
|
"es6": true
|
|
|
|
},
|
2022-10-31 13:25:26 +01:00
|
|
|
"globals": { "fetch": false },
|
|
|
|
"settings": {
|
|
|
|
"react": { // this is for eslint-plugin-react
|
|
|
|
"version": "detect" // React version. "detect" automatically picks the version you have installed.
|
|
|
|
}
|
|
|
|
}
|
2018-03-17 18:36:42 +01:00
|
|
|
}
|