From 287b92870e62c89b3c484fa2852781fb1e426f12 Mon Sep 17 00:00:00 2001 From: Francesco Trotta Date: Sun, 11 Aug 2024 14:46:29 +0200 Subject: [PATCH] Update build --- .github/workflows/ci.yml | 12 ++++++----- example/ColoredCircle.ts | 2 +- gulpfile.js | 41 ++++++++++++++++-------------------- test/spec/ts-defs/210.tstest | 2 +- 4 files changed, 27 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a35503..61c6830 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,16 @@ -name: CI +name: Node.js CI -on: [push, pull_request] +on: + push: + branches: '**' + tags-ignore: '**' + pull_request: + branches: '**' jobs: build: - env: - TSESTREE_SINGLE_RUN: 'false' - name: Build runs-on: ubuntu-latest diff --git a/example/ColoredCircle.ts b/example/ColoredCircle.ts index 395d7d0..ef8e74a 100644 --- a/example/ColoredCircle.ts +++ b/example/ColoredCircle.ts @@ -141,7 +141,7 @@ console.log(ColoredCircle.isPrototypeOf(ColoredCircle)); // false console.log(Object.isPrototypeOf(ColoredCircle)); // false console.log(Function.prototype.isPrototypeOf(ColoredCircle)); // true -function getBaseNames(derivedClass: Function): string[] +function getBaseNames(derivedClass: new () => unknown): string[] { return getPrototypeListOf(derivedClass).map(({ name }: { name: string; }): string => name); } diff --git a/gulpfile.js b/gulpfile.js index b9bed2b..16f6f6b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -130,21 +130,21 @@ task 'functions': 'only-multiline', }, ], - 'no-unused-vars': - [ - 'error', - { - args: 'none', - caughtErrors: 'all', - ignoreRestSiblings: true, - vars: 'local', - varsIgnorePattern: '^(?:Green|WhiteUnit)Circle$', - }, - ], '@stylistic/quotes': ['error', 'double'], }; - const { 'no-unused-vars': noUnusedVars, ...TS_EXAMPLE_RULES } = JS_EXAMPLE_RULES; - TS_EXAMPLE_RULES['@typescript-eslint/no-unused-vars'] = noUnusedVars; + const TS_EXAMPLE_RULES = { ...JS_EXAMPLE_RULES }; + JS_EXAMPLE_RULES['no-unused-vars'] = + TS_EXAMPLE_RULES['@typescript-eslint/no-unused-vars'] = + [ + 'error', + { + args: 'none', + caughtErrors: 'all', + ignoreRestSiblings: true, + vars: 'local', + varsIgnorePattern: '^(?:Green|WhiteUnit)Circle$', + }, + ]; const overrideConfig = await createConfig ( @@ -164,13 +164,9 @@ task jsVersion: 2022, }, { - files: ['**/*.ts', '**/*.tstest'], - tsVersion: '4.7.0', - languageOptions: - { - parserOptions: - { extraFileExtensions: ['.tstest'], project: 'tsconfig.json' }, - }, + files: ['**/*.ts', '**/*.tstest'], + tsVersion: '4.7.0', + languageOptions: { parserOptions: { extraFileExtensions: ['.tstest'] } }, }, { files: ['example/**/*.js'], @@ -183,15 +179,14 @@ task rules: TS_EXAMPLE_RULES, }, { - files: ['lib/**/*.d.ts'], - rules: { '@stylistic/max-len': 'off' }, + files: ['lib/**/*.d.ts'], + rules: { '@stylistic/max-len': 'off' }, }, { files: ['**/*.tstest'], processor: tsTestProcessor, rules: { - '@stylistic/spaced-comment': 'off', '@typescript-eslint/no-extraneous-class': 'off', '@typescript-eslint/no-misused-new': 'off', '@typescript-eslint/no-unused-vars': 'off', diff --git a/test/spec/ts-defs/210.tstest b/test/spec/ts-defs/210.tstest index d2d66ea..1141164 100644 --- a/test/spec/ts-defs/210.tstest +++ b/test/spec/ts-defs/210.tstest @@ -15,7 +15,7 @@ class B void ( - (C: typeof A | typeof B): Function => + (C: typeof A | typeof B): (new () => unknown) => class extends classes(C) { } );