eslint-config-ksv741/rules/style/.eslint-style-jsx.js
Sergey Krylov 23f1c08611 feat: add eslint 9 support, update dependencies
BREAKING CHANGE: not support eslint 8 versions and lower
2024-11-01 07:49:28 +03:00

64 lines
2.0 KiB
JavaScript

const stylistic = require('@stylistic/eslint-plugin');
module.exports = {
name: 'style-jsx',
plugins: {
'@stylistic': stylistic,
},
rules: {
'@stylistic/jsx-child-element-spacing': 'off',
'@stylistic/jsx-closing-bracket-location': ['error', 'line-aligned'],
'@stylistic/jsx-closing-tag-location': 'error',
'@stylistic/jsx-curly-brace-presence': ['error', {
props: 'never',
children: 'never',
}],
'@stylistic/jsx-curly-newline': ['error', {
multiline: 'consistent',
singleline: 'consistent',
}],
'@stylistic/jsx-curly-spacing': ['error', 'never', {
allowMultiline: true,
}],
'@stylistic/jsx-equals-spacing': ['error', 'never'],
'@stylistic/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
'@stylistic/jsx-indent-props': ['error', 2],
'@stylistic/jsx-max-props-per-line': ['error', {
maximum: { single: 3, multi: 1 },
}],
'@stylistic/jsx-newline': ['error', {
prevent: false,
}],
'@stylistic/jsx-one-expression-per-line': ['error', {
allow: 'literal',
}],
'@stylistic/jsx-props-no-multi-spaces': 'error',
'@stylistic/jsx-quotes': ['error', 'prefer-double'],
'@stylistic/jsx-self-closing-comp': 'off',
'@stylistic/jsx-sort-props': ['error', {
ignoreCase: true,
callbacksLast: true,
shorthandFirst: true,
shorthandLast: false,
noSortAlphabetically: false,
reservedFirst: true,
}],
'@stylistic/jsx-tag-spacing': ['error', {
closingSlash: 'never',
beforeSelfClosing: 'always',
afterOpening: 'never',
beforeClosing: 'never',
}],
'@stylistic/jsx-wrap-multilines': ['error', {
declaration: 'parens-new-line',
assignment: 'parens-new-line',
return: 'parens-new-line',
arrow: 'parens-new-line',
condition: 'parens-new-line',
logical: 'parens-new-line',
prop: 'parens-new-line',
}],
'@stylistic/jsx-function-call-newline': ['error', 'multiline'],
},
};