2022-02-07 07:25:13 +08:00
|
|
|
{
|
|
|
|
"env": {
|
|
|
|
"browser": true,
|
|
|
|
"es2021": true,
|
|
|
|
"node": true
|
|
|
|
},
|
|
|
|
"globals": {
|
|
|
|
"$": "readonly",
|
|
|
|
"jQuery": "readonly",
|
|
|
|
"html2canvas": "readonly",
|
|
|
|
"ClipboardItem": "readonly",
|
|
|
|
"grecaptcha": "readonly"
|
|
|
|
},
|
2022-09-20 20:16:12 +08:00
|
|
|
"ignorePatterns": [
|
|
|
|
"backend/__tests__/**/*",
|
2023-08-17 17:13:56 +08:00
|
|
|
"backend/jest.config.ts",
|
|
|
|
"**/*.css",
|
2023-09-21 20:06:11 +08:00
|
|
|
"**/*.scss",
|
2024-01-08 22:26:57 +08:00
|
|
|
"frontend/static/js/*",
|
|
|
|
"frontend/__tests__/**/*",
|
|
|
|
"frontend/jest.config.ts"
|
2022-09-20 20:16:12 +08:00
|
|
|
],
|
2022-02-07 07:25:13 +08:00
|
|
|
"extends": [
|
|
|
|
"eslint:recommended",
|
|
|
|
"plugin:json/recommended",
|
2023-11-09 22:03:56 +08:00
|
|
|
"plugin:import/recommended",
|
|
|
|
"plugin:import/typescript",
|
2022-02-12 06:34:40 +08:00
|
|
|
"plugin:@typescript-eslint/eslint-recommended",
|
2023-11-17 22:44:01 +08:00
|
|
|
"plugin:@typescript-eslint/recommended",
|
|
|
|
"prettier"
|
2023-06-16 17:06:00 +08:00
|
|
|
// "plugin:@typescript-eslint/recommended-requiring-type-checking"
|
|
|
|
// "plugin:@typescript-eslint/strict"
|
2022-02-07 07:25:13 +08:00
|
|
|
],
|
2022-02-12 06:34:40 +08:00
|
|
|
"plugins": ["json", "require-path-exists", "@typescript-eslint"],
|
2022-02-07 07:25:13 +08:00
|
|
|
"rules": {
|
|
|
|
"json/*": ["error"],
|
2022-02-12 21:47:36 +08:00
|
|
|
"indent": ["off"],
|
2022-02-07 07:30:04 +08:00
|
|
|
"no-empty": ["error", { "allowEmptyCatch": true }],
|
2022-02-12 06:34:40 +08:00
|
|
|
"no-var": 2,
|
2022-09-27 21:49:02 +08:00
|
|
|
"no-duplicate-imports": ["error"],
|
2023-11-09 22:03:56 +08:00
|
|
|
// "import/default": "off",
|
|
|
|
"import/no-unresolved": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"ignore": ["^./constants/firebase-config$"]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"import/no-duplicates": "off"
|
|
|
|
},
|
|
|
|
"settings": {
|
|
|
|
"import/resolver": {
|
|
|
|
"typescript": {
|
|
|
|
"alwaysTryTypes": true,
|
|
|
|
"project": ["frontend/tsconfig.json", "backend/tsconfig.json"]
|
|
|
|
},
|
|
|
|
"node": true
|
|
|
|
}
|
2022-02-12 06:34:40 +08:00
|
|
|
},
|
|
|
|
"overrides": [
|
|
|
|
{
|
|
|
|
// enable the rule specifically for TypeScript files
|
|
|
|
"files": ["*.ts", "*.tsx"],
|
|
|
|
"rules": {
|
|
|
|
"@typescript-eslint/explicit-function-return-type": ["error"],
|
|
|
|
"@typescript-eslint/ban-ts-comment": "off",
|
2024-02-06 21:18:27 +08:00
|
|
|
"@typescript-eslint/no-empty-function": "warn",
|
2022-05-06 02:05:31 +08:00
|
|
|
"no-unused-vars": "off",
|
2022-02-23 05:39:26 +08:00
|
|
|
"@typescript-eslint/no-unused-vars": [
|
2024-02-06 21:18:27 +08:00
|
|
|
"warn",
|
2022-05-06 02:05:31 +08:00
|
|
|
{ "argsIgnorePattern": "^(_|e|event)", "varsIgnorePattern": "^_" }
|
2022-02-23 05:39:26 +08:00
|
|
|
],
|
2022-04-24 08:05:11 +08:00
|
|
|
"@typescript-eslint/no-var-requires": "error",
|
2022-09-22 19:56:10 +08:00
|
|
|
"@typescript-eslint/no-this-alias": "off",
|
|
|
|
"@typescript-eslint/no-misused-promises": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"checksVoidReturn": false
|
|
|
|
}
|
|
|
|
],
|
2024-02-06 21:18:27 +08:00
|
|
|
"@typescript-eslint/promise-function-async": "warn",
|
|
|
|
// "@typescript-eslint/no-floating-promises": "error", // consider adding this
|
|
|
|
"@typescript-eslint/strict-boolean-expressions": [
|
|
|
|
"error",
|
|
|
|
{ "allowNullableBoolean": true, "allowNullableNumber": true }
|
|
|
|
]
|
2023-06-16 23:13:50 +08:00
|
|
|
// "@typescript-eslint/no-unnecessary-condition": "error" TODO ADD THIS
|
2022-09-22 19:56:10 +08:00
|
|
|
},
|
|
|
|
"parserOptions": {
|
|
|
|
"ecmaVersion": 12,
|
|
|
|
"sourceType": "module",
|
2023-02-26 05:33:09 +08:00
|
|
|
"project": "**/tsconfig.json"
|
2022-02-07 07:25:13 +08:00
|
|
|
}
|
2023-03-20 19:11:21 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"files": ["backend/**/*.ts"],
|
|
|
|
"rules": {
|
|
|
|
"eqeqeq": "error"
|
|
|
|
}
|
2022-02-12 06:34:40 +08:00
|
|
|
}
|
|
|
|
]
|
2022-02-07 07:25:13 +08:00
|
|
|
}
|