Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend ESLint #3964

Closed
jaiminpanchal27 opened this issue Jul 3, 2019 · 1 comment
Closed

Extend ESLint #3964

jaiminpanchal27 opened this issue Jul 3, 2019 · 1 comment

Comments

@jaiminpanchal27
Copy link
Collaborator

Type of issue

Feature Request

Description

With new submodules pattern implemented recently here, we are not allowing any module to import other modules. Modules can only import what is in src folder. Contributors adding code to modules may not know of this requirement and reviewers too may miss while approving pull requests. I think eslint can rescue us here.

Extend ES lint to throw error when modules are importing other modules. Also another good to have feature with this would be to make sure modules use relative path while importing.

Sample code which should throw error

// Consider two files 
// File 1 modules/currency.js
// File 2 modules/sampleBidAdapter.js

// sampleBidAdapter.js
...
import * from './currency'; // This should not be allowed.
...
...
// Consider two files 
// File 2 modules/sampleBidAdapter.js

// sampleBidAdapter.js
...
import * from 'src/utils'; // This should not be allowed.
import * from '../src/utils'; // Correct way to import module
...
...
@Fawke
Copy link
Contributor

Fawke commented Jul 5, 2019

Hi @jaiminpanchal27,

I've submitted a PR #3970 for this issue. Unfortunately, Circle CI is failing, I've to figure out why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants