mysticatea/eslint-plugin-node

new: no-private-api

Open

#167 opened on Jun 7, 2019

View on GitHub
 (3 comments) (0 reactions) (0 assignees)JavaScript (186 forks)github user discovery
acceptedenhancementhelp wanted

Repository metrics

Stars
 (956 stars)
PR merge metrics
 (PR metrics pending)

Description

it's not a good practice to use non-public api. it would be nice to have a rule warns its usage.

// invalid
var foo = require('foo/bar.js');

// valid
var foo = require('foo');

/* eslint no-private-api: ["error", exceptions: ["foo/bar.js"]]
var foo = require('foo/bar.js');
  • a better rule name?
  • exceptions defaults to ["*/dist"]?

Contributor guide