Skip to content

Commit

Permalink
chore: upgrade to eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
andykenward committed Jun 27, 2024
1 parent 6844148 commit 09f3016
Show file tree
Hide file tree
Showing 5 changed files with 1,169 additions and 994 deletions.
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

66 changes: 0 additions & 66 deletions .eslintrc.cjs

This file was deleted.

84 changes: 84 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// @ts-nocheck

import eslint from '@eslint/js'
import eslintConfigPrettier from 'eslint-config-prettier'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import vitest from 'eslint-plugin-vitest'
import globals from 'globals'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{
ignores: [
'.vscode',
'.devcontainer',
'dist',
'node_modules',
'eslint.config.js',
'example',
'payload-examples',
'__generated__'
]
},
{
files: ['**/*.{js,mjs,cjs,ts}']
},
{
languageOptions: {
globals: globals.node,
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname
}
}
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginUnicorn.configs['flat/all'],
{
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': 'off',
'no-console': 'error'
}
},
eslintConfigPrettier,
{
files: ['**/*.test.ts'],
plugins: {
vitest,
eslintPluginUnicorn
},
settings: {
vitest: {
typecheck: true
}
},
languageOptions: {
globals: {
...vitest.environments.env.globals
}
},
rules: {
...vitest.configs.all.rules,
'vitest/consistent-test-it': ['error', {fn: 'test'}],
'vitest/no-hooks': [
'error',
{allow: ['afterEach', 'beforeEach', 'afterAll']}
],
'vitest/max-expects': 'off',
'vitest/no-mocks-import': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/no-null': 'off',
'@typescript-eslint/unbound-method': 'off'
}
},
{
files: ['__fixtures__/**'],
rules: {
'unicorn/no-null': 'off',
'unicorn/numeric-separators-style': 'off'
}
}
)
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.1",
"@cloudflare/types": "6.29.0",
"@eslint/js": "9.5.0",
"@graphql-codegen/cli": "5.0.2",
"@graphql-codegen/client-preset": "4.2.5",
"@graphql-typed-document-node/core": "3.2.0",
Expand All @@ -64,23 +65,22 @@
"@octokit/webhooks-types": "7.5.1",
"@total-typescript/ts-reset": "0.5.1",
"@tsconfig/node20": "20.1.4",
"@types/eslint": "8.56.7",
"@types/json-schema": "7.0.15",
"@types/node": "20.11.17",
"@typescript-eslint/eslint-plugin": "7.7.0",
"@typescript-eslint/parser": "7.7.0",
"dotenv": "16.4.5",
"esbuild": "0.20.2",
"eslint": "8.57.0",
"eslint": "9.5.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-unicorn": "52.0.0",
"eslint-plugin-vitest": "0.4.1",
"eslint-plugin-unicorn": "54.0.0",
"eslint-plugin-vitest": "0.5.4",
"globals": "15.6.0",
"graphql": "16.8.1",
"graphql-tag": "2.12.6",
"prettier": "3.3.2",
"prettier-plugin-packagejson": "2.5.0",
"tsx": "4.11.0",
"typescript": "5.4.5",
"typescript-eslint": "7.14.1",
"undici": "6.14.1",
"vitest": "1.6.0"
},
Expand Down
Loading

0 comments on commit 09f3016

Please sign in to comment.