monkeytype/.eslintrc.json

107 lines
2.9 KiB
JSON
Raw Normal View History

{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"globals": {
"$": "readonly",
"jQuery": "readonly",
"html2canvas": "readonly",
"ClipboardItem": "readonly",
"grecaptcha": "readonly"
},
"ignorePatterns": [
"backend/__tests__/**/*",
"backend/setup-tests.ts",
"backend/jest.config.ts",
"**/*.css",
"**/*.scss",
"frontend/static/js/*"
],
"extends": [
"eslint:recommended",
"plugin:json/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
2022-02-12 06:34:40 +08:00
"plugin:@typescript-eslint/eslint-recommended",
"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-12 06:34:40 +08:00
"plugins": ["json", "require-path-exists", "@typescript-eslint"],
"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"],
2022-02-12 06:34:40 +08:00
"@typescript-eslint/no-empty-function": "off",
2022-02-12 06:39:41 +08:00
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off",
2022-09-20 20:41:19 +08:00
// "@typescript-eslint/no-floating-promises": "error" // consider adding these
// "@typescript-eslint/strict-boolean-expressions": "warn",
// "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": {
2023-06-16 17:06:00 +08:00
// "@typescript-eslint/strict-boolean-expressions": [
// "error",
// {
// "allowString": false
// }
// ],
2022-02-12 06:34:40 +08:00
"@typescript-eslint/explicit-function-return-type": ["error"],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "error",
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": [
"error",
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",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": false
}
],
"@typescript-eslint/promise-function-async": "warn"
2023-06-16 23:13:50 +08:00
// "@typescript-eslint/no-unnecessary-condition": "error" TODO ADD THIS
},
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module",
"project": "**/tsconfig.json"
}
},
{
"files": ["backend/**/*.ts"],
"rules": {
"eqeqeq": "error"
}
2022-02-12 06:34:40 +08:00
}
]
}