import-js / import-js/eslint-plugin-import

newline-after-import: Proposal to add import/require flags

Open
#515 3 comments 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

I mostly use `import` at the top level and `require` inline with the rest of my code. Here's an example:

``` js
if (module.hot) {
module.hot.accept(() => {
// eslint-disable-next-line global-require
const nextRootReducer = require('../reducers').default;
store.replaceReducer(nextRootReducer);
});
}
```

Would it be possible to add an option to ignore `require` calls?

Contributor guide

Open the contributing guide

Research direction

Locate the newline-after-import rule and its tests, then read how the rule currently handles import and require statements. Define the option's expected behavior from the example: users should be able to ignore require calls while continuing to check imports, with tests covering both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.