1. /**
    
  2.  * Copyright (c) Meta Platforms, Inc. and affiliates.
    
  3.  *
    
  4.  * This source code is licensed under the MIT license found in the
    
  5.  * LICENSE file in the root directory of this source tree.
    
  6.  */
    
  7. 
    
  8. 'use strict';
    
  9. 
    
  10. const minimist = require('minimist');
    
  11. const runESLint = require('../eslint');
    
  12. 
    
  13. async function main() {
    
  14.   console.log('Linting changed files...');
    
  15. 
    
  16.   // eslint-disable-next-line no-unused-vars
    
  17.   const {_, ...cliOptions} = minimist(process.argv.slice(2));
    
  18. 
    
  19.   if (await runESLint({onlyChanged: true, ...cliOptions})) {
    
  20.     console.log('Lint passed for changed files.');
    
  21.   } else {
    
  22.     console.log('Lint failed for changed files.');
    
  23.     process.exit(1);
    
  24.   }
    
  25. }
    
  26. 
    
  27. main();