Add initial project files
This commit is contained in:
Executable
+61
@@ -0,0 +1,61 @@
|
||||
import prettierConfig from 'eslint-config-prettier';
|
||||
import reactHooks from 'eslint-plugin-react-hooks';
|
||||
import reactRefresh from 'eslint-plugin-react-refresh';
|
||||
import globals from 'globals';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
const cleanGlobals = Object.fromEntries(
|
||||
Object.entries(globals.browser).map(([key, value]) => [key.trim(), value])
|
||||
);
|
||||
|
||||
export default tseslint.config(
|
||||
{ ignores: ['dist'] },
|
||||
{
|
||||
extends: [...tseslint.configs.recommended, prettierConfig],
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: cleanGlobals
|
||||
},
|
||||
plugins: {
|
||||
'react-hooks': reactHooks,
|
||||
'react-refresh': reactRefresh
|
||||
},
|
||||
rules: {
|
||||
...reactHooks.configs.recommended.rules,
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'warn',
|
||||
{
|
||||
/*
|
||||
* Check all function arguments for usage
|
||||
**/
|
||||
args: 'all',
|
||||
/*
|
||||
* Ignore function arguments that start with "_" (e.g., `_arg`)
|
||||
**/
|
||||
argsIgnorePattern: '^_',
|
||||
/*
|
||||
* Check all caught error variables in try/catch
|
||||
**/
|
||||
caughtErrors: 'all',
|
||||
/*
|
||||
*Ignore caught errors that start with "_" (e.g., `catch (_err)`)
|
||||
**/
|
||||
caughtErrorsIgnorePattern: '^_',
|
||||
/*
|
||||
* Ignore unused elements in array destructuring if they start with "_"
|
||||
**/
|
||||
destructuredArrayIgnorePattern: '^_',
|
||||
/*
|
||||
* Ignore variables declared but not used if they start with "_"
|
||||
**/
|
||||
varsIgnorePattern: '^_',
|
||||
/*
|
||||
* Ignore unused variables when using object rest spread (e.g., `const { a, ...rest } = obj;`)
|
||||
**/
|
||||
ignoreRestSiblings: true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user