40 lines
924 B
JavaScript
40 lines
924 B
JavaScript
import js from '@eslint/js';
|
|
import prettier from 'eslint-config-prettier';
|
|
import reactPlugin from 'eslint-plugin-react';
|
|
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
|
import globals from 'globals';
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
{
|
|
files: ['**/*.{js,jsx}'],
|
|
languageOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: 'module',
|
|
parserOptions: {
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
},
|
|
},
|
|
globals: {
|
|
...globals.browser,
|
|
document: 'readonly',
|
|
window: 'readonly',
|
|
console: 'readonly',
|
|
JSX: true,
|
|
},
|
|
},
|
|
plugins: {
|
|
react: reactPlugin,
|
|
'react-hooks': reactHooksPlugin,
|
|
},
|
|
rules: {
|
|
...reactPlugin.configs.recommended.rules,
|
|
...reactHooksPlugin.configs.recommended.rules,
|
|
'react/prop-types': 'warn',
|
|
'react/react-in-jsx-scope': 'off',
|
|
},
|
|
},
|
|
prettier,
|
|
];
|