From 0fed31660ce0859d3833ab6c601184f89d637a95 Mon Sep 17 00:00:00 2001 From: xobotyi Date: Sun, 1 Dec 2024 00:31:32 +0100 Subject: [PATCH] fix: adjust stylistic configs --- configs/base.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/configs/base.js b/configs/base.js index e1653fe..053dfa5 100644 --- a/configs/base.js +++ b/configs/base.js @@ -9,6 +9,7 @@ import {setFilesIfUndef} from './util.js'; /** @typedef {import('eslint').Linter} Linter */ +/** @type {Linter.Config[]} */ export const importConfig = [ importPlugin.flatConfigs.recommended, { @@ -268,7 +269,6 @@ const baseConfig = [ '@stylistic': stylistic, }, rules: { - '@stylistic/indent': ['error', 'tab', {tabLength: 2}], '@stylistic/max-len': [ 'warn', { @@ -282,6 +282,28 @@ const baseConfig = [ ignoreRegExpLiterals: true, }, ], + '@stylistic/indent': ['error', 'tab', { + SwitchCase: 1, + tabLength: 2, + flatTernaryExpressions: true, + offsetTernaryExpressions: true, + }], + '@stylistic/indent-binary-ops': ['error', 'tab'], + + '@stylistic/quotes': ['error', 'single', { + avoidEscape: true, + }], + '@stylistic/function-paren-newline': ['error', 'consistent'], + '@stylistic/arrow-parens': ['error', 'as-needed', {requireForBlockBody: true}], + '@stylistic/operator-linebreak': ['error', 'after'], + '@stylistic/multiline-ternary': ['error', 'always-multiline'], + '@stylistic/no-mixed-spaces-and-tabs': ['error', 'smart-tabs'], + '@stylistic/object-curly-newline': ['error', { + ObjectExpression: {multiline: true, consistent: true}, + ObjectPattern: {multiline: true, consistent: true}, + ImportDeclaration: {multiline: true, consistent: true}, + ExportDeclaration: {multiline: true, consistent: true}, + }], }, }, ];