Skip to content

Commit

Permalink
chore: upgrade to eslint 9 (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Oct 31, 2024
1 parent 5a19baa commit 03126da
Show file tree
Hide file tree
Showing 7 changed files with 294 additions and 362 deletions.
32 changes: 0 additions & 32 deletions .eslintrc.cjs

This file was deleted.

1 change: 0 additions & 1 deletion discord-webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ async function fetchJobs() {
...(process.env.GITHUB_TOKEN
? {
Authorization: `token ${process.env.GITHUB_TOKEN}`,
// eslint-disable-next-line no-mixed-spaces-and-tabs
}
: undefined),
},
Expand Down
42 changes: 42 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// @ts-check
import eslint from '@eslint/js'
import pluginN from 'eslint-plugin-n'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{
ignores: ['workspace/**'],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
{
name: 'main',
languageOptions: {
parser: tseslint.parser,
parserOptions: {
sourceType: 'module',
ecmaVersion: 2022,
project: true,
},
},
plugins: {
n: pluginN,
},
rules: {
eqeqeq: ['warn', 'always', { null: 'never' }],
'no-debugger': ['error'],
'no-empty': ['warn', { allowEmptyCatch: true }],
'no-process-exit': 'off',
'no-useless-escape': 'off',
'prefer-const': [
'warn',
{
destructuring: 'all',
},
],
'n/no-missing-import': 'off', // doesn't like ts imports
'n/no-process-exit': 'off',
'@typescript-eslint/no-explicit-any': 'off', // we use any in some places
},
},
)
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Vite Ecosystem CI",
"scripts": {
"prepare": "pnpm exec simple-git-hooks",
"lint": "eslint --ignore-path .gitignore '**/*.ts'",
"lint": "eslint '**/*.ts'",
"lint:fix": "pnpm lint --fix",
"typecheck": "tsc",
"format": "prettier --ignore-path .gitignore --check .",
Expand Down Expand Up @@ -48,18 +48,17 @@
},
"devDependencies": {
"@antfu/ni": "^0.23.0",
"@eslint/js": "^9.13.0",
"@types/node": "^20.17.1",
"@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"eslint": "^8.57.1",
"eslint-define-config": "^2.1.0",
"eslint": "^9.13.0",
"eslint-plugin-n": "^17.11.1",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"semver": "^7.6.3",
"simple-git-hooks": "^2.11.1",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
"typescript": "^5.6.3",
"typescript-eslint": "^8.11.0"
}
}
Loading

0 comments on commit 03126da

Please sign in to comment.