Skip to content

Commit

Permalink
updatedeslint
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdruid committed Aug 26, 2024
1 parent f4c1472 commit 4950a61
Show file tree
Hide file tree
Showing 4 changed files with 887 additions and 1,065 deletions.
77 changes: 0 additions & 77 deletions .eslintrc.yml

This file was deleted.

101 changes: 101 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import globals from 'globals'
import path from 'node:path'
import js from '@eslint/js'
import tsParser from '@typescript-eslint/parser'
import tsPlugin from '@typescript-eslint/eslint-plugin'

import { fileURLToPath } from 'node:url'
import { FlatCompat } from '@eslint/eslintrc'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

const compat = new FlatCompat({
baseDirectory : __dirname,
recommendedConfig : js.configs.recommended,
allConfig : js.configs.all
})

export default [
{
ignores: [
'.github',
'contrib',
'demo',
'docs',
'node_modules',
'scripts',
'test',
'eslint.config.mjs',
'rollup.config.ts'
]
},

{
languageOptions: {
globals: {
...globals.node,
...globals.browser,
},
ecmaVersion : 'latest',
sourceType : 'module',
parser : tsParser,
parserOptions : {
project : ['./tsconfig.json'],
tsconfigRootDir : process.cwd()
},
},

plugins: {
'@typescript-eslint' : tsPlugin,
},

files: ["src/**/*.ts"],

rules: {
semi : [2, 'never'],
'one-var' : 'off',
'return-await' : 'off',
indent : 'off',
'no-multi-spaces' : 'off',
'operator-linebreak' : 'off',
'array-bracket-spacing' : ['error', 'always'],

'key-spacing': ['error', {
multiLine: {
beforeColon: true,
afterColon: true,
},

align: {
beforeColon: true,
afterColon: true,
},
}],

'@typescript-eslint/indent': 'off',
'@typescript-eslint/return-await': [1, 'in-try-catch'],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/key-spacing': 'off',
'@typescript-eslint/consistent-type-imports': 'off',
'@typescript-eslint/require-array-sort-compare': 'off',
'@typescript-eslint/no-useless-constructor': 'off',

'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
ignoreRestSiblings: true,
}],

'@typescript-eslint/no-invalid-void-type': ['error', {
allowInGenericTypeArguments: true,
}],
},
}];
32 changes: 14 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"build": "./scripts/build.sh",
"demo": "./demo/run.sh",
"demo:vm": "yarn load demo/vm/eval.ts",
"lint": "eslint . --ext .ts",
"lint": "eslint src/**/*.ts",
"load": "tsx --tsconfig ./test/tsconfig.json",
"load:regtest": "NETWORK=regtest yarn load",
"load:mutiny": "NETWORK=mutiny yarn load",
Expand All @@ -98,34 +98,30 @@
"test": "yarn tsc && yarn load test/tape.ts | tap-spec"
},
"devDependencies": {
"@cmdcode/core-cmd": "1.5.3",
"@rollup/plugin-commonjs": "^25.0.7",
"@cmdcode/core-cmd": "1.6.3",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^20.11.28",
"@types/node": "^22.5.0",
"@types/tape": "^5.6.4",
"@typescript-eslint/eslint-plugin": "^7.3.0",
"@typescript-eslint/parser": "^7.3.0",
"eslint": "^8.56.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"rollup": "^4.13.0",
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.3.0",
"eslint": "^9.9.1",
"rollup": "^4.21.1",
"tap-spec": "^5.0.0",
"tape": "^5.7.5",
"tslib": "^2.6.2",
"tsx": "^4.7.1",
"typescript": "^5.4.2"
"tape": "^5.8.1",
"tslib": "^2.7.0",
"tsx": "^4.18.0",
"typescript": "^5.5.4"
},
"dependencies": {
"@cmdcode/buff": "2.2.5",
"@cmdcode/crypto-tools": "2.7.6",
"@cmdcode/musig2": "2.4.3",
"@cmdcode/signer": "1.4.7",
"@scrow/tapscript": "2.2.2",
"zod": "^3.22.4"
"@scrow/tapscript": "2.2.4",
"zod": "^3.23.8"
}
}
Loading

0 comments on commit 4950a61

Please sign in to comment.