diff --git a/index.js b/index.js deleted file mode 100644 index 24c8e03..0000000 --- a/index.js +++ /dev/null @@ -1,22 +0,0 @@ -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 }, - ], - }, -} diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..0dd00db --- /dev/null +++ b/index.mjs @@ -0,0 +1,27 @@ +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..f2c84cf 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "author": "Limon Monte (https://limonte.github.io)", "license": "MIT", "files": [ - "index.js" + "index.mjs" ], "peerDependencies": { "eslint": "^9.0.0"