From 27cca65e6ac4898defd2217f1c09f2cc746f3dd6 Mon Sep 17 00:00:00 2001 From: Matthew Eddy Date: Thu, 23 Mar 2023 11:51:06 -0400 Subject: [PATCH 1/3] added rule import/no-extraneous-dependencies to docs --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index a9964bcac6..3a17a9a50d 100644 --- a/README.md +++ b/README.md @@ -1469,6 +1469,23 @@ Other Style Guides import bar from './bar'; import baz from './baz'; ``` + + - [10.11](#modules--import/no-extraneous-dependencies) Forbid the use of extraneous packages. + eslint: [`import/no-extraneous-dependencies`](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md) + + > Why? You should only allow modules that are declared in the package.json's dependencies, devDependencies, optionalDependencies, peerDependencies, or bundledDependencies to be imported and used within the project. + + ```javascript + // bad + // Not declared in package,json - es6.js + import es6 from 'es6'; + const es6 = require('es6'); + + // good + // Declared in package.json es6.js + import es6 from 'es6'; + const es6 = require('es6'); + ``` **[⬆ back to top](#table-of-contents)** From d1a987e70f7063eef95a7030503960137b4893b7 Mon Sep 17 00:00:00 2001 From: Matthew Eddy Date: Thu, 23 Mar 2023 12:42:06 -0400 Subject: [PATCH 2/3] fixed linting issue and name prop --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a17a9a50d..e52823ec58 100644 --- a/README.md +++ b/README.md @@ -1468,8 +1468,11 @@ Other Style Guides import foo from './foo'; import bar from './bar'; import baz from './baz'; + ``` - + + + - [10.11](#modules--import/no-extraneous-dependencies) Forbid the use of extraneous packages. eslint: [`import/no-extraneous-dependencies`](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md) @@ -1485,6 +1488,7 @@ Other Style Guides // Declared in package.json es6.js import es6 from 'es6'; const es6 = require('es6'); + ``` **[⬆ back to top](#table-of-contents)** From 7a619284442669802baf45f3f155a88165a1c778 Mon Sep 17 00:00:00 2001 From: Matthew Eddy Date: Thu, 23 Mar 2023 12:46:17 -0400 Subject: [PATCH 3/3] fixed typo in docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e52823ec58..eef7d0e64d 100644 --- a/README.md +++ b/README.md @@ -1480,7 +1480,7 @@ Other Style Guides ```javascript // bad - // Not declared in package,json - es6.js + // Not declared in package.json - es6.js import es6 from 'es6'; const es6 = require('es6');