mirror of
https://github.com/morten-olsen/morten-olsen.github.io.git
synced 2026-02-08 01:46:28 +01:00
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
import eslintPluginAstro from 'eslint-plugin-astro';
|
|
import importPlugin from 'eslint-plugin-import';
|
|
import eslint from '@eslint/js';
|
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
import tseslint from 'typescript-eslint';
|
|
|
|
export default tseslint.config(
|
|
eslint.configs.recommended,
|
|
...tseslint.configs.strict,
|
|
...tseslint.configs.stylistic,
|
|
eslintConfigPrettier,
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
extends: [importPlugin.flatConfigs.recommended, importPlugin.flatConfigs.typescript],
|
|
rules: {
|
|
'import/no-unresolved': 'off',
|
|
'import/extensions': ['error', 'ignorePackages'],
|
|
'import/exports-last': 'error',
|
|
'import/no-default-export': 'error',
|
|
'import/order': [
|
|
'error',
|
|
{
|
|
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
|
|
'newlines-between': 'always',
|
|
},
|
|
],
|
|
'import/no-duplicates': 'error',
|
|
},
|
|
},
|
|
{
|
|
rules: {
|
|
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
|
|
},
|
|
},
|
|
{
|
|
files: ['**.d.ts'],
|
|
rules: {
|
|
'@typescript-eslint/triple-slash-reference': 'off',
|
|
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
},
|
|
},
|
|
...eslintPluginAstro.configs.recommended,
|
|
{
|
|
ignores: ['**/node_modules/', '**/dist/', '**/.turbo/', '**/generated/'],
|
|
},
|
|
);
|