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

build: update dev deps #240

Merged
merged 3 commits into from
Aug 4, 2024
Merged
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
1 change: 0 additions & 1 deletion .nycrc.json → .c8rc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"extends": "@istanbuljs/nyc-config-typescript",
"include": ["src/**/*"],
"reporter": ["lcov", "text-summary", "html"],
"sourceMap": true,
Expand Down
40 changes: 0 additions & 40 deletions .cspell.json

This file was deleted.

77 changes: 0 additions & 77 deletions .eslintrc.json

This file was deleted.

7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
- name: Check spelling
run: yarn check-spelling

- name: Check types
run: yarn typecheck

test:
name: 'Test: Node v${{ matrix.node_version }}'
needs: pre_job
Expand All @@ -51,11 +54,11 @@ jobs:
os:
- 'ubuntu-latest'
node_version:
- '16'
- '18'
- '20'
runs-on: ${{ matrix.os }}
env:
REPORT_COVERAGE: ${{ fromJSON('["false", "true"]')[matrix.node_version == '16' && matrix.os == 'ubuntu-latest'] }}
REPORT_COVERAGE: ${{ fromJSON('["false", "true"]')[matrix.node_version == '18' && matrix.os == 'ubuntu-latest'] }}
EXCLUDE_RACE_TESTS: true
steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dist/
docs/
**/package-lock.json
**/*.js
!eslint.config.js
**/*.d.ts
!test/**/types/index.d.ts
*.tsbuildinfo
2 changes: 1 addition & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Testing `iter-ops` against the latest `rxjs`:

**Tested with:**

- NodeJS v16.13.1
- NodeJS v18.19.0
- rxjs v7.4.0
- iter-ops v1.5.2

Expand Down
6 changes: 3 additions & 3 deletions benchmarks/src/async.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {testIterOps} from './tests/iter-ops';
import {testRXJS} from './tests/rxjs';
import {toAsync} from '../../dist';
import {toAsync} from '../../';

// tslint:disable:no-console

Expand All @@ -16,8 +16,8 @@ const input: AsyncIterable<number> = {
[Symbol.asyncIterator](): AsyncIterator<number> {
const i = data.values();
return {
async next(): Promise<IteratorResult<number>> {
return i.next();
next(): Promise<IteratorResult<number>> {
return Promise.resolve(i.next());
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/src/tests/iter-ops.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {UnknownIterable, filter, map, pipe, toArray} from '../../../dist';
import {type UnknownIterable, filter, map, pipe, toArray} from '../../../';

export async function testIterOps(input: UnknownIterable<number>) {
const start = Date.now();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/src/tests/rxjs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {UnknownIterable} from '../../../dist';
import type {UnknownIterable} from '../../../';
import {filter, firstValueFrom, from, map, toArray} from 'rxjs';

export async function testRXJS(
Expand Down
15 changes: 15 additions & 0 deletions benchmarks/yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions cspell.config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
version: '0.2'

language: en-US

dictionaryDefinitions:
- name: project-dictionary
path: ./project-dictionary.txt
addWords: true

allowCompoundWords: true
caseSensitive: false
useGitignore: true

dictionaries:
- en_US
- bash
- filetypes
- fonts
- html
- misc
- node
- npm
- softwareTerms
- typescript
- project-dictionary

ignorePaths:
- project-dictionary.txt

ignoreRegExpList:
- /\b[a-f0-9]{6}\b/ui # ignore hex color codes
- /\b[a-z0-9]{32,}\b/ui # ignore long string of hex characters
- /`[^`]*`/u # ignore things in `...`
- /```[\w\W]*?```/u # ignore things in ```...```

overrides:
- filename: '**/*.yml'
ignoreRegExpList:
- /^\s*(?:[a-z0-9]|-|_|\"|')+:/ui # ignore keys

- filename: '.github/(actions|workflows)/*.yml'
ignoreRegExpList:
- /\b(?:[A-Za-z0-9\-_])+\/(?:[A-Za-z0-9\-_])+@v\d+(?:\.\d+){0,2}\b/ui # ignore action
99 changes: 99 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// @ts-check
import eslint from '@eslint/js';
import {includeIgnoreFile} from '@eslint/compat';
import tseslint from 'typescript-eslint';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-config-prettier';
import path from 'node:path';

export default tseslint.config(
// @ts-expect-error - upstream type conflict, safe to ignore. Remove this line when fixed upstream.
includeIgnoreFile(path.resolve(import.meta.dirname, '.gitignore')),
eslint.configs.recommended,
tseslint.configs.eslintRecommended,
{
files: ['**/*.ts'],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname
}
},
extends: tseslint.configs.recommendedTypeChecked,
rules: {
'@typescript-eslint/comma-dangle': 'error',
'@typescript-eslint/consistent-type-imports': [
'error',
{prefer: 'type-imports', fixStyle: 'inline-type-imports'}
],
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/quotes': ['error', 'single'],
'@typescript-eslint/semi': ['error', 'always'],
'no-console': 'error',
'no-constant-condition': 'off',
'no-else-return': [
'error',
{
allowElseIf: false
}
],
'prefer-const': 'error',
'semi-spacing': [
'error',
{
before: false,
after: true
}
],
'semi-style': ['error', 'last']
}
},
{
name: 'prettier',
files: ['**/*.ts'],
plugins: {
prettier: prettierPlugin
},
rules: {
// @ts-expect-error - type's aren't accurate enough.
...prettierPlugin.configs?.recommended?.rules,
...prettierConfig.rules
}
},
{
name: 'tests',
files: ['test/**/*.ts'],
rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/only-throw-error': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'@typescript-eslint/require-await': 'off'
}
},
{
name: 'type tests',
files: ['test/**/types/*.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'off'
}
},
{
name: 'benchmark',
files: ['benchmarks/**/*.ts'],
rules: {
'@typescript-eslint/no-floating-promises': 'off',
'no-console': 'off'
}
}
);
Loading
Loading