Skip to content

Commit

Permalink
fix: adjust stylistic configs
Browse files Browse the repository at this point in the history
  • Loading branch information
xobotyi committed Nov 30, 2024
1 parent 34d24eb commit 0fed316
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion configs/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {setFilesIfUndef} from './util.js';

/** @typedef {import('eslint').Linter} Linter */

/** @type {Linter.Config[]} */
export const importConfig = [
importPlugin.flatConfigs.recommended,
{
Expand Down Expand Up @@ -268,7 +269,6 @@ const baseConfig = [
'@stylistic': stylistic,
},
rules: {
'@stylistic/indent': ['error', 'tab', {tabLength: 2}],
'@stylistic/max-len': [
'warn',
{
Expand All @@ -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},
}],
},
},
];
Expand Down

0 comments on commit 0fed316

Please sign in to comment.