- Start Date: 2019-11-28
- RFC PR: (leave this empty, to be filled in later)
- Authors: Toru Nagashima (@mysticatea)
This proposal changes the default ignore patterns to include node_modules
in subdirectories and to exclude .eslintrc.js
.
- In monorepo style development, there are
node_modules
s in subdirectories. But the current default ignore patterns don't include it, so we have to configure ESLint withnode_modules
to ignore it. - Because ESLint ignores dotfiles, it doesn't lint
.eslintrc.js
by default. We have to configure ESLint with!.eslintrc.js
to lint it.
This proposal changes the default ignore patterns:
- (as-is)
.*
- (new)
!.eslintrc.js
- (change)
/node_modules/*
→/**/node_modules/*
- (as-is)
/bower_components/*
Therefore, ESLint lints .eslintrc.js
and ignores node_modules
in subdirectories.
For example, Babel has .babelrc.js
and VuePress has .vuepress/config.js
. ESLint ignores such files as dotfiles by default.
This proposal doesn't change this behavior because we don't want to have allowlist/denylist for all tools in the world. Instead, we can have unignoring patterns in the ignorePatterns
property of shareable configs for your tools.
- It needs an entry in the migration guide for 7.0.0 (or another major release) because of breaking changes.
- It needs to update the ".eslintignore" section to explain the new default ignore patterns.
This proposal doesn't increase maintenance cost because it just updates a pattern list.
If somebody wants to lint node_modules
in subdirectories, they have to configure ESLint to unignore those. But I guess that it's rarer than wanting to ignore node_modules
in subdirectories.
This is a breaking change.
- ESLint may report more warnings on
.eslintrc.js
. - ESLint may stop with fatal errors (all files are ignored) in the
node_modules
of subdirectories.
We can use the ignorePatterns
of shareable configs to configure and reuse this kind of matter.
- eslint/eslint#1163 - ignore node_modules folder by default
- eslint/eslint#10089 - .babelrc.js should not be ignored by default
- eslint/eslint#10341 - do not ignore files started with
.
by default