mysticatea / eslint-plugin-node

Additional ESLint's rules for Node.js
MIT License
958 stars 167 forks source link

Node/CommonJS require calls variable naming #285

Open lamuertepeluda opened 3 years ago

lamuertepeluda commented 3 years ago

Hi there,

I was wondering if this plugin (or any other) includes a rule for this use case, that is enforcing lowercase/camelCase naming for variables derived from default require calls, e.g.

const fs = require('fs') ✅
const path = require('path') ✅
const { SomeThing } = require('@some-module') ✅
const Fs = require('fs') ❌
const Path = require('path') ❌

Is this possible or should I write a custom rule for this? I have some ex-Java devs that keep using this unusual PascalCase convention, which is different from the rest of the code style 😅