Closed ai closed 5 years ago
@Tibfib seems like plugin have some problem with modules started with @
var CrossTabClient = require('@logux/client/cross-tab-client')
var isFirstOlder = require('@logux/core/is-first-older')
var createStore = require('redux').createStore
var NanoEvents = require('nanoevents')
Here is the same issue. Plugin force me to put newline after @logux/…
imports.
Oh, you’re right!
I see the problem. It’s the regular expression here. It’s not recognizing the @ symbol and classifying it correctly. https://github.com/Tibfib/eslint-plugin-import-helpers/blob/80658479f8c0039a02f99a6c20fc4b5af6e7ffe5/src/util/import-type.ts#L5
I’m on my phone now, I’ll see if I can fix it and have a new release within the next couple of days.
Of course, PRs welcome if you have the chance.
Sure, I will try to send PR in next 40 minutes
Any other characters you would start an import path with? @ _ \w
I think the regex could either be: /^[_@\w]/ or validate anything not starting with . or / (on my phone and can’t remember the exact regex syntax)
ESLint config:
Expected code after
--fix
Actual code after
--fix
(also ESLint show error on previous code)How I can ask the plugin to not force me to insert a newline in this example?