diff options
Diffstat (limited to 'eslint.config.js')
| -rw-r--r-- | eslint.config.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..e8c07b8 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,51 @@ +import js from '@eslint/js'; +import tsPlugin from '@typescript-eslint/eslint-plugin'; +import tsParser from '@typescript-eslint/parser'; +import prettierConfig from 'eslint-config-prettier'; +import prettierPlugin from 'eslint-plugin-prettier'; +import reactHooks from 'eslint-plugin-react-hooks'; +import globals from 'globals'; + +export default [ + { + ignores: ['dist/**', 'node_modules/**', '.eslintrc.cjs', 'vite.config.ts'], + }, + { + files: ['**/*.{ts,tsx}'], + languageOptions: { + parser: tsParser, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + ecmaFeatures: { + jsx: true, + }, + }, + globals: { + ...globals.browser, + ...globals.node, + ...globals.es2020, + }, + }, + plugins: { + '@typescript-eslint': tsPlugin, + 'react-hooks': reactHooks, + prettier: prettierPlugin, + }, + rules: { + ...js.configs.recommended.rules, + ...tsPlugin.configs.recommended.rules, + ...reactHooks.configs.recommended.rules, + ...prettierConfig.rules, + 'prettier/prettier': 'warn', + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }, + ], + }, + }, +]; |
