Skip to content

Commit

Permalink
Merge pull request #8 from inaiat/chore/add_log_method
Browse files Browse the repository at this point in the history
chore: add log method
  • Loading branch information
inaiat authored Jun 19, 2024
2 parents 05e544d + 46de337 commit ccf540a
Show file tree
Hide file tree
Showing 18 changed files with 1,079 additions and 2,487 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- name: Install corepack
Expand Down
2 changes: 1 addition & 1 deletion BUILD_SHA
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9d146d1eb0e64913b0cbe14edb802b84ec73ef9b
05e544d9f7557435922ee406d0e6b43b252b7c31
26 changes: 26 additions & 0 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"lineWidth": 120,
"typescript": {
"quoteStyle": "preferSingle",
"semiColons": "asi",
"binaryExpression.operatorPosition": "sameLine",
"newLineKind": "auto"
},
"json": {},
"markdown": {},
"includes": [
"**/*.{ts,mjs,js,json}"
],
"excludes": [
"**/coverage",
"**/report",
"**/node_modules",
"**/*-lock.json",
"**/dist"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.90.4.wasm",
"https://plugins.dprint.dev/json-0.19.2.wasm",
"https://plugins.dprint.dev/markdown-0.17.0.wasm"
]
}
80 changes: 80 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import eslint from '@eslint/js'
import n from 'eslint-plugin-n'
import unicorn from 'eslint-plugin-unicorn'
import tseslint from 'typescript-eslint'

const customRules = {
'@typescript-eslint/array-type': ['error', { 'default': 'array-simple' }],
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
'args': 'all',
'argsIgnorePattern': '^_',
'caughtErrors': 'all',
'caughtErrorsIgnorePattern': '^_',
'destructuredArrayIgnorePattern': '^_',
'varsIgnorePattern': '^_',
'ignoreRestSiblings': true,
},
],
'no-console': 'error',

'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',

'capitalized-comments': 'off',
'new-cap': 'off',
'n/no-missing-import': 'off',
'unicorn/prevent-abbreviations': 'off',

'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
'@typescript-eslint/naming-convention': 'off',

'@typescript-eslint/object-curly-spacing': 'off',

'n/no-unpublished-import': 'off',
'unicorn/import-style': 'off',
'unicorn/no-array-method-this-argument': 'off',
'unicorn/no-array-callback-reference': 'off',
}

const languageOptions = {
parserOptions: {
project: true,
},
}

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
n.configs['flat/recommended-module'],
unicorn.configs['flat/recommended'],
{
ignores: ['*.mjs', 'dist', 'coverage/', 'report/'],
},
{
languageOptions,
rules: customRules,
},
{
files: ['**/tests/**'],
languageOptions,
rules: {
...customRules,
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'no-console': 'off',
'unicorn/no-null': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/consistent-function-scoping': 'off',
},
},
)
8 changes: 4 additions & 4 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@inaiat/resultar",
"version": "1.1.2",
"exports": "./src/index.ts"
}
"name": "@inaiat/resultar",
"version": "1.1.2",
"exports": "./src/index.ts"
}
96 changes: 21 additions & 75 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "resultar",
"version": "1.1.3",
"version": "1.1.4",
"description": "Result pattern for typescript",
"type": "module",
"packageManager": "pnpm@9.0.6",
"packageManager": "pnpm@9.4.0",
"exports": {
".": {
"import": "./dist/index.js",
Expand All @@ -13,18 +13,19 @@
},
"types": "dist/index.d.ts",
"engines": {
"node": ">=18"
"node": ">=20"
},
"outDir": "./dist",
"files": [
"dist"
],
"scripts": {
"build": "rimraf ./dist && mkdir dist && tsup && git rev-parse HEAD > BUILD_SHA",
"lint": "xo",
"lint:fix": "xo --fix",
"build": "tsup && git rev-parse HEAD > BUILD_SHA",
"format": "dprint fmt",
"lint": "dprint check && eslint",
"lint:fix": "dprint fmt && eslint --fix",
"prepublishOnly": "pnpm run build",
"test": "xo && tsx --test tests/*.ts",
"test": "node --import=tsx/esm --test tests/*.ts",
"typedoc": "typedoc",
"prepare": "husky || true"
},
Expand All @@ -51,19 +52,24 @@
},
"homepage": "https://github.com/inaiat/resultar",
"devDependencies": {
"@types/node": "^20.12.11",
"eslint-plugin-unused-imports": "^3.1.0",
"@sinclair/typebox": "^0.32.33",
"@types/node": "^20.14.5",
"dprint": "^0.46.3",
"eslint": "^9.5.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.9.0",
"eslint-plugin-unicorn": "^54.0.0",
"eslint-plugin-unused-imports": "^4.0.0",
"husky": "^9.0.11",
"rimraf": "^5.0.7",
"semver": "^7.6.2",
"testdouble": "^3.20.2",
"tsup": "^8.0.2",
"tsx": "^4.10.2",
"tsup": "^8.1.0",
"tsx": "^4.15.6",
"typedoc": "^0.25.13",
"typedoc-github-wiki-theme": "2.0.0",
"typedoc-plugin-markdown": "4.0.1",
"typedoc-plugin-markdown": "4.0.3",
"typescript": "5.4.5",
"xo": "0.58.0"
"typescript-eslint": "^7.13.1"
},
"tsup": {
"sourcemap": true,
Expand All @@ -82,14 +88,6 @@
"directories": {
"test": "test"
},
"ava": {
"extensions": {
"ts": "module"
},
"nodeArguments": [
"--loader=ts-node/esm"
]
},
"release": {
"branches": [
{
Expand All @@ -106,57 +104,5 @@
}
]
},
"xo": {
"semicolon": false,
"space": 2,
"bracketSpacing": true,
"plugins": [
"prettier",
"unused-imports"
],
"rules": {
"object-curly-spacing": [
"error",
"always"
],
"capitalized-comments": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-array-method-this-argument": "off",
"new-cap": "off",
"import/no-extraneous-dependencies": "off",
"@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/prefer-readonly-parameter-types": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/consistent-type-imports": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/object-curly-spacing": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"functional/no-classes": "off"
},
"overrides": [
{
"files": "tests/*.ts",
"rules": {
"functional/no-method-signature": "off",
"@typescript-eslint/prefer-readonly-parameter-types": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"functional/prefer-readonly-type": "off",
"ava/use-test": "off",
"unicorn/no-await-expression-member": "off",
"prefer-promise-reject-errors": "off"
}
}
]
},
"author": "[email protected]"
}
}
Loading

0 comments on commit ccf540a

Please sign in to comment.