avajs / eslint-plugin-ava

ESLint rules for AVA
https://avajs.dev
MIT License
230 stars 49 forks source link

Allow import statements without default specifier #321

Closed exodustx0 closed 3 years ago

exodustx0 commented 3 years ago

Fixes #320

I'm following by example, based on the rest of the rules' code, but I'd imagine it'd be better if instead of the if-conditions, the selector strings took care of filtering the nodes? All of the if-conditions can be replaced as such.

Also, would it be necessary to add a line to the rule's doc that the following are passes?

const {TestInterface} = require('ava');
import type {TestInterface} from 'ava';

(This is my first (manual) PR, apologies in advance if I've missed anything.)

exodustx0 commented 3 years ago

Not quite sure what's up with the integration test; it worked no errors before. Then again, it's wholly unfamiliar territory to me.

sindresorhus commented 3 years ago

Not quite sure what's up with the integration test

I think the error is pretty clear if you look at it.

exodustx0 commented 3 years ago

I think the error is pretty clear if you look at it.

Right, my bad. Wasn't paying proper attention; the issue has now been resolved however.

sindresorhus commented 3 years ago

It would be good to add a test for that case that crashed too.

exodustx0 commented 3 years ago

It would be good to add a test for that case that crashed too.

Done.

sindresorhus commented 3 years ago

Can you also update the pass/fail exampels in the docs with more things? For example, import type ....

sindresorhus commented 3 years ago

@exodustx0 Bump

sindresorhus commented 3 years ago

@exodustx0 Bump