From 7726ed6a5e10e2a42e6b55ecaade1ffaafaa3559 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 26 Apr 2018 16:46:15 +0100 Subject: [PATCH] build: Simplify linter configs * eslint: Already excludes node_modules by default. https://eslint.org/docs/user-guide/configuring#ignoring * eslint: Expands directories by default, much faster to let ESLint crawl the directories while knowing what to exclude, then to let Grunt expand **/** recursively run each file individually. This makes Grunt run ESLint the same way as one normally would from the command line: `eslint .`, except without the eslint CLI sub-process. * eslint: Preserve the exclude for vendor via eslint config so that it also works when running ESLint outside Grunt, e.g. in IDEs or from the command line with extra options. * stylelint: Ignores node_modules by default. https://stylelint.io/user-guide/node-api/#files Change-Id: I1a78e9d93e7666c1539bcf4a3bc50306cecf89ba (cherry picked from commit 20f34321f426ad1155860aefaea37be403237b8f) --- Gruntfile.js | 7 +------ package.json | 5 ++++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 24faaef1..9d52c843 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,11 +9,7 @@ module.exports = function ( grunt ) { grunt.initConfig( { eslint: { - all: [ - '**/*.js', - '!node_modules/**', - '!vendor/**' - ] + all: '.' }, stylelint: { options: { @@ -21,7 +17,6 @@ module.exports = function ( grunt ) { }, all: [ '**/*.{css,less}', - '!node_modules/**', '!vendor/**' ] }, diff --git a/package.json b/package.json index 3dcc2ca6..07d3fafb 100644 --- a/package.json +++ b/package.json @@ -12,5 +12,8 @@ "grunt-stylelint": "0.9.0", "stylelint": "8.2.0", "stylelint-config-wikimedia": "0.4.2" - } + }, + "eslintIgnore": [ + "vendor/**" + ] }