[gnome-builder] eslint: tell eslint not to ignore files in node_modules/*



commit 702dd6af44b399ad7b1d06f609354b3a7c81fee9
Author: Giovanni Campagna <gcampagn cs stanford edu>
Date:   Sat Nov 25 16:19:54 2017 -0800

    eslint: tell eslint not to ignore files in node_modules/*
    
    eslint "helpfully" ignores all files in node_modules/* and
    bower_components/* by default (even if --no-ignore is passed).
    
    This is fine for command line usage, but in Builder, assume
    that if the user opens a file, they really want diagnostics
    for that file, regardless of its location.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790834

 src/plugins/eslint/eslint_plugin.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/eslint/eslint_plugin.py b/src/plugins/eslint/eslint_plugin.py
index a6926a1..5079c01 100644
--- a/src/plugins/eslint/eslint_plugin.py
+++ b/src/plugins/eslint/eslint_plugin.py
@@ -76,7 +76,9 @@ class ESLintDiagnosticProvider(Ide.Object, Ide.DiagnosticProvider):
 
     def execute(self, task, launcher, srcdir, file, file_content):
         try:
-            launcher.push_args((self._get_eslint(srcdir), '-f', 'json'))
+            launcher.push_args((self._get_eslint(srcdir), '-f', 'json',
+                                '--ignore-pattern', '!node_modules/*',
+                                '--ignore-pattern', '!bower_components/*'))
 
             if file_content:
                 launcher.push_argv('--stdin')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]