Skip to content

Commit

Permalink
feat: add eslint flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
allohamora committed Sep 21, 2024
1 parent 0c661f2 commit 33f0eea
Show file tree
Hide file tree
Showing 6 changed files with 388 additions and 634 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

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

This file was deleted.

50 changes: 50 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// @ts-check
import eslint from '@eslint/js';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import beautifulSort from 'eslint-plugin-beautiful-sort';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import tseslint from 'typescript-eslint';
import globals from 'globals';

export default tseslint.config(
eslint.configs.recommended,
eslintPluginPrettierRecommended,
...tseslint.configs.recommended,
{
files: ['**/*.ts'],
ignores: ['node_modules', 'dist', 'bin'],
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
'@typescript-eslint': tsPlugin,
'beautiful-sort': beautifulSort,
},
rules: {
'no-use-before-define': 'error',
'object-shorthand': 'warn',
'no-async-promise-executor': 'warn',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/no-deprecated': 'error',
'beautiful-sort/import': [
'error',
{
special: [],
order: ['special', 'namespace', 'default', 'defaultObj', 'obj', 'none'],
},
],
},
},
);
Loading

0 comments on commit 33f0eea

Please sign in to comment.