New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
brace-style
: else if
on same line
#255
Comments
This seems like a bug to me Edit: when using the shared config it works correctly when you explicitly specify module.exports = [
stylistic.configs.customize({
braceStyle: '1tbs',
}), however leaving it to the default which is supposed to be Edit edit: see #184 (comment), migrating from ESLint v8 this is all rather confusing... |
Ahh, I found the error. I specified eslint-stylistic/packages/eslint-plugin/configs/customize.ts Lines 51 to 55 in b9cbf9c
|
With regards to the defaults, see #163 for this, this is not actually a bug but wanted behavior (yes, it might be confusing, but that's up to the maintainers of this project to decide). The // my eslint.config.mjs file
import js from "@eslint/js";
import stylistic from "@stylistic/eslint-plugin";
import erb from "eslint-plugin-erb";
import globals from "globals";
export default [
js.configs.recommended,
// Allow linting of ERB files, see https://github.com/Splines/eslint-plugin-erb
erb.configs.recommended,
// Globally ignore the following paths
{
ignores: [
"node_modules/"
],
},
{
plugins: {
"@stylistic": stylistic,
},
rules: {
...stylistic.configs.customize({
"indent": 2,
"jsx": false,
"quoteProps": "always",
"semi": "always",
"braceStyle": "1tbs",
}).rules,
"@stylistic/quotes": ["error", "double", { avoidEscape: true }],
"no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
},
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...customGlobals,
...globals.browser,
...globals.jquery,
...globals.node,
},
},
linterOptions: {
// see https://github.com/Splines/eslint-plugin-erb/releases/tag/v2.0.1
reportUnusedDisableDirectives: "off",
},
},
]; |
Clear and concise description of the problem
Currently the
brace-style
does not allow for an option whereelse if
,else
etc. are placed next to the closing}
. E.g. I'd love to use1tbs
as style with the following example being correct:Suggested solution
No suggested solution yet. This issue might be relevant.
Alternative
No response
Additional context
No response
Validations
Contributes
The text was updated successfully, but these errors were encountered: