Add eslint rule no-relative-packages * Add eslint rule no-relative-packages Approved-by: Christian Andolf
44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
import globals from 'globals'
|
|
import tsParser from '@typescript-eslint/parser'
|
|
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
import { FlatCompat } from '@eslint/eslintrc'
|
|
import js from '@eslint/js'
|
|
import importPlugin from 'eslint-plugin-import'
|
|
|
|
const compat = new FlatCompat({
|
|
recommendedConfig: js.configs.recommended,
|
|
allConfig: js.configs.all,
|
|
})
|
|
|
|
export default defineConfig([
|
|
{
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
},
|
|
parser: tsParser,
|
|
},
|
|
extends: compat.extends(
|
|
'eslint:recommended',
|
|
'plugin:@typescript-eslint/recommended',
|
|
'plugin:react-hooks/recommended',
|
|
'plugin:storybook/recommended'
|
|
),
|
|
plugins: {
|
|
'react-refresh': reactRefresh,
|
|
import: importPlugin,
|
|
},
|
|
rules: {
|
|
'import/no-relative-packages': 'error',
|
|
'react-refresh/only-export-components': [
|
|
'warn',
|
|
{
|
|
allowConstantExport: true,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
globalIgnores(['**/dist', '**/.eslintrc.cjs']),
|
|
])
|