You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@annotator.apache.org by ra...@apache.org on 2019/05/23 18:26:05 UTC

[incubator-annotator] 03/05: Forbid deep imports

This is an automated email from the ASF dual-hosted git repository.

randall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git

commit 459685b8601198a6cf1bae4bbe2592c271a7c12b
Author: Randall Leeds <ra...@apache.org>
AuthorDate: Thu May 23 13:29:01 2019 -0400

    Forbid deep imports
    
    Consider the top-level exports of a package module to be the public API
    and forbid importing a package's internal modules.
---
 .eslintrc.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/.eslintrc.js b/.eslintrc.js
index 1c99acd..1df57d4 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -16,6 +16,7 @@ module.exports = {
   rules: {
     'import/extensions': ['error', 'always', { ignorePackages: true }],
     'import/no-default-export': 'error',
+    'import/no-internal-modules': 'error',
     'import/order': 'error',
     'import/unambiguous': 'error',
     'no-restricted-syntax': [
@@ -76,6 +77,14 @@ module.exports = {
       globals: {
         assert: true,
       },
+      rules: {
+        'import/no-internal-modules': [
+          'error',
+          {
+            allow: ['ajv/lib/refs/json-schema-draft-04.json', 'src/**'],
+          },
+        ],
+      },
     },
   ],
 };