Skip to content

Commit

Permalink
🛠️ [Eslint] Flat config (#26)
Browse files Browse the repository at this point in the history
* 🧰 [Dependency] Changes to support eslint flat config

* 🚚 [Eslint] Rename config file

* 🛠️ [VsCode] Add flat config support

* 🛠️ [TsConfig] Include new eslint config file

* 🛠️ [Eslint] Migrate config file

* 📝 [Report] Add changeset
  • Loading branch information
beefchimi authored May 30, 2024
1 parent 5a11749 commit ea34f6c
Show file tree
Hide file tree
Showing 8 changed files with 391 additions and 479 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-turkeys-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'vurtis': patch
---

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

This file was deleted.

17 changes: 0 additions & 17 deletions .eslintrc

This file was deleted.

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
29 changes: 29 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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',
},
},
];
Loading

0 comments on commit ea34f6c

Please sign in to comment.