Last active
September 13, 2025 06:17
-
-
Save pyratin/1a5632133dc6c0953dd59fad53096327 to your computer and use it in GitHub Desktop.
eslint.config.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import js from '@eslint/js'; | |
import globals from 'globals'; | |
import tseslint from 'typescript-eslint'; | |
import pluginReact from 'eslint-plugin-react'; | |
import json from '@eslint/json'; | |
import css from '@eslint/css'; | |
import { defineConfig } from 'eslint/config'; | |
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; | |
import eslintPluginReactHooks from 'eslint-plugin-react-hooks'; | |
export default defineConfig([ | |
{ | |
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], | |
plugins: { js }, | |
extends: ['js/recommended'] | |
}, | |
{ | |
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], | |
languageOptions: { globals: { ...globals.browser, ...globals.node } } | |
}, | |
// @ts-expect-error external | |
tseslint.configs.recommended, | |
pluginReact.configs.flat.recommended, | |
eslintPluginReactHooks.configs['recommended-latest'], | |
eslintPluginPrettierRecommended, | |
{ | |
files: ['**/*.json'], | |
plugins: { json }, | |
language: 'json/json', | |
extends: ['json/recommended'] | |
}, | |
{ | |
files: ['**/*.jsonc'], | |
plugins: { json }, | |
language: 'json/jsonc', | |
extends: ['json/recommended'] | |
}, | |
{ | |
files: ['**/*.json5'], | |
plugins: { json }, | |
language: 'json/json5', | |
extends: ['json/recommended'] | |
}, | |
{ | |
files: ['**/*.css'], | |
plugins: { css }, | |
language: 'css/css', | |
extends: ['css/recommended'] | |
}, | |
{ | |
rules: { | |
'no-console': 'error', | |
'@typescript-eslint/no-unused-vars': [ | |
'error', | |
{ ignoreRestSiblings: true } | |
], | |
'@typescript-eslint/no-unused-expressions': [ | |
'error', | |
{ allowShortCircuit: true, allowTernary: true } | |
], | |
'react/no-unknown-property': 'off', | |
'react/prop-types': 'off' | |
} | |
} | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment