monkeytype/packages/eslint-config/index.js

151 lines
4.5 KiB
JavaScript
Raw Normal View History

refactor: restructure project to a true monorepo (#5626) * split ts files * packages * nomore workspace? * blah * build, exports * declaration * blargh * turrrrbo * fix fontawesome paths * allow file in eslint, fix ts errors * optimise package, update tsconfig * fix ts * update turbo config * eslint split * fix imports * fix types * lock * add turbo task * script * test task * pretty scripts * update prettier ignore * no cache for tests * lint task * turbo * no out * depend on env * fix mono breaking things * odl * fix version dependency of mongodb-memory-server * Revert "fix version dependency of mongodb-memory-server" This reverts commit 52ffac47b14ba398c0ce018ba963fd06f11b58fb. * update vitest-mongodb * release scripts * update ci * update dev script * ignore issues around firebase config * add check ts tasks * import isaxioserror * shared types package * replace tsnodedev with tsx * fix import * shared types * module * backend imports * declaration * node version * test code * assert json * verbatim * type * lodash * ts ver * fix fix fix? * remove assert * remove module and resolution * cleanup * tsconfig * fix frontend * remove unecessary props * more unused * remove skiplib * declaration map, dev script * remove install scripts * fix regex * move shared types to package * dont include shared types * remove path * update scripts * test code * test code * fix backend types * fully fix backend * fix frontend d.ts * add .js to imports * remove module * revert add .js * update tsconfig * use bundler module resolution * almost all frontend types * mooore * date fns * fix backend docker * fix ape keys * fix type * clean rimraf type * fix shared-types in workspace * fix import resolving * fix docker builds * ignore type problems on slim-select until new version is released * turrrrbo * fix npm ci * fix lint task * expose env variables needed by frontend build * fix dependencies * package-lock * backend watch ts and lint * add fe and be build scripts to root * fix dev not building packages * shared-types missing eslint * move shared types back to dev-deps * add packages to labeler * add packages step to ci * typo * filter update * remove concurrently from root * add scripts * abbreviate * rename * yeet * fixed path * test pkg * consistent ordering * rename * Revert "backend imports" This reverts commit d7151988290a9692ea7b0942feeaaff5d2da8224. * fix missing imports, remove last .js * remove test package --------- Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2024-07-22 21:08:11 +08:00
/** @type {import("eslint").Linter.Config} */
module.exports = {
env: {
node: true,
},
parser: "@typescript-eslint/parser",
ignorePatterns: [
// Ignore dotfiles
".*.js",
"node_modules/",
"dist/",
"build/",
],
extends: [
"eslint:recommended",
"plugin:json/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"prettier",
],
plugins: ["json", "require-path-exists", "@typescript-eslint"],
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
},
rules: {
"json/*": ["error"],
indent: ["off"],
"no-empty": ["error", { allowEmptyCatch: true }],
"no-var": 2,
"no-duplicate-imports": ["error"],
2024-08-01 02:23:30 +08:00
"no-constant-condition": ["error"],
"no-constant-binary-expression": "error",
"no-unused-vars": [
"error",
{
argsIgnorePattern: "^(_|e|event)",
caughtErrorsIgnorePattern: "^(_|e|error)",
varsIgnorePattern: "^_",
},
],
refactor: restructure project to a true monorepo (#5626) * split ts files * packages * nomore workspace? * blah * build, exports * declaration * blargh * turrrrbo * fix fontawesome paths * allow file in eslint, fix ts errors * optimise package, update tsconfig * fix ts * update turbo config * eslint split * fix imports * fix types * lock * add turbo task * script * test task * pretty scripts * update prettier ignore * no cache for tests * lint task * turbo * no out * depend on env * fix mono breaking things * odl * fix version dependency of mongodb-memory-server * Revert "fix version dependency of mongodb-memory-server" This reverts commit 52ffac47b14ba398c0ce018ba963fd06f11b58fb. * update vitest-mongodb * release scripts * update ci * update dev script * ignore issues around firebase config * add check ts tasks * import isaxioserror * shared types package * replace tsnodedev with tsx * fix import * shared types * module * backend imports * declaration * node version * test code * assert json * verbatim * type * lodash * ts ver * fix fix fix? * remove assert * remove module and resolution * cleanup * tsconfig * fix frontend * remove unecessary props * more unused * remove skiplib * declaration map, dev script * remove install scripts * fix regex * move shared types to package * dont include shared types * remove path * update scripts * test code * test code * fix backend types * fully fix backend * fix frontend d.ts * add .js to imports * remove module * revert add .js * update tsconfig * use bundler module resolution * almost all frontend types * mooore * date fns * fix backend docker * fix ape keys * fix type * clean rimraf type * fix shared-types in workspace * fix import resolving * fix docker builds * ignore type problems on slim-select until new version is released * turrrrbo * fix npm ci * fix lint task * expose env variables needed by frontend build * fix dependencies * package-lock * backend watch ts and lint * add fe and be build scripts to root * fix dev not building packages * shared-types missing eslint * move shared types back to dev-deps * add packages to labeler * add packages step to ci * typo * filter update * remove concurrently from root * add scripts * abbreviate * rename * yeet * fixed path * test pkg * consistent ordering * rename * Revert "backend imports" This reverts commit d7151988290a9692ea7b0942feeaaff5d2da8224. * fix missing imports, remove last .js * remove test package --------- Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2024-07-22 21:08:11 +08:00
"import/no-duplicates": "off",
"import/no-unresolved": [
"error",
{
ignore: ["^@monkeytype/"],
},
],
refactor: restructure project to a true monorepo (#5626) * split ts files * packages * nomore workspace? * blah * build, exports * declaration * blargh * turrrrbo * fix fontawesome paths * allow file in eslint, fix ts errors * optimise package, update tsconfig * fix ts * update turbo config * eslint split * fix imports * fix types * lock * add turbo task * script * test task * pretty scripts * update prettier ignore * no cache for tests * lint task * turbo * no out * depend on env * fix mono breaking things * odl * fix version dependency of mongodb-memory-server * Revert "fix version dependency of mongodb-memory-server" This reverts commit 52ffac47b14ba398c0ce018ba963fd06f11b58fb. * update vitest-mongodb * release scripts * update ci * update dev script * ignore issues around firebase config * add check ts tasks * import isaxioserror * shared types package * replace tsnodedev with tsx * fix import * shared types * module * backend imports * declaration * node version * test code * assert json * verbatim * type * lodash * ts ver * fix fix fix? * remove assert * remove module and resolution * cleanup * tsconfig * fix frontend * remove unecessary props * more unused * remove skiplib * declaration map, dev script * remove install scripts * fix regex * move shared types to package * dont include shared types * remove path * update scripts * test code * test code * fix backend types * fully fix backend * fix frontend d.ts * add .js to imports * remove module * revert add .js * update tsconfig * use bundler module resolution * almost all frontend types * mooore * date fns * fix backend docker * fix ape keys * fix type * clean rimraf type * fix shared-types in workspace * fix import resolving * fix docker builds * ignore type problems on slim-select until new version is released * turrrrbo * fix npm ci * fix lint task * expose env variables needed by frontend build * fix dependencies * package-lock * backend watch ts and lint * add fe and be build scripts to root * fix dev not building packages * shared-types missing eslint * move shared types back to dev-deps * add packages to labeler * add packages step to ci * typo * filter update * remove concurrently from root * add scripts * abbreviate * rename * yeet * fixed path * test pkg * consistent ordering * rename * Revert "backend imports" This reverts commit d7151988290a9692ea7b0942feeaaff5d2da8224. * fix missing imports, remove last .js * remove test package --------- Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2024-07-22 21:08:11 +08:00
"no-mixed-operators": [
"error",
{
groups: [["+", "??"]],
},
],
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ["*.ts", "*.tsx"],
extends: [
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/strict-type-checked",
refactor: restructure project to a true monorepo (#5626) * split ts files * packages * nomore workspace? * blah * build, exports * declaration * blargh * turrrrbo * fix fontawesome paths * allow file in eslint, fix ts errors * optimise package, update tsconfig * fix ts * update turbo config * eslint split * fix imports * fix types * lock * add turbo task * script * test task * pretty scripts * update prettier ignore * no cache for tests * lint task * turbo * no out * depend on env * fix mono breaking things * odl * fix version dependency of mongodb-memory-server * Revert "fix version dependency of mongodb-memory-server" This reverts commit 52ffac47b14ba398c0ce018ba963fd06f11b58fb. * update vitest-mongodb * release scripts * update ci * update dev script * ignore issues around firebase config * add check ts tasks * import isaxioserror * shared types package * replace tsnodedev with tsx * fix import * shared types * module * backend imports * declaration * node version * test code * assert json * verbatim * type * lodash * ts ver * fix fix fix? * remove assert * remove module and resolution * cleanup * tsconfig * fix frontend * remove unecessary props * more unused * remove skiplib * declaration map, dev script * remove install scripts * fix regex * move shared types to package * dont include shared types * remove path * update scripts * test code * test code * fix backend types * fully fix backend * fix frontend d.ts * add .js to imports * remove module * revert add .js * update tsconfig * use bundler module resolution * almost all frontend types * mooore * date fns * fix backend docker * fix ape keys * fix type * clean rimraf type * fix shared-types in workspace * fix import resolving * fix docker builds * ignore type problems on slim-select until new version is released * turrrrbo * fix npm ci * fix lint task * expose env variables needed by frontend build * fix dependencies * package-lock * backend watch ts and lint * add fe and be build scripts to root * fix dev not building packages * shared-types missing eslint * move shared types back to dev-deps * add packages to labeler * add packages step to ci * typo * filter update * remove concurrently from root * add scripts * abbreviate * rename * yeet * fixed path * test pkg * consistent ordering * rename * Revert "backend imports" This reverts commit d7151988290a9692ea7b0942feeaaff5d2da8224. * fix missing imports, remove last .js * remove test package --------- Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2024-07-22 21:08:11 +08:00
],
rules: {
//strict type checked
"@typescript-eslint/require-await": "off",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/await-thenable": "off",
"@typescript-eslint/no-unnecessary-template-expression": "off",
"@typescript-eslint/prefer-promise-reject-errors": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-unnecessary-type-arguments": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-redundant-type-constituents": "off",
"@typescript-eslint/restrict-plus-operands": "off",
// TODO: enable at some point
"@typescript-eslint/no-unsafe-assignment": "off", //~63
"@typescript-eslint/no-unsafe-argument": "off", //~37
"@typescript-eslint/no-unsafe-call": "off", //~76
"@typescript-eslint/no-unsafe-member-access": "off", //~105
//
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-confusing-void-expression": [
"error",
{ ignoreArrowShorthand: true },
],
"@typescript-eslint/explicit-function-return-type": [
"error",
{
allowExpressions: true,
},
],
refactor: restructure project to a true monorepo (#5626) * split ts files * packages * nomore workspace? * blah * build, exports * declaration * blargh * turrrrbo * fix fontawesome paths * allow file in eslint, fix ts errors * optimise package, update tsconfig * fix ts * update turbo config * eslint split * fix imports * fix types * lock * add turbo task * script * test task * pretty scripts * update prettier ignore * no cache for tests * lint task * turbo * no out * depend on env * fix mono breaking things * odl * fix version dependency of mongodb-memory-server * Revert "fix version dependency of mongodb-memory-server" This reverts commit 52ffac47b14ba398c0ce018ba963fd06f11b58fb. * update vitest-mongodb * release scripts * update ci * update dev script * ignore issues around firebase config * add check ts tasks * import isaxioserror * shared types package * replace tsnodedev with tsx * fix import * shared types * module * backend imports * declaration * node version * test code * assert json * verbatim * type * lodash * ts ver * fix fix fix? * remove assert * remove module and resolution * cleanup * tsconfig * fix frontend * remove unecessary props * more unused * remove skiplib * declaration map, dev script * remove install scripts * fix regex * move shared types to package * dont include shared types * remove path * update scripts * test code * test code * fix backend types * fully fix backend * fix frontend d.ts * add .js to imports * remove module * revert add .js * update tsconfig * use bundler module resolution * almost all frontend types * mooore * date fns * fix backend docker * fix ape keys * fix type * clean rimraf type * fix shared-types in workspace * fix import resolving * fix docker builds * ignore type problems on slim-select until new version is released * turrrrbo * fix npm ci * fix lint task * expose env variables needed by frontend build * fix dependencies * package-lock * backend watch ts and lint * add fe and be build scripts to root * fix dev not building packages * shared-types missing eslint * move shared types back to dev-deps * add packages to labeler * add packages step to ci * typo * filter update * remove concurrently from root * add scripts * abbreviate * rename * yeet * fixed path * test pkg * consistent ordering * rename * Revert "backend imports" This reverts commit d7151988290a9692ea7b0942feeaaff5d2da8224. * fix missing imports, remove last .js * remove test package --------- Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2024-07-22 21:08:11 +08:00
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "error",
refactor: restructure project to a true monorepo (#5626) * split ts files * packages * nomore workspace? * blah * build, exports * declaration * blargh * turrrrbo * fix fontawesome paths * allow file in eslint, fix ts errors * optimise package, update tsconfig * fix ts * update turbo config * eslint split * fix imports * fix types * lock * add turbo task * script * test task * pretty scripts * update prettier ignore * no cache for tests * lint task * turbo * no out * depend on env * fix mono breaking things * odl * fix version dependency of mongodb-memory-server * Revert "fix version dependency of mongodb-memory-server" This reverts commit 52ffac47b14ba398c0ce018ba963fd06f11b58fb. * update vitest-mongodb * release scripts * update ci * update dev script * ignore issues around firebase config * add check ts tasks * import isaxioserror * shared types package * replace tsnodedev with tsx * fix import * shared types * module * backend imports * declaration * node version * test code * assert json * verbatim * type * lodash * ts ver * fix fix fix? * remove assert * remove module and resolution * cleanup * tsconfig * fix frontend * remove unecessary props * more unused * remove skiplib * declaration map, dev script * remove install scripts * fix regex * move shared types to package * dont include shared types * remove path * update scripts * test code * test code * fix backend types * fully fix backend * fix frontend d.ts * add .js to imports * remove module * revert add .js * update tsconfig * use bundler module resolution * almost all frontend types * mooore * date fns * fix backend docker * fix ape keys * fix type * clean rimraf type * fix shared-types in workspace * fix import resolving * fix docker builds * ignore type problems on slim-select until new version is released * turrrrbo * fix npm ci * fix lint task * expose env variables needed by frontend build * fix dependencies * package-lock * backend watch ts and lint * add fe and be build scripts to root * fix dev not building packages * shared-types missing eslint * move shared types back to dev-deps * add packages to labeler * add packages step to ci * typo * filter update * remove concurrently from root * add scripts * abbreviate * rename * yeet * fixed path * test pkg * consistent ordering * rename * Revert "backend imports" This reverts commit d7151988290a9692ea7b0942feeaaff5d2da8224. * fix missing imports, remove last .js * remove test package --------- Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2024-07-22 21:08:11 +08:00
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^(_|e|event)",
caughtErrorsIgnorePattern: "^(_|e|error)",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-unused-expressions": [
"error",
{
allowTernary: true,
},
refactor: restructure project to a true monorepo (#5626) * split ts files * packages * nomore workspace? * blah * build, exports * declaration * blargh * turrrrbo * fix fontawesome paths * allow file in eslint, fix ts errors * optimise package, update tsconfig * fix ts * update turbo config * eslint split * fix imports * fix types * lock * add turbo task * script * test task * pretty scripts * update prettier ignore * no cache for tests * lint task * turbo * no out * depend on env * fix mono breaking things * odl * fix version dependency of mongodb-memory-server * Revert "fix version dependency of mongodb-memory-server" This reverts commit 52ffac47b14ba398c0ce018ba963fd06f11b58fb. * update vitest-mongodb * release scripts * update ci * update dev script * ignore issues around firebase config * add check ts tasks * import isaxioserror * shared types package * replace tsnodedev with tsx * fix import * shared types * module * backend imports * declaration * node version * test code * assert json * verbatim * type * lodash * ts ver * fix fix fix? * remove assert * remove module and resolution * cleanup * tsconfig * fix frontend * remove unecessary props * more unused * remove skiplib * declaration map, dev script * remove install scripts * fix regex * move shared types to package * dont include shared types * remove path * update scripts * test code * test code * fix backend types * fully fix backend * fix frontend d.ts * add .js to imports * remove module * revert add .js * update tsconfig * use bundler module resolution * almost all frontend types * mooore * date fns * fix backend docker * fix ape keys * fix type * clean rimraf type * fix shared-types in workspace * fix import resolving * fix docker builds * ignore type problems on slim-select until new version is released * turrrrbo * fix npm ci * fix lint task * expose env variables needed by frontend build * fix dependencies * package-lock * backend watch ts and lint * add fe and be build scripts to root * fix dev not building packages * shared-types missing eslint * move shared types back to dev-deps * add packages to labeler * add packages step to ci * typo * filter update * remove concurrently from root * add scripts * abbreviate * rename * yeet * fixed path * test pkg * consistent ordering * rename * Revert "backend imports" This reverts commit d7151988290a9692ea7b0942feeaaff5d2da8224. * fix missing imports, remove last .js * remove test package --------- Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2024-07-22 21:08: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": "error",
refactor: restructure project to a true monorepo (#5626) * split ts files * packages * nomore workspace? * blah * build, exports * declaration * blargh * turrrrbo * fix fontawesome paths * allow file in eslint, fix ts errors * optimise package, update tsconfig * fix ts * update turbo config * eslint split * fix imports * fix types * lock * add turbo task * script * test task * pretty scripts * update prettier ignore * no cache for tests * lint task * turbo * no out * depend on env * fix mono breaking things * odl * fix version dependency of mongodb-memory-server * Revert "fix version dependency of mongodb-memory-server" This reverts commit 52ffac47b14ba398c0ce018ba963fd06f11b58fb. * update vitest-mongodb * release scripts * update ci * update dev script * ignore issues around firebase config * add check ts tasks * import isaxioserror * shared types package * replace tsnodedev with tsx * fix import * shared types * module * backend imports * declaration * node version * test code * assert json * verbatim * type * lodash * ts ver * fix fix fix? * remove assert * remove module and resolution * cleanup * tsconfig * fix frontend * remove unecessary props * more unused * remove skiplib * declaration map, dev script * remove install scripts * fix regex * move shared types to package * dont include shared types * remove path * update scripts * test code * test code * fix backend types * fully fix backend * fix frontend d.ts * add .js to imports * remove module * revert add .js * update tsconfig * use bundler module resolution * almost all frontend types * mooore * date fns * fix backend docker * fix ape keys * fix type * clean rimraf type * fix shared-types in workspace * fix import resolving * fix docker builds * ignore type problems on slim-select until new version is released * turrrrbo * fix npm ci * fix lint task * expose env variables needed by frontend build * fix dependencies * package-lock * backend watch ts and lint * add fe and be build scripts to root * fix dev not building packages * shared-types missing eslint * move shared types back to dev-deps * add packages to labeler * add packages step to ci * typo * filter update * remove concurrently from root * add scripts * abbreviate * rename * yeet * fixed path * test pkg * consistent ordering * rename * Revert "backend imports" This reverts commit d7151988290a9692ea7b0942feeaaff5d2da8224. * fix missing imports, remove last .js * remove test package --------- Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2024-07-22 21:08:11 +08:00
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/strict-boolean-expressions": [
"error",
{ allowNullableBoolean: true, allowNullableNumber: true },
],
"@typescript-eslint/non-nullable-type-assertion-style": "off",
"@typescript-eslint/no-unnecessary-condition": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
refactor: restructure project to a true monorepo (#5626) * split ts files * packages * nomore workspace? * blah * build, exports * declaration * blargh * turrrrbo * fix fontawesome paths * allow file in eslint, fix ts errors * optimise package, update tsconfig * fix ts * update turbo config * eslint split * fix imports * fix types * lock * add turbo task * script * test task * pretty scripts * update prettier ignore * no cache for tests * lint task * turbo * no out * depend on env * fix mono breaking things * odl * fix version dependency of mongodb-memory-server * Revert "fix version dependency of mongodb-memory-server" This reverts commit 52ffac47b14ba398c0ce018ba963fd06f11b58fb. * update vitest-mongodb * release scripts * update ci * update dev script * ignore issues around firebase config * add check ts tasks * import isaxioserror * shared types package * replace tsnodedev with tsx * fix import * shared types * module * backend imports * declaration * node version * test code * assert json * verbatim * type * lodash * ts ver * fix fix fix? * remove assert * remove module and resolution * cleanup * tsconfig * fix frontend * remove unecessary props * more unused * remove skiplib * declaration map, dev script * remove install scripts * fix regex * move shared types to package * dont include shared types * remove path * update scripts * test code * test code * fix backend types * fully fix backend * fix frontend d.ts * add .js to imports * remove module * revert add .js * update tsconfig * use bundler module resolution * almost all frontend types * mooore * date fns * fix backend docker * fix ape keys * fix type * clean rimraf type * fix shared-types in workspace * fix import resolving * fix docker builds * ignore type problems on slim-select until new version is released * turrrrbo * fix npm ci * fix lint task * expose env variables needed by frontend build * fix dependencies * package-lock * backend watch ts and lint * add fe and be build scripts to root * fix dev not building packages * shared-types missing eslint * move shared types back to dev-deps * add packages to labeler * add packages step to ci * typo * filter update * remove concurrently from root * add scripts * abbreviate * rename * yeet * fixed path * test pkg * consistent ordering * rename * Revert "backend imports" This reverts commit d7151988290a9692ea7b0942feeaaff5d2da8224. * fix missing imports, remove last .js * remove test package --------- Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2024-07-22 21:08:11 +08:00
"@typescript-eslint/no-invalid-void-type": "off",
"import/namespace": "off",
},
settings: {
"import/resolver": {
typescript: {
project: "./tsconfig.json",
},
},
},
parserOptions: {
ecmaVersion: 12,
sourceType: "module",
project: "**/tsconfig.json",
},
},
],
};