From 61fcbb038b1bbbdc59e6c911cbb1fa4f11390578 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 7 Mar 2017 05:01:50 +0900 Subject: [PATCH] Update: deprecate no-hide-core-modules (fixes #69) --- README.md | 1 - docs/rules/no-hide-core-modules.md | 2 ++ lib/rules/no-hide-core-modules.js | 5 +++++ tests/lib/rules/no-hide-core-modules.js | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6eabc718..e11e052b 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,6 @@ Additional ESLint's rules for Node.js |:------:|:--------:|:-----------------------------------------------------------------|:------------| | | | [exports-style](docs/rules/exports-style.md) | Enforce either `module.exports` or `exports`. | :star: | | [no-deprecated-api](docs/rules/no-deprecated-api.md) | Disallow deprecated API. -| | | [no-hide-core-modules](docs/rules/no-hide-core-modules.md) | Disallow third-party modules which are hiding core modules. | | | [no-missing-import](docs/rules/no-missing-import.md) | Disallow `import` declarations for files that don't exist. :warning: | :star: | | [no-missing-require](docs/rules/no-missing-require.md) | Disallow `require()`s for files that don't exist. | :star: | | [no-unpublished-bin](docs/rules/no-unpublished-bin.md) | Disallow `bin` files that npm ignores. diff --git a/docs/rules/no-hide-core-modules.md b/docs/rules/no-hide-core-modules.md index a78ee9f5..fd9a6719 100644 --- a/docs/rules/no-hide-core-modules.md +++ b/docs/rules/no-hide-core-modules.md @@ -1,5 +1,7 @@ # Disallow third-party modules which are hiding core modules (node/no-hide-core-modules) +**:warning: This is deprecated since v4.2.0.** This rule was based on an invalid assumption. See also [#69](https://github.com/mysticatea/eslint-plugin-node/issues/69). + If you have dependencies which have the same name as core modules, your module would use the third-party modules instead of core modules. Especially, if you depends on such modules indirectly and npm flattens dependencies, you can depend on such third-party modules before as you know it. This might cause unintentional behaviors. diff --git a/lib/rules/no-hide-core-modules.js b/lib/rules/no-hide-core-modules.js index e324aad1..ed726da7 100644 --- a/lib/rules/no-hide-core-modules.js +++ b/lib/rules/no-hide-core-modules.js @@ -2,6 +2,10 @@ * @author Toru Nagashima * @copyright 2016 Toru Nagashima. All rights reserved. * See LICENSE file in root directory for full license. + * + * @deprecated since v4.2.0 + * This rule was based on an invalid assumption. + * No meaning. */ "use strict" @@ -104,6 +108,7 @@ module.exports = { category: "Possible Errors", recommended: false, }, + deprecated: true, fixable: false, schema: [ { diff --git a/tests/lib/rules/no-hide-core-modules.js b/tests/lib/rules/no-hide-core-modules.js index 3fed2e41..cf2f7c37 100644 --- a/tests/lib/rules/no-hide-core-modules.js +++ b/tests/lib/rules/no-hide-core-modules.js @@ -2,6 +2,10 @@ * @author Toru Nagashima * @copyright 2016 Toru Nagashima. All rights reserved. * See LICENSE file in root directory for full license. + * + * @deprecated since v4.2.0 + * This rule was based on an invalid assumption. + * No meaning. */ "use strict"