Skip to content

Commit 1d0f5b5

Browse files
committedJun 16, 2023
fix(eslint-config): changed func-names to ["error", "as-needed"] to work better with "func-style": ["error", "expression"]
Signed-off-by: prisis <d.bannert@anolilab.de>
1 parent 635ebec commit 1d0f5b5

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed
 

‎packages/eslint-config/src/config/plugins/typescript.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ if (pkg) {
4646
anolilabEslintConfig = pkg?.["anolilab"]?.["eslint-config"];
4747
}
4848

49+
let showUnsupportedTypeScriptVersionWarning: boolean = env["DISABLE_ESLINT_WARN_UNSUPPORTED_TYPESCRIPT_VERSION"] !== "true";
50+
51+
if (anolilabEslintConfig?.["warn_on_unsupported_typescript_version"] !== undefined) {
52+
showUnsupportedTypeScriptVersionWarning = anolilabEslintConfig?.["warn_on_unsupported_typescript_version"];
53+
}
54+
4955
const config: Linter.Config = {
5056
overrides: [
5157
{
@@ -58,10 +64,7 @@ const config: Linter.Config = {
5864
ecmaFeatures: {
5965
jsx: true,
6066
},
61-
warnOnUnsupportedTypeScriptVersion:
62-
typeof anolilabEslintConfig?.["warn_on_unsupported_typescript_version"] !== "undefined"
63-
? anolilabEslintConfig?.["warn_on_unsupported_typescript_version"]
64-
: env["DISABLE_ESLINT_WARN_UNSUPPORTED_TYPESCRIPT_VERSION"] !== "true",
67+
warnOnUnsupportedTypeScriptVersion: showUnsupportedTypeScriptVersionWarning,
6568
},
6669
settings: {
6770
// Apply special parsing for TypeScript files

‎packages/eslint-config/src/config/style.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const config: Linter.Config = {
130130

131131
// require function expressions to have a name
132132
// https://eslint.org/docs/rules/func-names
133-
"func-names": "warn",
133+
"func-names": ["error", "as-needed"],
134134

135135
// enforces use of function declarations or expressions
136136
// https://eslint.org/docs/rules/func-style

0 commit comments

Comments
 (0)
Please sign in to comment.