mysticatea/eslint-plugin-node

new: no-private-api

Open

#167 aperta il 7 giu 2019

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)JavaScript (186 fork)github user discovery
acceptedenhancementhelp wanted

Metriche repository

Star
 (956 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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"]?

Guida contributor