stack/eslint-configs/defaults.js
2024-02-28 14:35:30 +01:00

49 lines
1.3 KiB
JavaScript

module.exports = {
extends: [],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
parserOptions: {
// use the package folder as the root for the TS ESLint plugin
project: "./tsconfig.json",
tsconfigRootDir: process.cwd(),
},
rules: {
indent: ["warn", 2, { SwitchCase: 1 }],
semi: ["error", "always"],
"no-fallthrough": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/no-floating-promises": ["error", {
ignoreVoid: false,
}],
"no-return-await": "off",
"@typescript-eslint/return-await": ["error", "always"],
"no-multiple-empty-lines": "warn",
"@typescript-eslint/member-delimiter-style": [
"error",
{
multiline: {
delimiter: "comma",
},
singleline: {
delimiter: "comma",
requireLast: false,
},
multilineDetection: "brackets",
},
],
"no-restricted-syntax": [
"error",
{
selector: 'SwitchCase > *.consequent[type!="BlockStatement"]',
message: "Switch cases without blocks are disallowed.",
},
],
"@typescript-eslint/no-misused-promises": [
"error",
{
checksConditionals: true,
},
],
},
};