Skip to content

Commit

Permalink
⬆️ Upgrade to eslint 9.x and @typescript-eslint 8.x
Browse files Browse the repository at this point in the history
- Migrated to flat-config
- Moved tests from __tests__ to src folder so that they will be compiled as well
- Lint tests now as well (and fix their linting)
  • Loading branch information
WtfJoke committed Feb 2, 2025
1 parent 969afae commit b254bf5
Show file tree
Hide file tree
Showing 14 changed files with 378 additions and 931 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ typings/
Thumbs.db

# Ignore built ts files
__tests__/runner/*
src/runner/*
lib/**/*
15 changes: 0 additions & 15 deletions __tests__/main.test.ts

This file was deleted.

2 changes: 1 addition & 1 deletion dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import jest from 'eslint-plugin-jest'
import github from 'eslint-plugin-github'

export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
github.getFlatConfigs().recommended,
...github.getFlatConfigs().typescript,
{
ignores: [
"dist/",
"lib/",
"node_modules/",
"jest.config.js",
"eslint.config.mjs",
],
},
{
rules: {
"i18n-text/no-en": "off", // I log only english messages and this is a library/user-facing.
"importPlugin/no-unresolved": "off" // This seems to work in typescript only with additional configuration.
}
},
{
// Jest
files: ['**/*.test.ts'],
...jest.configs['flat/recommended'],
},
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
);
Loading

0 comments on commit b254bf5

Please sign in to comment.