mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-10 17:04:49 +08:00
6aa7a72727
* test: configure testing for frontend code * remove test coverage thresholds, cleanup
110 lines
3 KiB
JSON
110 lines
3 KiB
JSON
{
|
|
"env": {
|
|
"browser": true,
|
|
"es2021": true,
|
|
"node": true
|
|
},
|
|
"globals": {
|
|
"$": "readonly",
|
|
"jQuery": "readonly",
|
|
"html2canvas": "readonly",
|
|
"ClipboardItem": "readonly",
|
|
"grecaptcha": "readonly"
|
|
},
|
|
"ignorePatterns": [
|
|
"backend/__tests__/**/*",
|
|
"backend/jest.config.ts",
|
|
"**/*.css",
|
|
"**/*.scss",
|
|
"frontend/static/js/*",
|
|
"frontend/__tests__/**/*",
|
|
"frontend/jest.config.ts"
|
|
],
|
|
"extends": [
|
|
"eslint:recommended",
|
|
"plugin:json/recommended",
|
|
"plugin:import/recommended",
|
|
"plugin:import/typescript",
|
|
"plugin:@typescript-eslint/eslint-recommended",
|
|
"plugin:@typescript-eslint/recommended",
|
|
"prettier"
|
|
// "plugin:@typescript-eslint/recommended-requiring-type-checking"
|
|
// "plugin:@typescript-eslint/strict"
|
|
],
|
|
"plugins": ["json", "require-path-exists", "@typescript-eslint"],
|
|
"rules": {
|
|
"json/*": ["error"],
|
|
"indent": ["off"],
|
|
"no-empty": ["error", { "allowEmptyCatch": true }],
|
|
"no-var": 2,
|
|
"no-duplicate-imports": ["error"],
|
|
"@typescript-eslint/no-empty-function": "off",
|
|
"@typescript-eslint/no-unused-vars": "off",
|
|
"@typescript-eslint/no-var-requires": "off",
|
|
// "@typescript-eslint/no-floating-promises": "error", // consider adding these
|
|
// "@typescript-eslint/strict-boolean-expressions": [
|
|
// "warn",
|
|
// { "allowNullableBoolean": true }
|
|
// ],
|
|
// "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
|
|
}
|
|
},
|
|
"overrides": [
|
|
{
|
|
// enable the rule specifically for TypeScript files
|
|
"files": ["*.ts", "*.tsx"],
|
|
"rules": {
|
|
// "@typescript-eslint/strict-boolean-expressions": [
|
|
// "error",
|
|
// {
|
|
// "allowString": false
|
|
// }
|
|
// ],
|
|
"@typescript-eslint/explicit-function-return-type": ["error"],
|
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
"@typescript-eslint/no-empty-function": "error",
|
|
"no-unused-vars": "off",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{ "argsIgnorePattern": "^(_|e|event)", "varsIgnorePattern": "^_" }
|
|
],
|
|
"@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"
|
|
// "@typescript-eslint/no-unnecessary-condition": "error" TODO ADD THIS
|
|
},
|
|
"parserOptions": {
|
|
"ecmaVersion": 12,
|
|
"sourceType": "module",
|
|
"project": "**/tsconfig.json"
|
|
}
|
|
},
|
|
{
|
|
"files": ["backend/**/*.ts"],
|
|
"rules": {
|
|
"eqeqeq": "error"
|
|
}
|
|
}
|
|
]
|
|
}
|