Files

29 lines
961 B
JavaScript

import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
export default [
{ignores: ['dist']},
js.configs.recommended,
{
files: ['**/*.{js,jsx}'],
languageOptions: {
parserOptions: {ecmaFeatures: {jsx: true}},
globals: {
...globals.browser,
// set by `define` in vite.config.js
__TRANSLATIONS_VERSION__: 'readonly',
__BUILD_COMMIT__: 'readonly',
__BUILD_TIME__: 'readonly',
},
},
plugins: {'react-hooks': reactHooks},
// Only the two classic rules: the React Compiler rules of the plugin's recommended set are a later step.
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
},
},
{files: ['*.config.js'], languageOptions: {globals: globals.node}},
];