Skip to content

Commit

Permalink
🛠️ [Eslint] Finish converting new flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
beefchimi committed May 30, 2024
1 parent 6c3123a commit 87d8d68
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 32 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

75 changes: 46 additions & 29 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,31 +1,48 @@
{
"env": {
"browser": true,
"es2022": true
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/**'],
},
"extends": ["love", "plugin:prettier/recommended"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
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',

// This is preferred over `tsconfig` equivalents.
'@typescript-eslint/no-unused-vars': [
'warn',
{
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],

// Consider this rule:
/*
'@typescript-eslint/consistent-indexed-object-style': [
'error',
'index-signature',
],
*/
},
},
"rules": {
"no-console": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/consistent-indexed-object-style": [
"error",
"index-signature"
],
// This is preferred over `tsconfig` equivalents.
"@typescript-eslint/no-unused-vars": [
"warn",
{
"ignoreRestSiblings": true,
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"@typescript-eslint/strict-boolean-expressions": "off"
}
}
];

0 comments on commit 87d8d68

Please sign in to comment.