Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test TS ExpectType in CI #2968

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,13 @@ module.exports = {
overrides: [{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['types/tsconfig.json'],
},
plugins: ['eslint-plugin-expect-type'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:expect-type/recommended',
],
rules: {
// https://typescript-eslint.io/rules/no-use-before-define#how-to-use
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install dependencies
run: yarn && yarn add -D eslint-config-airbnb-base@^15 eslint-plugin-unicorn@^46 eslint-plugin-jest@^26.9.0 @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript
run: yarn && yarn add -D typescript eslint-config-airbnb-base@^15 eslint-plugin-unicorn@^46 eslint-plugin-jest@^26.9.0 @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-expect-type
- name: Lint JS and LESS files
run: npm run lint
- name: Assert LESS files formatting using Prettier
Expand Down Expand Up @@ -39,6 +39,12 @@ jobs:
run: yarn
- name: pre fomantic install & gulp build
run: yarn gulp install
- name: Install dependencies for TS
if: matrix.node-version != 12
run: yarn add -D typescript @types/jquery
- name: tsc build
if: matrix.node-version != 12
run: tsc --project types/tsconfig.json
codeql:
name: CodeQL
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion types/tests.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/// <reference path="index.d.ts" />

$().accordion(); // $ExpectType JQuery<HTMLElement>

Check failure on line 3 in types/tests.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected type to be: JQuery<HTMLElement>, got: any
$().api();// $ExpectType JQuery

Check failure on line 4 in types/tests.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected type to be: JQuery, got: any
$().calendar(); // $ExpectType JQuery<HTMLElement>
$().calendar(); // $ExpectType JQuery<JQuery>

Check failure on line 5 in types/tests.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected type to be: JQuery<JQuery>, got: any
$().checkbox(); // $ExpectType JQuery<HTMLElement>

Check failure on line 6 in types/tests.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected type to be: JQuery<HTMLElement>, got: any
$('body').dimmer(); // $ExpectType JQuery<HTMLElement>

Check failure on line 7 in types/tests.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected type to be: JQuery<HTMLElement>, got: any
$().dropdown(); // $ExpectType JQuery<HTMLElement>

Check failure on line 8 in types/tests.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected type to be: JQuery<HTMLElement>, got: any
$().embed(); // $ExpectType JQuery<HTMLElement>

Check failure on line 9 in types/tests.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected type to be: JQuery<HTMLElement>, got: any
$().flyout(); // $ExpectType JQuery<HTMLElement>

Check failure on line 10 in types/tests.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected type to be: JQuery<HTMLElement>, got: any
$().form(); // $ExpectType JQuery<HTMLElement>

Check failure on line 11 in types/tests.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected type to be: JQuery<HTMLElement>, got: any
$().modal(); // $ExpectType JQuery<HTMLElement>

Check failure on line 12 in types/tests.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected type to be: JQuery<HTMLElement>, got: any
$().nag(); // $ExpectType JQuery<HTMLElement>
$().popup(); // $ExpectType JQuery<HTMLElement>
$().progress(); // $ExpectType JQuery<HTMLElement>
Expand Down