Skip to content

Commit

Permalink
chore: upgrade all dev dependencies (#376)
Browse files Browse the repository at this point in the history
Upgrade available minor and patch versions of all dependencies, and
ESLint v9.
As part of ESLint major upgrade the ESLint config was migrated to flat
config, the plugins and rules used were cleaned up, and minor lint
issues were fixed.
  • Loading branch information
Balvajs authored Apr 9, 2024
1 parent ea9d90d commit ec8c961
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 18,297 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

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

This file was deleted.

3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"typescript.enablePromptUseWorkspaceTsdk": true
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.experimental.useFlatConfig": true
}
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/main.cjs

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

89 changes: 89 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import tsEslint from 'typescript-eslint'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import stylistic from '@stylistic/eslint-plugin'
import js from '@eslint/js'

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,
})

const recommendedConfig = [
{
files: ['**/*.ts', '**/*.tsx'],
...tsEslint.configs.base,
languageOptions: {
...tsEslint.configs.base.languageOptions,
parserOptions: {
EXPERIMENTAL_useProjectService: true,
sourceType: 'module',
},
},
},
// extract recommended config from typescript-eslint and enable it only for TS files
...[
...tsEslint.configs.recommended,
...tsEslint.configs.recommendedTypeChecked,
...tsEslint.configs.stylistic,
...tsEslint.configs.stylisticTypeChecked,
]
.map(({ rules, files }) =>
rules ? { rules, files: files ?? ['**/*.ts', '**/*.tsx'] } : undefined,
)
.filter(Boolean),
]

export default [
{ ignores: ['**/__generated__/**', 'node_modules/**', 'lib/**', 'dist/**'] },
{
linterOptions: {
reportUnusedDisableDirectives: true,
},
},
...recommendedConfig,
stylistic.configs['recommended-flat'],
js.configs.recommended,
...compat
.config({
extends: ['prettier'],
})
.map(config => ({
...config,
})),
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {
/**
* SECTION START: Disabled rules colliding with Prettier
*/
'@stylistic/no-tabs': 'off',
'@stylistic/indent': 'off',
'@stylistic/semi': 'off',
'@stylistic/brace-style': 'off',
'@stylistic/member-delimiter-style': 'off',
'@stylistic/quotes': 'off',
'@stylistic/indent-binary-ops': 'off',
'@stylistic/operator-linebreak': 'off',
'@stylistic/arrow-parens': 'off',
'@stylistic/quote-props': 'off',
'@stylistic/no-mixed-spaces-and-tabs': 'off',
/**
* SECTION END
*/
'no-console': 'off',
'no-restricted-syntax': 'off',
'arrow-parens': 'off',
'no-underscore-dangle': 'off',
camelcase: 'off',
semi: 'off',
'implicit-arrow-linebreak': 'off',
'no-undef': 'off',
},
},
]
Loading

0 comments on commit ec8c961

Please sign in to comment.