Skip to content

Commit

Permalink
fix: use es module for config format
Browse files Browse the repository at this point in the history
  • Loading branch information
limonte committed Aug 1, 2024
1 parent 75aa7d1 commit 6ce1517
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 22 deletions.
49 changes: 27 additions & 22 deletions index.js
Original file line number Diff line number Diff line change
@@ -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 },
],
},
}
)
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"files": [
"index.js"
],
"type": "module",
"peerDependencies": {
"eslint": "^9.0.0"
},
Expand Down

0 comments on commit 6ce1517

Please sign in to comment.