]> source.dussan.org Git - jquery.git/commitdiff
Build: Append .eslintignore paths to grunt eslint paths
authorEd Sanders <ejsanders@gmail.com>
Tue, 21 Apr 2020 11:43:52 +0000 (12:43 +0100)
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Mon, 27 Jul 2020 19:14:05 +0000 (21:14 +0200)
This allows us to turn off the `quiet` option which was suppressing warnings.
We can also set `maxWarnings` to 0 now that aren't any.

Closes gh-4689

Gruntfile.js

index 43507c24bf16aa51dc255c786492246ac942ea28..5021c59e9e8e082f313d0a8b9f184344285521fd 100644 (file)
@@ -15,7 +15,8 @@ module.exports = function( grunt ) {
        var fs = require( "fs" ),
                gzip = require( "gzip-js" ),
                isTravis = process.env.TRAVIS,
-               travisBrowsers = process.env.BROWSERS && process.env.BROWSERS.split( "," );
+               travisBrowsers = process.env.BROWSERS && process.env.BROWSERS.split( "," ),
+               CLIEngine = require( "eslint" ).CLIEngine;
 
        if ( !grunt.option( "filename" ) ) {
                grunt.option( "filename", "jquery.js" );
@@ -77,9 +78,7 @@ module.exports = function( grunt ) {
                },
                eslint: {
                        options: {
-
-                               // See https://github.com/sindresorhus/grunt-eslint/issues/119
-                               quiet: true
+                               maxWarnings: 0
                        },
 
                        // We have to explicitly declare "src" property otherwise "newer"
@@ -88,7 +87,18 @@ module.exports = function( grunt ) {
                                src: [ "dist/jquery.js", "dist/jquery.min.js" ]
                        },
                        dev: {
-                               src: [ "src/**/*.js", "Gruntfile.js", "test/**/*.js", "build/**/*.js" ]
+                               src: [
+                                       "src/**/*.js",
+                                       "Gruntfile.js",
+                                       "test/**/*.js",
+                                       "build/**/*.js",
+
+                                       // Ignore files from .eslintignore
+                                       // See https://github.com/sindresorhus/grunt-eslint/issues/119
+                                       ...new CLIEngine()
+                                               .getConfigForFile( "Gruntfile.js" )
+                                               .ignorePatterns.map( ( p ) => `!${ p }` )
+                               ]
                        }
                },
                testswarm: {