Open kristiandreher opened 3 months ago
Is this potentially related? looks like a dependency conflict
$ npm i @typescript-eslint/eslint-plugin@5.0.0 --save-dev
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: stargate-api@1.0.0
npm error Found: @typescript-eslint/parser@6.21.0
npm error node_modules/@typescript-eslint/parser
npm error @typescript-eslint/parser@"^6.6.0" from @aws-appsync/eslint-plugin@1.6.0
npm error node_modules/@aws-appsync/eslint-plugin
npm error dev @aws-appsync/eslint-plugin@"^1.6.0" from the root project
npm error
npm error Could not resolve dependency:
npm error dev @typescript-eslint/eslint-plugin@"5.0.0" from the root project
npm error
npm error Conflicting peer dependency: @typescript-eslint/parser@5.62.0
npm error node_modules/@typescript-eslint/parser
npm error peer @typescript-eslint/parser@"^5.0.0" from @typescript-eslint/eslint-plugin@5.0.0
npm error node_modules/@typescript-eslint/eslint-plugin
npm error dev @typescript-eslint/eslint-plugin@"5.0.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
bump.
Can someone help me understand? does AWS actively demand people code in the gui???
I'm facing the same issue
I must prefix this with: I do not understand how to configure ESLint. With a bunch of trial/error/copy&paste I ended up with this
import tseslint from "typescript-eslint";
import { fixupConfigRules } from "@eslint/compat";
import { FlatCompat } from "@eslint/eslintrc";
const flatCompat = new FlatCompat();
export default tseslint.config(
{
files: ["**/*.{ts}"],
},
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
files: ["**/*.{js,mjs}"],
extends: [tseslint.configs.disableTypeChecked],
},
{
languageOptions: {
parserOptions: {
project: true,
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
...fixupConfigRules(
flatCompat.extends("plugin:@aws-appsync/recommended")
).map((config) => ({
...config,
files: ["**/resolvers/**/*.ts"],
})),
{ ignores: ["eslint.config.mjs", "jest.config.js"] }
);
Which appears to be working. It will lint anything in /resolvers/
as an appsync resolver.
@osadi, I tried your solution, but I could not get it working. (I am no eslint expert either.) Are you using eslint v9? What other package versions are you using?
Yeah sorry, me neither actually. It was working, but coming back to it now I just get an OOM from eslint so somethings not right.
When trying to to use @aws-appsync/eslint-plugin with eslint v9 I get the following error message:
I suspsect that this is due to that the plugin has not been updated for eslint v9: https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#from-context-to-sourcecode