Skip to content

Commit

Permalink
🛠️ [Eslint] Flat config (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
beefchimi authored May 30, 2024
1 parent aa92595 commit dbfb287
Show file tree
Hide file tree
Showing 9 changed files with 573 additions and 673 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-goats-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'emitten': patch
---

Switch to eslint flat config.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.12
20.13
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": ["javascript", "typescript"],
"stylelint.enable": true,
"eslint.experimental.useFlatConfig": true,
"eslint.useFlatConfig": true,
"typescript.tsdk": "./node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"files.exclude": {
Expand Down
33 changes: 33 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import globals from 'globals';
import configLove from 'eslint-config-love';
// Includes both `config` and `plugin`.
import pluginPrettier from 'eslint-plugin-prettier/recommended';

export default [
{
ignores: ['coverage/**', 'dist/**'],
},
configLove,
pluginPrettier,
{
name: 'custom-rules',
files: ['**/*.ts', '**/*.js', '**/*.mjs'],
languageOptions: {
...configLove.languageOptions,
globals: {
...globals.browser,
},
ecmaVersion: 2022,
sourceType: 'module',
},
rules: {
'no-console': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
// '@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/consistent-indexed-object-style': [
'error',
'index-signature',
],
},
},
];
Loading

0 comments on commit dbfb287

Please sign in to comment.