PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, October 9, 2022

[FIXED] How can I suppress the "No files matching the pattern" message in ESLint?

 October 09, 2022     continuous-integration, eslint     No comments   

Issue

In my CI setup, I have a test that runs eslint against all JS files. If no JS files exist, it's currently throwing an error. I'd prefer if it'd succeeded when no JS files exist. Is this possible?

$ eslint "./src/assets/scripts/**/*.js"

Oops! Something went wrong! :(

ESLint: 5.7.0.
No files matching the pattern "./src/assets/scripts/**/*.js" were found.
Please check for typing mistakes in the pattern.

ERROR: Job failed: exit code 1

Solution

The --no-error-on-unmatched-pattern flag was added in v6.8.0 of ESLint.

https://eslint.org/docs/user-guide/command-line-interface#no-error-on-unmatched-pattern



Answered By - ncraley
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing