From b30ccf40e1be22cd39b81aeac9a819fb9a775253 Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Mon, 23 Dec 2024 15:32:07 +0900 Subject: [PATCH] chore(examples/demo): add eslint.config.js --- examples/demo/eslint.config.js | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 examples/demo/eslint.config.js diff --git a/examples/demo/eslint.config.js b/examples/demo/eslint.config.js new file mode 100644 index 0000000000..daa009b325 --- /dev/null +++ b/examples/demo/eslint.config.js @@ -0,0 +1,44 @@ +import eslint from '@eslint/js' +import react from 'eslint-plugin-react' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import globals from 'globals' + +export default [ + { + ignores: ['dist'], + }, + eslint.configs.recommended, + react.configs.flat.recommended, + react.configs.flat['jsx-runtime'], + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.es2020, + }, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + }, + }, + plugins: { + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh, + }, + settings: { + react: { + version: '18.2', + }, + }, + rules: { + ...reactHooks.configs.recommended.rules, + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + 'react/prop-types': 'off', + 'react/no-unknown-property': ['off'], + }, + }, +]