diff --git a/index.js b/index.js index 24c8e03..0dd00db 100644 --- a/index.js +++ b/index.js @@ -1,22 +1,27 @@ -module.exports = { - parser: '@typescript-eslint/parser', - extends: [ - 'plugin:@typescript-eslint/recommended', - 'prettier', - ], - rules: { - '@typescript-eslint/consistent-type-imports': [ - 'error', - { prefer: 'type-imports' }, - ], - 'no-console': [ - 'error', - { allow: ['warn', 'error', 'info'] }, - ], - 'prefer-template': 'error', - 'sort-imports': [ - 'error', - { ignoreDeclarationSort: true }, - ], - }, -} +import eslint from '@eslint/js' +import tseslint from 'typescript-eslint' +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' + +export default tseslint.config( + eslint.configs.recommended, + ...tseslint.configs.recommended, + eslintPluginPrettierRecommended, + { + files: ['**/*.js', '**/*.ts'], + rules: { + '@typescript-eslint/consistent-type-imports': [ + 'error', + { prefer: 'type-imports' }, + ], + 'no-console': [ + 'error', + { allow: ['warn', 'error', 'info'] }, + ], + 'prefer-template': 'error', + 'sort-imports': [ + 'error', + { ignoreDeclarationSort: true }, + ], + }, + } +) diff --git a/package.json b/package.json index c243b95..ef090ba 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "files": [ "index.js" ], + "type": "module", "peerDependencies": { "eslint": "^9.0.0" },