The @stylistic/curly-newline rule was introduced in eslint-stylistic@2.9.0, and conflicts with Prettier depending on configuration (such as the configuration enabled by eslint-config-xo).
Minimal test case:
eslint.config.mjs
import eslintConfigPrettier from "eslint-config-prettier/flat";
import stylistic from "@stylistic/eslint-plugin";
export default [
{
plugins: { "@stylistic": stylistic },
rules: { "@stylistic/curly-newline": ["error", "always"] },
},
eslintConfigPrettier,
];
test.mjs
export const f = () => {};
$ npx eslint
/tmp/test/test.mjs
1:24 error Expected a line break after this opening brace @stylistic/curly-newline
1:25 error Expected a line break before this closing brace @stylistic/curly-newline
✖ 2 problems (2 errors, 0 warnings)
2 errors and 0 warnings potentially fixable with the `--fix` option.
$ npx eslint --fix
$ cat test.mjs
export const f = () => {
};
$ prettier -w test.mjs
test.mjs 17ms
$ cat test.mjs
export const f = () => {};
This PR was closed but the issue remains:
The
@stylistic/curly-newlinerule was introduced ineslint-stylistic@2.9.0, and conflicts with Prettier depending on configuration (such as the configuration enabled by eslint-config-xo).Minimal test case:
eslint.config.mjstest.mjsThis PR was closed but the issue remains:
@stylistic/curly-newline#342