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}, + }], }, }, ];