graphql-eslint icon indicating copy to clipboard operation
graphql-eslint copied to clipboard

Eslint object creation is slow

Open gituserjava opened this issue 1 year ago • 4 comments

ESLint object creation (line #1) below is taking 6-8 secs approx in AWS ECS environment. There are approximately 20 Graph ql schema files. Is there a way we can fine tune the performance? Please let me know.

const eslint = await new ESLint ({
useEslintrc: false,
baseConfig: (
parser: "@graphql-eslint/eslint-plugin",
plugins: ["@graphgl-eslint"],
parserOptions: (
schema: [
/* GraphoL */
directive @key (
fields: String = ""
) on FIELD
directive @link (
DEFINITION | ENUM VALUE OBJECT,
url: String = "", import:
[String] = ["abc"]
) on FIELD DEFINITION | ENUM
VALUE | OBJECT,
type Query{
dummy: String
type Mutation{
dummy: String
}
type Product {
dummy: String
}
type schema {
dummy: String
}
`
],
},
rules: rules,
noInlineConfig: true
},
})

gituserjava avatar Oct 14 '23 17:10 gituserjava

Please provide a reproduction repo and I take a look

dimaMachina avatar Oct 14 '23 17:10 dimaMachina

@B2o5T , I have invited you to one of my test repository. Please let me know if you are able to access it.

I am using similar config.json file for my ESLint configuration in actual project. Currently I am getting error "ConfigurationNotFoundError: No ESLint configuration found in /Users/userdir/Documents/workspace/linter/graphql/chats." which I am planning to fix but just wanted to share the repo to give an idea on the configuration. Also, this repo has 3 graphql files, but in my actual usecase I have ~20 files. Please advise.

gituserjava avatar Oct 17 '23 02:10 gituserjava

I have fixed the error, can you please take this repo and configuration as reference?

The slowness is not noticeable in local but only noticeable when running in AWS ECS environments. Please advise.

gituserjava avatar Oct 26 '23 22:10 gituserjava

@dimaMachina , did you get a chance to look into this?

gituserjava avatar Nov 01 '23 13:11 gituserjava