Skip to content

Instantly share code, notes, and snippets.

@dexfs
Created November 7, 2024 12:39
Show Gist options
  • Save dexfs/53d90be4d66fd15f20ffbffcc7dc545b to your computer and use it in GitHub Desktop.
Save dexfs/53d90be4d66fd15f20ffbffcc7dc545b to your computer and use it in GitHub Desktop.
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import eslintPluginPrettier from "eslint-plugin-prettier";
import prettierConfig from 'eslint-config-prettier';
export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [
js.configs.recommended,
...tseslint.configs.recommended,
prettierConfig
],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'prettier': eslintPluginPrettier
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'prettier/prettier': 'warn'
},
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment