2022-08-27 15:23:11 +05:00
|
|
|
module.exports = {
|
|
|
|
|
env: {
|
|
|
|
|
browser: true,
|
|
|
|
|
es2021: true,
|
2022-08-29 23:30:48 +05:00
|
|
|
node: true,
|
|
|
|
|
jest: true,
|
|
|
|
|
"jest/globals": true
|
2022-08-27 15:23:11 +05:00
|
|
|
},
|
|
|
|
|
extends: [
|
|
|
|
|
"eslint:recommended",
|
|
|
|
|
"plugin:react/recommended",
|
|
|
|
|
"plugin:@typescript-eslint/recommended",
|
2022-08-29 23:30:48 +05:00
|
|
|
"plugin:react/jsx-runtime",
|
|
|
|
|
"plugin:jest/style"
|
2022-08-27 15:23:11 +05:00
|
|
|
],
|
|
|
|
|
parser: "@typescript-eslint/parser",
|
|
|
|
|
parserOptions: {
|
|
|
|
|
ecmaFeatures: {
|
|
|
|
|
jsx: true
|
|
|
|
|
},
|
|
|
|
|
ecmaVersion: "latest",
|
|
|
|
|
sourceType: "module"
|
|
|
|
|
},
|
|
|
|
|
plugins: [
|
|
|
|
|
"react",
|
|
|
|
|
"@typescript-eslint",
|
|
|
|
|
"unused-imports",
|
|
|
|
|
"detox",
|
|
|
|
|
"jest",
|
2022-08-30 16:13:11 +05:00
|
|
|
"react-native",
|
|
|
|
|
"license-header",
|
|
|
|
|
"react-hooks"
|
2022-08-27 15:23:11 +05:00
|
|
|
],
|
|
|
|
|
rules: {
|
2022-08-30 16:13:11 +05:00
|
|
|
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
|
|
|
|
|
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
|
2022-08-27 15:23:11 +05:00
|
|
|
"no-unused-vars": "off",
|
|
|
|
|
"@typescript-eslint/no-unused-vars": "off",
|
|
|
|
|
"unused-imports/no-unused-imports": "error",
|
|
|
|
|
"unused-imports/no-unused-vars": [
|
|
|
|
|
"warn",
|
|
|
|
|
{
|
|
|
|
|
vars: "all",
|
|
|
|
|
varsIgnorePattern: "^_",
|
|
|
|
|
args: "after-used",
|
|
|
|
|
argsIgnorePattern: "^_"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"linebreak-style": ["error", "unix"],
|
2022-08-29 23:30:48 +05:00
|
|
|
"jest/no-mocks-import": 0,
|
|
|
|
|
"@typescript-eslint/no-var-requires": 0,
|
2022-08-27 15:23:11 +05:00
|
|
|
quotes: [
|
|
|
|
|
"error",
|
|
|
|
|
"double",
|
|
|
|
|
{ avoidEscape: true, allowTemplateLiterals: true }
|
|
|
|
|
],
|
|
|
|
|
semi: ["error", "always"],
|
|
|
|
|
"@typescript-eslint/no-empty-function": "off",
|
2022-08-30 16:13:11 +05:00
|
|
|
"react/prop-types": "off",
|
|
|
|
|
"license-header/header": ["error", "./resources/license-header.js"]
|
2022-08-27 15:23:11 +05:00
|
|
|
},
|
|
|
|
|
settings: {
|
|
|
|
|
react: {
|
|
|
|
|
version: "17"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
overrides: [
|
2022-08-30 16:13:11 +05:00
|
|
|
{
|
|
|
|
|
files: ["apps/web/__e2e__/**/**/*.{jsx,tsx,ts,js}"],
|
|
|
|
|
rules: { "react-hooks/rules-of-hooks": "off" }
|
|
|
|
|
},
|
2022-08-27 15:23:11 +05:00
|
|
|
{
|
|
|
|
|
files: ["apps/mobile/**/**/*.{jsx,tsx,ts,js}"],
|
|
|
|
|
env: {
|
|
|
|
|
"react-native/react-native": true,
|
|
|
|
|
es2021: true,
|
|
|
|
|
browser: true,
|
|
|
|
|
"detox/detox": true
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
// TODO: remove this gradually
|
2022-08-29 16:19:17 +05:00
|
|
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
|
|
|
"react/react-in-jsx-scope": 2,
|
|
|
|
|
"react/jsx-uses-react": 2
|
2022-08-27 15:23:11 +05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|