-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
aws-lambda: any
return types don't agree with strict ESLint rules
#32025
Comments
@mfulton26 Thanks for opening the issue. Please share the your import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
/** @type {import('eslint').Linter.Config[]} */
export default [
{files: ["**/*.{js,mjs,cjs,ts}"]},
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
]; Thanks, |
The Here are some TypeScript ESLint Playground links demonstrating the issue and possible fix: I can create a more in-depth example if still needed but here are better steps to reproduce then I initially provided:
|
Reproducible after adding export default [
{files: ["**/*.{js,mjs,cjs,ts}"]},
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
rules: {
"@typescript-eslint/no-unsafe-assignment": "error",
},
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
}
}
}
]; |
Describe the bug
In some places
aws-cdk
returnsany
but this causes trouble for projects that forbid usage ofany
(e.g. via ESLint rules).Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
Returns types are properly typed so as to not trigger any
any
assignment lint warnings/errors.Current Behavior
Some APIs return
any
.Reproduction Steps
the usages of
FilterRule.isEqual()
are flagged with the following error:Possible Solution
Change the following in event-source-filter.d.ts from...
to...
Additional Information/Context
No response
CDK CLI Version
2.161.0 (build be5ad8b)
Framework Version
No response
Node.js Version
v20.18.0
OS
macOS Sonoma 14.7.1 (23H222)
Language
TypeScript
Language Version
5.6.2
Other information
No response
The text was updated successfully, but these errors were encountered: