Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Aug 10, 2024
1 parent 7ee8f58 commit 9b4d320
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 237 deletions.
48 changes: 14 additions & 34 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
import prettier from 'eslint-plugin-prettier'
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import js from '@eslint/js'
import { FlatCompat } from '@eslint/eslintrc'
import eslint from '@eslint/js'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import tseslint from 'typescript-eslint'

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 [
...compat.extends(
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:prettier/recommended',
'plugin:unicorn/recommended',
),
export default tseslint.config(
{
plugins: {
prettier,
'@typescript-eslint': typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: 'script',

parserOptions: {
project: './tsconfig.lint.json',
project: ['./tsconfig.lint.json'],
tsconfigRootDir: import.meta.dirname,
},
},
},
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylisticTypeChecked,
...tseslint.configs.strictTypeChecked,

eslintPluginUnicorn.configs['flat/recommended'],
{
rules: {
'@typescript-eslint/no-unused-vars': [
'warn',
Expand Down Expand Up @@ -101,4 +81,4 @@ export default [
'@typescript-eslint/prefer-nullish-coalescing': 'off',
},
},
]
)
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,25 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.7.0",
"@eslint/js": "^9.9.0",
"@types/jest": "^29.5.12",
"@types/long": "^4.0.0",
"@types/node": "^20.11.16",
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
"buffer": "^6.0.3",
"eslint": "^9.0.0",
"eslint": "^9.9.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-unicorn": "^54.0.0",
"eslint-plugin-unicorn": "^55.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"standard-changelog": "^6.0.0",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3",
"typescript-eslint": "^8.0.1",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4"
},
Expand Down
2 changes: 1 addition & 1 deletion test/tabixindexedfile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ test('can fetch the entire header for a very large vcf header', async () => {

const h = await f.getHeader()
const lastBit = 'CN_105715_AGL\tCDC_QG-1_AGL\tCDC_SB-1_AGL\n'
expect(h.slice(h.length - lastBit.length, h.length)).toEqual(lastBit)
expect(h.slice(h.length - lastBit.length)).toEqual(lastBit)
expect(h.at(-1)).toEqual('\n')
expect(h.length).toEqual(5315655)
})
Expand Down
Loading

0 comments on commit 9b4d320

Please sign in to comment.