mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-07-25 16:03:48 +00:00
35 lines
698 B
JavaScript
35 lines
698 B
JavaScript
const { spawn } = require('child_process');
|
|
|
|
const showGraphQLLocalSchemaDumpMessage = () => {
|
|
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\`.
|
|
`);
|
|
};
|
|
|
|
const runEslint = () => {
|
|
const args = process.argv.slice(2);
|
|
const child = spawn(`yarn`, ['internal:eslint', ...args], {
|
|
stdio: 'inherit',
|
|
name: 'ESLint',
|
|
});
|
|
|
|
child.on('close', (code) => {
|
|
process.exitCode = code;
|
|
|
|
if (code === 0) {
|
|
return;
|
|
}
|
|
|
|
showGraphQLLocalSchemaDumpMessage();
|
|
});
|
|
};
|
|
|
|
if (require.main === module) {
|
|
runEslint();
|
|
}
|
|
|
|
module.exports = {
|
|
runEslint,
|
|
};
|