Skip to content

Commit

Permalink
Convert to typescript (#795)
Browse files Browse the repository at this point in the history
* Typescript config setup

* Add type annotations to components

* Further type additions

* And more...

* Add types to actions

* Add types to templates

* Further type checks

* Further type additons

* Install fuse latest

* Housekeeping

* Remove old type definitions

* Fix remaning type issues

* Fix some failing tests

* Remove types workflow

* Fix failing unit tests

* Resolve back space event regression

* Convert cypress files to .ts

* Fix eslint issues

* Remove cachebusting urls

* Resolve delete button bug

* Resolve regression bugs

* Fix lint script

* Fix lint workflow

* Pass args instead of object to keyboard handlers

* Flatten misc reducer

* Resolve keyboad action test failures

* Use Pick instead of Partial

* Use interfaces in action tests

* Update firefox image

* Incorporate #791

* Incorporate #788
  • Loading branch information
jshjohnson authored Dec 23, 2019
1 parent 3ed0272 commit 68313da
Show file tree
Hide file tree
Showing 73 changed files with 6,618 additions and 6,635 deletions.
35 changes: 25 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{
"parserOptions": {
"ecmaVersion": 2020
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier", "sort-class-members"],
"extends": [
"airbnb-base",
"plugin:prettier/recommended",
"plugin:compat/recommended"
"plugin:compat/recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["prettier", "sort-class-members"],
"env": {
"es6": true,
"browser": true
"browser": true,
"mocha": true,
"cypress/globals": true
},
"parserOptions": {
"project": "./tsconfig.json",
"ecmaVersion": 2020
},
"rules": {
"import/prefer-default-export": "off",
Expand Down Expand Up @@ -54,18 +59,23 @@
],
"accessorPairPositioning": "getThenSet"
}
]
],
"lines-between-class-members": "off",
"@typescript-eslint/no-namespace": "off"
},
"overrides": [
{
"files": ["*.test.js"],
"files": ["*.test.ts"],
"env": {
"mocha": true
},
"rules": {
"no-restricted-syntax": "off",
"compat/compat": "off",
"no-new": "off"
"no-new": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off"
}
},
{
Expand All @@ -92,6 +102,11 @@
"Element.prototype.classList",
"Element.prototype.closest",
"Element.prototype.dataset"
]
],
"import/resolver": {
"node": {
"extensions": [".js", ".ts"]
}
}
}
}
Binary file modified .github/actions-scripts/__snapshots__/firefox-darwin.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:

- name: run eslint
run: |
CHANGED_JS=$(git --no-pager diff --name-only ..origin/master | grep '^src\/scripts\/.*\.js$' | xargs ls -d 2>/dev/null | paste -sd " " -)
if [[ -z $(sed -e 's/[[:space:]]*$//' <<<${CHANGED_JS}) ]]; then CHANGED_JS="src/scripts"; fi
echo $CHANGED_JS
node node_modules/eslint/bin/eslint.js $CHANGED_JS
CHANGED_TS=$(git --no-pager diff --name-only ..origin/master | grep '^src\/scripts\/.*\.ts$' | xargs ls -d 2>/dev/null | paste -sd " " -)
if [[ -z $(sed -e 's/[[:space:]]*$//' <<<${CHANGED_TS}) ]]; then CHANGED_TS="src/scripts"; fi
echo $CHANGED_TS
node node_modules/eslint/bin/eslint.js $CHANGED_TS
- name: Lint JS bundle
run: |
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/types.yml

This file was deleted.

9 changes: 5 additions & 4 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require:
- '@babel/register'
- 'ts-node/register'
- './config/jsdom.js'

exit: true

spec: src/**/*.test.js
spec: src/**/**/*.test.ts
extension:
- ts
- js
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,8 @@
"fileMatch": [".prettierrc.json"],
"url": "http://json.schemastore.org/prettierrc"
}
]
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 68313da

Please sign in to comment.