52 lines
1.0 KiB
JavaScript
52 lines
1.0 KiB
JavaScript
import js from '@eslint/js';
|
|
import globals from 'globals';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
|
|
export default [
|
|
{
|
|
ignores: [
|
|
'dist/**',
|
|
'dist-ssr/**',
|
|
'node_modules/**',
|
|
'certs/**',
|
|
'tmp/**',
|
|
'.dashfront-token',
|
|
],
|
|
},
|
|
js.configs.recommended,
|
|
{
|
|
files: ['**/*.{js,jsx,mjs}'],
|
|
languageOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
parserOptions: {
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
},
|
|
},
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.node,
|
|
React: 'readonly',
|
|
},
|
|
},
|
|
plugins: {
|
|
'react-hooks': reactHooks,
|
|
},
|
|
rules: {
|
|
'react-hooks/rules-of-hooks': 'error',
|
|
'react-hooks/exhaustive-deps': 'warn',
|
|
'no-unused-vars': [
|
|
'warn',
|
|
{
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^(React|_)',
|
|
ignoreRestSiblings: true,
|
|
},
|
|
],
|
|
'no-empty': ['warn', { allowEmptyCatch: true }],
|
|
'no-debugger': 'warn',
|
|
},
|
|
},
|
|
];
|