From ae9823db6ee7ecedc272cefcb04e92b24b19fcb1 Mon Sep 17 00:00:00 2001 From: Ben Mosher Date: Mon, 14 Dec 2015 07:19:50 -0500 Subject: [PATCH] updated language for `import/ignore` setting (ref #103) --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0a4b5fff5..2174934f7 100644 --- a/README.md +++ b/README.md @@ -341,18 +341,24 @@ You may set the following settings in your `.eslintrc`: #### `import/ignore` A list of regex strings that, if matched by a path, will -not parse the matching module. In practice, this means rules other than -`no-unresolved` will not report on the `import` in question. +not report the matching module if no `export`s are found. +In practice, this means rules other than `no-unresolved` will not report on any +`import`s with (absolute) paths matching this pattern, _unless_ `export`s were +found when parsing. This allows you to ignore `node_modules` but still properly +lint packages that define a [`jsnext:main`] in `package.json` (Redux, D3's v4 packages, etc.). -This will replace the default of `node_modules`, so you may need to include it in your own list. Example: +**Note**: setting this explicitly will replace the default of `node_modules`, so you +may need to include it in your own list if you still want to ignore it. Example: ```yaml settings: import/ignore: - - node_modules - - coffee$ + - node_modules # mostly CommonJS (ignored by default) + - \.coffee$ # fraught with parse errors ``` +[`jsnext:main`]: https://github.com/rollup/rollup/wiki/jsnext:main + #### `import/resolver` See [resolver plugins](#resolver-plugins).