Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
fix(toolchain): fix broken deps and updates translate-check script
Browse files Browse the repository at this point in the history
  • Loading branch information
fox1t committed Jun 16, 2020
1 parent 6532028 commit d0c35db
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 40 deletions.
30 changes: 14 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ module.exports = {
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json', './scripts/tsconfig.json'],
project: ['./tsconfig.json', './check-translations/tsconfig.json'],
tsconfigRootDir: './',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
moduleDirectory: ["node_modules"],
moduleDirectory: ['node_modules'],
},
"typescript": {
typescript: {
alwaysTryTypes: true,
}
},
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
Expand Down Expand Up @@ -61,19 +61,17 @@ module.exports = {
'no-nested-ternary': 'off',
'import/no-unresolved': 'off',
'import/extensions': ['error', 'never'],
'import/order': ["error", {
"groups": [
"external",
["sibling","parent","internal"],
"builtin",
"unknown",
],
"newlines-between": "always",
"alphabetize": {
"order": 'asc',
"caseInsensitive": true,
'import/order': [
'error',
{
groups: ['external', ['sibling', 'parent', 'internal'], 'builtin', 'unknown'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
}],
],
curly: ['error', 'all'],
},
}
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions scripts/tsconfig.json → check-translations/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"extends": "../tsconfig.json",
"include": [
"./checkMissingTranslations.ts"
"./index.ts"
],
"compilerOptions": {
"module": "commonjs",
"outDir": "../bin",
"outDir": "compiled",
"target": "es5",
"sourceMap": false
"sourceMap": false,
"noEmit": false
}
}
31 changes: 18 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"react-dom": "~16.13.0",
"react-i18next": "~11.5.0",
"react-redux": "~7.2.0",
"react-router": "~5.1.2",
"react-router-dom": "~5.1.2",
"react-router": "~5.2.0",
"react-router-dom": "~5.2.0",
"react-scripts": "~3.4.0",
"redux": "~4.0.5",
"redux-thunk": "~2.3.0",
"shortid": "^2.2.15",
"typescript": "~3.8.2",
"typescript": "~3.8.3",
"uuid": "^8.0.0",
"validator": "^13.0.0"
},
Expand All @@ -57,7 +57,7 @@
"@commitlint/config-conventional": "~8.3.4",
"@commitlint/core": "~8.3.5",
"@commitlint/prompt": "~8.3.5",
"@testing-library/react": "~10.1.0",
"@testing-library/react": "~10.2.1",
"@testing-library/react-hooks": "~3.3.0",
"@types/enzyme": "^3.10.5",
"@types/jest": "~26.0.0",
Expand All @@ -73,8 +73,8 @@
"@types/shortid": "^0.0.29",
"@types/uuid": "^8.0.0",
"@types/validator": "~13.0.0",
"@typescript-eslint/eslint-plugin": "~2.34.0",
"@typescript-eslint/parser": "~2.34.0",
"@typescript-eslint/eslint-plugin": "~3.3.0",
"@typescript-eslint/parser": "~3.3.0",
"chalk": "^4.0.0",
"commitizen": "~4.1.2",
"commitlint-config-cz": "~0.13.0",
Expand All @@ -92,32 +92,37 @@
"eslint-plugin-jsx-a11y": "~6.2.3",
"eslint-plugin-prettier": "~3.1.2",
"eslint-plugin-react": "~7.20.0",
"eslint-plugin-react-hooks": "~2.5.0",
"eslint-plugin-react-hooks": "~4.0.4",
"history": "~4.10.1",
"husky": "~4.2.1",
"jest": "~24.9.0",
"lint-staged": "~10.2.0",
"memdown": "~5.1.0",
"prettier": "~2.0.4",
"redux-mock-store": "~1.5.4",
"rimraf": "~3.0.2",
"source-map-explorer": "^2.2.2",
"standard-version": "~8.0.0",
"ts-jest": "~24.3.0"
"ts-jest": "~26.1.0"
},
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"commit": "npx git-cz",
"start": "yarn translation:check && react-scripts start",
"start": "npm run translation:check && react-scripts start",
"build": "react-scripts build",
"update": "npx npm-check -u",
"prepublishOnly": "npm run build",
"test": "yarn translation:check && react-scripts test --detectOpenHandles",
"test": "npm run translation:check && react-scripts test --detectOpenHandles",
"test:ci": "cross-env CI=true react-scripts test --passWithNoTests",
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \"scripts/**/*.{js,ts}\"",
"lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \"scripts/**/*.{js,ts}\" --fix",
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \"check-translations/**/*.{js,ts}\"",
"lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \"check-translations/**/*.{js,ts}\" --fix",
"lint-staged": "lint-staged",
"commitlint": "commitlint",
"coveralls": "npm run test:ci -- --coverage --watchAll=false && cat ./coverage/lcov.info",
"translation:check": "cd scripts && tsc && node ../bin/scripts/checkMissingTranslations.js"
"remove-compiled-translations": "rimraf ./check-translations/compiled",
"pretranslation:check": "npm run remove-compiled-translations",
"translation:check": "tsc -p ./check-translations/tsconfig.json && node ./check-translations/compiled/check-translations/index.js",
"posttranslation:check": "npm run remove-compiled-translations"
},
"browserslist": {
"production": [
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/clients/db/LabRepository.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint "@typescript-eslint/camelcase": "off" */

import shortid from 'shortid'

import LabRepository from '../../../clients/db/LabRepository'
Expand Down
1 change: 0 additions & 1 deletion src/clients/db/Repository.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint "@typescript-eslint/camelcase": "off" */
import { v4 as uuidv4 } from 'uuid'

import AbstractDBModel from '../../model/AbstractDBModel'
Expand Down
2 changes: 1 addition & 1 deletion src/components/network-status/NetworkStatusMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const OFFLINE_COLOR = 'rgba(255, 0, 0, 0.65)'
const OPACITY_TRANSITION_TIME = 4000
const BASE_STYLE = {
height: '50px',
pointerEvents: 'none' as 'none',
pointerEvents: 'none' as const,
transition: `opacity ${OPACITY_TRANSITION_TIME}ms ease-in`,
}

Expand Down
6 changes: 4 additions & 2 deletions src/custom-pouchdb.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable camelcase */
declare namespace PouchDB {
interface SearchQuery<Content> {
// Search string
Expand All @@ -16,8 +17,8 @@ declare namespace PouchDB {

filter?: (content: Content) => boolean

include_docs?: boolean
highlighting?: boolean
include_docs?: boolean
highlighting_pre?: string
highlighting_post?: string

Expand All @@ -36,10 +37,11 @@ declare namespace PouchDB {

interface SearchResponse<T> {
rows: Array<SearchRow<T>>

total_rows: number
}

interface Database<Content extends {} = {}> {
interface Database<Content extends Record<string, unknown> = Record<string, unknown>> {
search(query: SearchQuery<Content>): SearchResponse<Content>
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useUpdateEffect.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useRef, useEffect } from 'react'
import { useRef, useEffect, EffectCallback } from 'react'

export default function (effect: Function, dependencies: any[]) {
export default function (effect: EffectCallback, dependencies: any[]): void {
const isInitialMount = useRef(true)

useEffect(() => {
Expand Down

1 comment on commit d0c35db

@vercel
Copy link

@vercel vercel bot commented on d0c35db Jun 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.