mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
00a97272f2
Per [bjorn3][https://github.com/bjorn3] suggestion resolves cases where an early return is moved to a separate line due to line width formatting. This setting changes ``` if (a very long condition) return; ``` to ``` if (a very long condition) { return; } ``` while keeping ``` if (short) return; ``` as is. In pathological cases this may cause `npm run fix` not to fix formatting in one go and may require running it twice.
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
module.exports = {
|
|
env: {
|
|
es6: true,
|
|
node: true,
|
|
},
|
|
extends: ["prettier"],
|
|
parser: "@typescript-eslint/parser",
|
|
parserOptions: {
|
|
project: "tsconfig.eslint.json",
|
|
tsconfigRootDir: __dirname,
|
|
sourceType: "module",
|
|
},
|
|
plugins: ["@typescript-eslint"],
|
|
rules: {
|
|
camelcase: ["error"],
|
|
eqeqeq: ["error", "always", { null: "ignore" }],
|
|
curly: ["error", "multi-line"],
|
|
"no-console": ["error", { allow: ["warn", "error"] }],
|
|
"prefer-const": "error",
|
|
"@typescript-eslint/member-delimiter-style": [
|
|
"error",
|
|
{
|
|
multiline: {
|
|
delimiter: "semi",
|
|
requireLast: true,
|
|
},
|
|
singleline: {
|
|
delimiter: "semi",
|
|
requireLast: false,
|
|
},
|
|
},
|
|
],
|
|
"@typescript-eslint/semi": ["error", "always"],
|
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
"@typescript-eslint/no-floating-promises": "error",
|
|
},
|
|
};
|