diff --git a/.eslintrc.js b/.eslintrc.js index 555555964c..25cdee90e8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97e7b45a0d..e62eea0553 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/types/tests.ts b/types/tests.ts index bae2db2667..ceb2d5c5cb 100644 --- a/types/tests.ts +++ b/types/tests.ts @@ -2,7 +2,7 @@ $().accordion(); // $ExpectType JQuery $().api();// $ExpectType JQuery -$().calendar(); // $ExpectType JQuery +$().calendar(); // $ExpectType JQuery $().checkbox(); // $ExpectType JQuery $('body').dimmer(); // $ExpectType JQuery $().dropdown(); // $ExpectType JQuery