Files
dotter/eslint.config.js
T
salam e687b4437b
linter / quality (push) Canceled after 0s
tests / ci (8.3) (push) Canceled after 0s
tests / ci (8.4) (push) Canceled after 0s
tests / ci (8.5) (push) Canceled after 0s
first commit
2026-10-06 18:53:03 +02:00

126 lines
3.3 KiB
JavaScript

import js from '@eslint/js';
import stylistic from '@stylistic/eslint-plugin';
import prettier from 'eslint-config-prettier/flat';
import importPlugin from 'eslint-plugin-import';
import svelte from 'eslint-plugin-svelte';
import ts from 'typescript-eslint';
const controlStatements = [
'if',
'return',
'for',
'while',
'do',
'switch',
'try',
'throw',
];
const paddingAroundControl = [
...controlStatements.flatMap((stmt) => [
{ blankLine: 'always', prev: '*', next: stmt },
{ blankLine: 'always', prev: stmt, next: '*' },
]),
];
export default ts.config(
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser,
},
},
},
{
files: ['**/*.svelte.ts'],
languageOptions: {
parser: ts.parser,
},
},
{
plugins: {
import: importPlugin,
},
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json',
},
node: true,
},
},
rules: {
'no-undef': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
fixStyle: 'separate-type-imports',
},
],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'import/consistent-type-specifier-style': [
'error',
'prefer-top-level',
],
},
},
{
plugins: {
'@stylistic': stylistic,
},
rules: {
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: false }],
'@stylistic/padding-line-between-statements': [
'error',
...paddingAroundControl,
],
},
},
{
ignores: [
'vendor',
'node_modules',
'public',
'bootstrap/ssr',
'tailwind.config.js',
'vite.config.ts',
'resources/js/actions/**',
'resources/js/components/ui/*',
'resources/js/routes/**',
'resources/js/wayfinder/**',
],
},
prettier, // Turn off all rules that might conflict with Prettier
{
plugins: {
'@stylistic': stylistic,
},
rules: {
curly: ['error', 'all'],
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: false }],
},
},
);