Skip to content

[RFC]: create an ESLint rule to enforce that the last require in an example is a relative path #3

Closed
stdlib-js/stdlib
#5379
@Planeshifter

Description

@Planeshifter

In non-fixture example JavaScript files, typically, the last require statement should always be a relative require. E.g.,

// Bad...

var beep = require( '@stdlib/boop/beep' );
var foo = require( '@stdlib/bar/foo' );


// Good...

var beep = require( '@stdlib/boop/beep' );
var foo = require( './../lib' );

The reason for this practice is to make explicit that the API being demonstrated belongs to the respective package and also mitigates potential copy-paste bugs.

Time estimate without AI: 1h.
Time estimate with AI: 30min.

Metadata

Metadata

Assignees

Labels

FeatureTask to add a new feature.difficulty: 1Low degree of difficulty. Should be straightforward to implement and/or resolve.estimate: <2hrsTask which should take less than 2 hours.🤖 AIAllowed to use AI.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions