Skip to content

Commit

Permalink
refactor!: rewrite in typescript and zod
Browse files Browse the repository at this point in the history
  • Loading branch information
mackermans committed Jul 6, 2024
1 parent a0b221c commit 639d8bb
Show file tree
Hide file tree
Showing 26 changed files with 1,769 additions and 3,026 deletions.
61 changes: 61 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,

extends: ['eslint:recommended', 'plugin:prettier/recommended'],
env: {
es6: true,
mocha: true,
node: true,
},
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
overrides: [
{
extends: [
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
],
files: ['*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.eslint.json'],
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint'],
rules: {
// Type imports
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/consistent-type-imports': [
'warn',
{
fixStyle: 'inline-type-imports',
prefer: 'type-imports',
},
],
'@typescript-eslint/no-import-type-side-effects': 'error',

// Unsafe rules
'@typescript-eslint/no-explicit-any': ['warn'],
'@typescript-eslint/no-unsafe-assignment': ['warn'],
'@typescript-eslint/no-unsafe-return': ['warn'],

// Stylistic
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
},
},
],
}
7 changes: 0 additions & 7 deletions .eslintrc.json

This file was deleted.

5 changes: 5 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('prettier').Config} */
module.exports = {
semi: false,
singleQuote: true,
}
13 changes: 4 additions & 9 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
{
"test": ".js",
"module": {
"type": "commonjs"
},
"exclude": "(__test__|.test.js)",
"exclude": "(__test__|.test.ts)",
"jsc": {
"target": "es3",
"externalHelpers": false,
"parser": {
"syntax": "ecmascript",
"jsx": true,
"decorators": false,
"dynamicImport": false
}
"syntax": "typescript"
},
"target": "es2022"
}
}
Loading

0 comments on commit 639d8bb

Please sign in to comment.