Linting fixes

This commit is contained in:
Jackson Harper 2024-03-12 21:34:20 +08:00
parent bdfa0aa1bb
commit 3266d6a9a3
3 changed files with 15 additions and 5 deletions

View file

@ -1,3 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/require-await */
import { authorized } from '../../utils/gql-utils'
import {
AddDiscoverFeedError,

View file

@ -42,7 +42,7 @@ const optInUltraRealisticVoice = async (uid: string): Promise<Feature> => {
const MAX_USERS = 1500
// opt in to feature for the first 1500 users
const optedInFeatures: Feature[] = await appDataSource.query(
const optedInFeatures: Feature[] = (await appDataSource.query(
`insert into omnivore.features (user_id, name, granted_at)
select $1, $2, $3 from omnivore.features
where name = $2 and granted_at is not null
@ -51,7 +51,7 @@ const optInUltraRealisticVoice = async (uid: string): Promise<Feature> => {
do update set granted_at = $3
returning *, granted_at as "grantedAt", created_at as "createdAt", updated_at as "updatedAt";`,
[uid, FeatureName.UltraRealisticVoice, new Date(), MAX_USERS]
)
)) as Feature[]
// if no new features were created then user has exceeded max users
if (optedInFeatures.length === 0) {

View file

@ -11,13 +11,19 @@
"rules": {
"arrow-spacing": ["warn", { "before": true, "after": true }],
"brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
"comma-dangle": ["warn", "always-multiline"],
"comma-dangle": ["warn", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}],
"comma-spacing": "error",
"comma-style": "error",
"curly": ["error", "multi-line", "consistent"],
"dot-location": ["error", "property"],
"handle-callback-err": "off",
"indent": ["warn", "tab"],
"indent": ["warn", 2],
"keyword-spacing": "error",
"max-nested-callbacks": ["error", { "max": 4 }],
"max-statements-per-line": ["error", { "max": 2 }],
@ -34,7 +40,7 @@
"object-curly-spacing": ["error", "always"],
"prefer-const": "error",
"quotes": ["error", "single"],
"semi": ["warn", "always"],
"semi": ["warn", "never"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", {
"anonymous": "never",