node.js – Use graphql-schema-linter with a CJS config file

I have a command to run the linter graphql-schema-linter -c build-util/config but we have upgraded our project to use Vite instead of Laravel Mix. We are now using CJS files for some of the JS files including the graphql-schema-linter.config.cjs instead of graphql-schema-linter.config.js. Is there a way for graphql-schema-linter to use this renamed config file? I have tried the following but still it doesn’t read it.

  • graphql-schema-linter -c build-util/config/*.cjs
  • graphql-schema-linter -c build-util/config/graphql-schema-linter.config.cjs

If I do graphql-schema-linter -c ./build-util/config -p ./build-util/config/*.cjs, I can see that the config file is being read (I have added a console.log in graphql-schema-linter.config.cjs). But in the documentation, the -p is for custom rule path, not a config path.

Read more here: Source link