summaryrefslogtreecommitdiff
path: root/scripts/frontend/eslint.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/frontend/eslint.js')
-rw-r--r--scripts/frontend/eslint.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/frontend/eslint.js b/scripts/frontend/eslint.js
new file mode 100644
index 00000000000..2ba5976d1b9
--- /dev/null
+++ b/scripts/frontend/eslint.js
@@ -0,0 +1,22 @@
+const { spawn } = require('child_process');
+
+const runEslint = () => {
+ const [, , ...args] = process.argv;
+ const child = spawn(`yarn`, ['internal:eslint', ...args], {
+ stdio: 'inherit',
+ });
+
+ child.on('exit', (code) => {
+ process.exitCode = code;
+
+ if (code === 0) {
+ return;
+ }
+ console.log(`
+If you are seeing @graphql-eslint offences, the local GraphQL schema dump might be outdated.
+Consider updating it by running \`./scripts/dump_graphql_schema\`.
+ `);
+ });
+};
+
+runEslint();