Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
import js from '@eslint/js'
|
|
import globals from 'globals'
|
|
import reactHooks from 'eslint-plugin-react-hooks'
|
|
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
|
|
export default defineConfig([
|
|
globalIgnores(['dist']),
|
|
{
|
|
files: ['**/*.{js,jsx}'],
|
|
ignores: ['**/*.test.{js,jsx}'],
|
|
extends: [
|
|
js.configs.recommended,
|
|
reactHooks.configs.flat.recommended,
|
|
reactRefresh.configs.vite,
|
|
],
|
|
languageOptions: {
|
|
globals: globals.browser,
|
|
parserOptions: { ecmaFeatures: { jsx: true } },
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.test.{js,jsx}', 'src/test/**/*.{js,jsx}'],
|
|
extends: [js.configs.recommended],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.node,
|
|
...globals.es2021,
|
|
// Vitest globals (mirrors what vitest injects with globals: true)
|
|
describe: 'readonly',
|
|
it: 'readonly',
|
|
test: 'readonly',
|
|
expect: 'readonly',
|
|
vi: 'readonly',
|
|
beforeEach: 'readonly',
|
|
afterEach: 'readonly',
|
|
beforeAll: 'readonly',
|
|
afterAll: 'readonly',
|
|
},
|
|
parserOptions: { ecmaFeatures: { jsx: true } },
|
|
},
|
|
},
|
|
])
|